jason810496 opened a new pull request, #67518:
URL: https://github.com/apache/airflow/pull/67518

   Follow-up to #67337 addressing review feedback from @jason810496 in 
https://github.com/apache/airflow/pull/67337#discussion_r3292879342.
   
   #67337 closed the snapshot/live-state race for PRs merged to `main`: if the 
workflow's snapshot caught a transient backport label that the maintainer later 
removed, the action re-reads the live labels, re-determines the milestone, and 
bails out when the determination flips to "no milestone".
   
   That still leaves a hole for PRs merged to a **version branch** (e.g. 
`v3-1-test`). In that case the merge-to-version-branch heuristic in 
`_determine_milestone_version` keeps producing a milestone on its own, so 
re-evaluation never flips to `None` even after the maintainer has removed every 
backport label.
   
   This PR treats **full removal of every `backport-to-*` label** during the 
workflow's race window as an explicit "don't auto-tag" signal that overrides 
every other auto-tagging condition — including merge-to-version-branch. A 
partial change that leaves a replacement `backport-to-*` label (the v3-1 → v3-2 
fix-the-target scenario, which has its own regression test from #67337) is 
still treated as a fix, not a cancel, so the milestone follows the new label.
   
   ### Changes
   
   - Extend `_should_skip_milestone_tagging` with an optional `snapshot_labels` 
parameter that returns `True` when every backport label seen in the snapshot 
has since been removed.
   - New `_all_backport_labels_removed(snapshot, current)` helper that returns 
the removed backport labels when no backport label remains, and an empty set 
otherwise (so a replacement falls through to normal re-evaluation).
   - Wire the check into the race-window block of `set_milestone` before the 
existing skip-label and re-determination paths.
   - Direct unit tests for both helpers and a new CLI-level regression test 
covering the version-branch case 
(`test_backport_label_removed_on_version_branch_should_skip`). The existing 
`test_backport_label_removed_after_snapshot_should_skip` is updated to assert 
the new short-circuit log line.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Opus 4.7)
   
   Generated-by: Claude Code (Opus 4.7) following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)


-- 
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