potiuk opened a new pull request, #67337: URL: https://github.com/apache/airflow/pull/67337
The \`milestone-tag-assistant.yml\` workflow snapshots PR labels at the \`get-pr-info\` job (via \`listPullRequestsAssociatedWithCommit\`) and then spends ~1.5 minutes installing Breeze and running \`breeze ci set-milestone\`. If a maintainer adds and removes a backport label inside that window, the action commits to the stale-snapshot decision and sets the wrong milestone. This happened on [#67301](https://github.com/apache/airflow/pull/67301): a \`backport-to-v3-2-test\` label that lived for **49 seconds** caused an \`Airflow 3.2.3\` milestone to be set on a \`main\`-only documentation PR. The workflow's [comment justifying the decision](https://github.com/apache/airflow/pull/67301#issuecomment-4512537753) was posted ~1.5 minutes after the label had already been removed. ### Timeline (PR #67301) | Time | Actor | Event | |---|---|---| | 20:31:18 | shahar1 | Merges PR (no milestone, no backport label) | | 20:31:28 | shahar1 | Adds \`backport-to-v3-2-test\` (+10 s) | | 20:32:17 | shahar1 | Removes \`backport-to-v3-2-test\` (+49 s after adding) | | 20:33:49 | github-actions[bot] | Sets milestone \`Airflow 3.2.3\` ❌ | | 20:33:51 | github-actions[bot] | Posts justifying comment | | next morning | eladkal | Removes the incorrect milestone | ### Fix Re-read \`issue.labels\` from the freshly-fetched issue (which is already in scope after the existing \`milestone is not None\` check) before computing the milestone. If the labels changed since the snapshot: - Honour any skip label that appeared after the snapshot. - Re-run \`_determine_milestone_version\` with the current labels and use the fresh decision; if the decision flips to "no milestone", bail out before posting the comment. Adds three regression tests covering the three race-window cases (backport label removed, replaced, skip label added) and updates two existing happy-path tests to populate \`mock_issue.labels\` so the re-read sees the same labels as the snapshot. --- ##### 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]
