potiuk commented on code in PR #75420:
URL: https://github.com/apache/airflow/pull/75420#discussion_r4351859732


##########
.github/workflows/ci-amd.yml:
##########
@@ -66,12 +65,88 @@ env:
   VERBOSE: "true"
 
 concurrency:
-  group: ci-amd-${{ github.event.pull_request.number || github.ref }}
-  cancel-in-progress: true
+  # Push runs have a group of their own per branch: a newer push cancels the 
older push run (the
+  # newer run then also tests the cancelled run's changes, see 
`check-run-needed`), and a push never
+  # cancels a full run of the branch.
+  group: >-
+    ci-amd-${{ github.event.pull_request.number || github.ref }}${{
+    github.event_name == 'push' && '-push' || '' }}
+  # A scheduled canary queues behind a run in progress instead of cancelling 
it: it may well be a
+  # manual run of the same commit, which the canary would otherwise cancel and 
then skip itself.
+  cancel-in-progress: ${{ github.event_name != 'schedule' }}
 
 jobs:
+  check-run-needed:
+    name: "Check if the run is needed"
+    # A scheduled canary is not needed when the last completed full run of 
this workflow on the
+    # branch tested the same commit and succeeded: it would only repeat that 
run. A push run tests
+    # the changes since the last successful run of this workflow on the 
branch, found here.
+    # This job runs for every event, with no steps for the others: every job 
of the run depends on
+    # it, and a skipped job here would skip all of them, whatever their own 
`if:` says.

Review Comment:
   The direct dependent would run with a status function, yes — but GitHub 
carries the skip down the whole chain below `build-info` (["a failure or skip 
applies to all jobs in the dependency 
chain"](https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax),
 actions/runner#491), so every job without `always()` would be skipped on PRs. 
Keeping the no-step slim job; I've reworded the comment to say exactly that.



##########
.github/workflows/ci-amd.yml:
##########
@@ -1261,6 +1348,7 @@ jobs:
       always() &&
       !cancelled() &&
       github.event_name == 'schedule' &&
+      needs.build-info.result != 'skipped' &&

Review Comment:
   Good catch — fixed: both lookups now fail open (push → all tests, canary → 
runs), and `notify-slack` gates on `needs.check-run-needed.outputs.run-needed 
!= 'false'` with `check-run-needed` added to `needs`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to