eckit
eckit copied to clipboard
Fixes the CI if condition
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 64.91%. Comparing base (
9fac682) to head (addcd8b).
Additional details and impacted files
@@ Coverage Diff @@
## develop #183 +/- ##
========================================
Coverage 64.91% 64.91%
========================================
Files 1107 1107
Lines 56489 56489
Branches 4247 4247
========================================
Hits 36669 36669
Misses 19820 19820
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
Private downstream CI failed. Workflow name: private-downstream-ci View the logs at https://github.com/ecmwf/private-downstream-ci/actions/runs/14083413580.
Private downstream CI failed. Workflow name: private-downstream-ci-hpc View the logs at https://github.com/ecmwf/private-downstream-ci/actions/runs/14085058936.
that's what we have in other downstreams as well.
Just started to wonder about the reason for having
success() || failure()... seems to always happen, or are there other states likeskipped()?
I think it's cancelled. all our repos have it outside the "${{" but not sure which form is correct. or maybe we need !cancelled() .. I don't know
Private downstream CI succeeded. Workflow name: private-downstream-ci View the logs at https://github.com/ecmwf/private-downstream-ci/actions/runs/14263248192.
Private downstream CI succeeded. Workflow name: private-downstream-ci View the logs at https://github.com/ecmwf/private-downstream-ci/actions/runs/14263248192.
@mcakircali Do you want to pick this up again or should I close it?
The change is not correct as far as I can see: inside the conditional you can either use literals or expressions not mixed.
can you attach a reference for that statement?
also, have you looked at our other repos and compare?
I believe there was an issue in the past that lead to fix (see our other repos), it's best to ask Jakub or Dusan to review it.
@mcakircali If you look at: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idif
It is stated that ${{ }} can be omitted in this case because the whole condition will be evaluated as expression.
See the respective discussion here: https://github.com/orgs/community/discussions/27152
No ${{ ... }} at all should work, too. But using it for parts of the if value will always create a non-empty string, which is always true.
While this works I can understand it might be confusing. It is technically possible to omit
${{ }}syntax but mixing it would not be my recommendation - it is not explicitly mentioned in GitHub docs but it would make it consistent.The mixed syntax is currently being used in multiple ECMWF repos so I suggest to update those too along with the documentation.
as I mentioned in previous comment, previously we did not have the mixed syntax in our repos. The mixed syntax came as a fix from Dusan (I believe), hence I created this PR in eckit because it was not same as other repos.
I committed your suggestion to this PR (which also fixes the scope) and if it works, we can merge this and align other repos too, so that they are also not mixed syntax.
This does not yet address the issue fully. The private and non-private downstream jobs are not running for PRs from forks.
Looking at the other conditions:
private-downstream depends on downstream but downstream is never run for forks, and is thus skipped. The depending job for private-downstream will never run because success() || failure() id fall if downstream is skipped.
This does not yet address the issue fully. The private and non-private downstream jobs are not running for PRs from forks.
Looking at the other conditions:
private-downstreamdepends ondownstreambut downstream is never run for forks, and is thus skipped. The depending job forprivate-downstreamwill never run becausesuccess() || failure()id fall ifdownstreamis skipped.
Yes you are right, the fix should be applied to dowstream-ci too (as correctly presented in docs).
https://github.com/ecmwf/eckit/blob/59a51fc8573bd035aa4bc8c27d084aeb594670e4/.github/workflows/ci.yml#L26 https://github.com/ecmwf/eckit/blob/59a51fc8573bd035aa4bc8c27d084aeb594670e4/.github/workflows/ci.yml#L57 ->
${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }}
FYI, (don't ask me why) but I see that the tag is removed by bot:
Private downstream CI failed. Workflow name: private-downstream-ci-hpc View the logs at https://github.com/ecmwf/private-downstream-ci/actions/runs/15876941752.