Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent outcome with conditional jobs in reusable workflow #32439

Open
2franix opened this issue Nov 6, 2024 · 8 comments
Open

Inconsistent outcome with conditional jobs in reusable workflow #32439

2franix opened this issue Nov 6, 2024 · 8 comments
Labels
topic/gitea-actions related to the actions of Gitea type/bug

Comments

@2franix
Copy link

2franix commented Nov 6, 2024

Description

Repro case here: https://code.defx.fr/cyrille/shell-bug-repro

This repo contains two workflows: one calling the other. The reusable workflows contains two jobs, the first being conditional, controlled by a cond input. The caller sets the input to false so the first job in the reusable workflow should always be skipped.

When running the caller workflow, I expect it to complete successfully by skipping the first reusable job and completing the second. This is what I get on one machine (see the screenshot with the light theme). But on another machine, I get what's shown on the screenshot with the dark theme: the workflow fails.

On the two machines, I am running the exact same docker compose project, with the exact same images that I pulled today. I consistently get the same result.

I have tried to dig into the code but after a few hours of research, I could not come to any conclusion.

I added a gist to the logs on the machine that fails to run the workflow as expected.

Gitea Version

1.22.3

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

https://gist.github.com/2franix/6d130a03c51ec33cc09ad33cb00e6cf5

Screenshots

On the machine failing to run the workflow:
image

On the machine succeeding:
image

Git Version

1.22.3

Operating System

Debian Bookworm 12.7

How are you running Gitea?

I am running Gitea on Docker with the following images:

  • Gitea: gitea/gitea:latest-rootless
  • ACT Runner: gitea/act_runner:latest
  • The runner is configured with GITEA_RUNNER_LABELS: "ubuntu-latest:docker:ghcr.io/catthehacker/ubuntu:act-latest"

Database

MySQL/MariaDB

@2franix
Copy link
Author

2franix commented Nov 6, 2024

Don't mind the name of the repo shell-bug-repro: I initially thought it was because my input was named shell instead of cond. But I later renamed it and the issue persisted.

If anyone has a clue or any ideas as to how I could debug this further, I'd love to hear from them. Thanks!

@2franix
Copy link
Author

2franix commented Nov 6, 2024

FWIW, I also reproduced the bug after removing the cond input and setting the condition to if: false in the reusable workflow.

I also tried to reverse the order of jobs in the reusable workflow and it led to the same outcome.

@2franix
Copy link
Author

2franix commented Nov 6, 2024

When changing the condition to if: true or when moving the condition to the single step, then the workflow runs successfully as expected.

@yp05327 yp05327 added the topic/gitea-actions related to the actions of Gitea label Nov 6, 2024
@Zettat123
Copy link
Contributor

I think this might be a bug on the act_runner side. I'll take a look

@2franix
Copy link
Author

2franix commented Nov 8, 2024

Thanks! Let me know if there is anything I can help with. It looks like this is a bug that may be difficult to reproduce.

@Zettat123
Copy link
Contributor

I reproduced the issue. But I don't know why one of your machines can run the job successfully. Are the configurations of the two act_runners different?

@2franix
Copy link
Author

2franix commented Nov 10, 2024

First and foremost: thank you for looking into it.

No, all my config is identical on the two machines, except two env vars: GITEA__ui__DEFAULT_THEME setting the theme, and GITEA____APP_NAME setting the name. The remainder is configured via compose or via the runner config in git.

Anyway, that's good news if you managed to reproduce!

Maybe if you explain what you have found, I can figure out why one of my machines does not exhibit the issue?

@Zettat123
Copy link
Contributor

I created a PR to fix this issue https://gitea.com/gitea/act/pulls/122

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic/gitea-actions related to the actions of Gitea type/bug
Projects
None yet
Development

No branches or pull requests

3 participants