Skip to content

Restore "iffy" solution for skipping tasks for in-workflow build#38077

Merged
potiuk merged 1 commit intoapache:mainfrom
potiuk:fix-skipping-propagation-in-github-actions
Mar 12, 2024
Merged

Restore "iffy" solution for skipping tasks for in-workflow build#38077
potiuk merged 1 commit intoapache:mainfrom
potiuk:fix-skipping-propagation-in-github-actions

Conversation

@potiuk
Copy link
Member

@potiuk potiuk commented Mar 12, 2024

GitHub actions has strange and complex way of getting conditional jobs. When you want a job to depend on another job to be running when it is either successful of fully skipped, you have to write a rather peculiar condition:

always() && !failure() && !cancelled()

However, it turned out that this condition does not propoagate to to task that depends on the downstream tasks - for example if "wait-for-ci-images" had this condition and preceding "build-ci-images" was skipped, the "wait-for-ci-images" was happily running, but any of the other jobs that depended on "wait-for-ci-images" has been skipped :(. Simply - skipping tasks immediately propagates to all the downstream tasks and we cannot easily mitigate it.

This means that we have to come back to a solution that was implemented before #38057 - where instead of skipping the whole job, we skip all the steps in this kob. That makes it a little more clunky but makes the skipping status not propagate to downstream jobs.


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

Copy link
Collaborator

@aritra24 aritra24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, quite interesting 🤔. Looks good to me

@potiuk potiuk force-pushed the fix-skipping-propagation-in-github-actions branch from 8f242db to b50ea27 Compare March 12, 2024 14:48
@potiuk
Copy link
Member Author

potiuk commented Mar 12, 2024

Hmm, quite interesting 🤔. Looks good to me

Indeed. I thought I found a clever way to workaround the limitation, but I was wrong.

@potiuk
Copy link
Member Author

potiuk commented Mar 12, 2024

I added a nicer indication now - when we build and when skip in-workflow builds.

GitHub actions has strange and complex way of getting conditional
jobs. When you want a job to depend on another job to be running
when it is either successful of fully skipped, you have to write
a rather peculiar condition:

```
always() && !failure() && !cancelled()
```

However, it turned out that this condition does not propoagate to
to task that depends on the downstream tasks - for example if
"wait-for-ci-images" had this condition and preceding "build-ci-images"
was skipped, the "wait-for-ci-images" was happily running, but
any of the other jobs that depended on "wait-for-ci-images" has
been skipped :(. Simply - skipping tasks immediately propagates
to all the downstream tasks and we cannot easily mitigate it.

This means that we have to come back to a solution that
was implemented before apache#38057 - where instead of skipping the whole
job, we skip all the steps in this kob. That makes it a little more
clunky but makes the skipping status not propagate to downstream
jobs.
@potiuk potiuk force-pushed the fix-skipping-propagation-in-github-actions branch from b50ea27 to d03ad4d Compare March 12, 2024 14:56
@potiuk potiuk merged commit 0a985f7 into apache:main Mar 12, 2024
@potiuk potiuk deleted the fix-skipping-propagation-in-github-actions branch March 12, 2024 15:00
@potiuk
Copy link
Member Author

potiuk commented Mar 12, 2024

Uff :)

drajguru pushed a commit to drajguru/airflow that referenced this pull request Mar 14, 2024
…che#38077)

GitHub actions has strange and complex way of getting conditional
jobs. When you want a job to depend on another job to be running
when it is either successful of fully skipped, you have to write
a rather peculiar condition:

```
always() && !failure() && !cancelled()
```

However, it turned out that this condition does not propoagate to
to task that depends on the downstream tasks - for example if
"wait-for-ci-images" had this condition and preceding "build-ci-images"
was skipped, the "wait-for-ci-images" was happily running, but
any of the other jobs that depended on "wait-for-ci-images" has
been skipped :(. Simply - skipping tasks immediately propagates
to all the downstream tasks and we cannot easily mitigate it.

This means that we have to come back to a solution that
was implemented before apache#38057 - where instead of skipping the whole
job, we skip all the steps in this kob. That makes it a little more
clunky but makes the skipping status not propagate to downstream
jobs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants