jason810496 commented on code in PR #67337:
URL: https://github.com/apache/airflow/pull/67337#discussion_r3292879342
##########
dev/breeze/src/airflow_breeze/commands/ci_commands.py:
##########
@@ -1285,6 +1285,40 @@ def set_milestone(
console_print(f"[error]Failed to check existing milestone: {e}[/]")
return
+ # Re-read labels from the freshly-fetched issue to close the race between
+ # the workflow's initial label snapshot (taken by the get-pr-info job a
+ # couple of minutes ago) and the actual milestone-set step. Maintainers
+ # sometimes add and remove a backport label inside that window; honour
+ # the latest state, not the stale snapshot.
+ try:
+ current_labels = [label.name for label in issue.labels]
+ except Exception as e:
+ console_print(f"[warning]Could not re-read PR labels; falling back to
snapshot decision: {e}[/]")
+ current_labels = labels
+
+ if set(current_labels) != set(labels):
+ console_print("[info]Labels changed since workflow snapshot;
re-evaluating.[/]")
+ console_print(f"[info]Snapshot labels: {sorted(labels)}[/]")
+ console_print(f"[info]Current labels: {sorted(current_labels)}[/]")
+
+ if _should_skip_milestone_tagging(current_labels):
Review Comment:
If I understand the event correctly, we should add additional check in
`_should_skip_milestone_tagging`.
If there's any event that maintainer remove any backport label themself. We
need to skip the auto tagging.
Even with the new `if set(current_labels) != set(labels):` check, I don't
think the existing implementation of `_should_skip_milestone_tagging` would be
enough.
https://github.com/apache/airflow/blob/d0f981c2ffb7cb0177096582ac4625f84fa1e6b9/dev/breeze/src/airflow_breeze/global_constants.py#L832-L833
https://github.com/apache/airflow/blob/d0f981c2ffb7cb0177096582ac4625f84fa1e6b9/dev/breeze/src/airflow_breeze/commands/ci_commands.py#L1142-L1144
--
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]