Skip to content

ci(pr): every non-train PR needs its issue's milestone and phase label (#20516) - #20525

Closed
mrveiss wants to merge 7 commits into
mainfrom
issue-20516-pr-structure
Closed

mrveiss wants to merge 7 commits into
mainfrom
issue-20516-pr-structure

Conversation

@mrveiss

@mrveiss mrveiss commented Nov 1, 2026

Copy link
Copy Markdown
Owner

Thinking Path

The rule that every PR carries its issue's milestone and phase label had nothing behind it: thirteen open PRs from one session lacked them on 2026-11-01. Issues already have this check through issue_structure.py, so this reuses its rules.

What Changed

  • pipeline-scripts/pr_structure.py applies issue_structure's milestone and phase rules to the PR in the event payload. train-* branches, bots and anyone who is not an owner, member or collaborator are excluded.
  • .github/workflows/pr-structure.yml runs it on every event that can change the answer, with read-only permissions.

Verification

pipeline-scripts/pr_structure_test.py passes locally; only this. Controls: a correct PR passes; neither, phase only, milestone only, a mismatched pair and a non-goal milestone each fail with an exact count; the script exits 1 on a bad payload and 0 on a good one; a branch merely containing "train" is still checked. The workflow has not run yet, so whether GitHub delivers milestoned to pull_request will first show on this PR's own run.

Worth reviewing:

  • This imports _milestone_item and _phase_item, private names, to keep one definition. Making them public would touch issue_structure.py's tests for no behaviour change.
  • Not required yet. That is a maintainer settings change, the last criterion, so this says Refs. It also has no merge_group: trigger, which it would need if the merge queue ruleset is ever enabled, since other required checks carry one.
  • PRs already open without labels will show a failed check on their next event. Dependabot counts as a bot and is excluded.

Model Used

Claude Opus 5.5

Refs #20516

🤖 Generated with Claude Code

@mrveiss mrveiss added the phase:M1.7 Docker docs and the docs close-out label Nov 1, 2026
@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 33 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 87eae8a and 7f7a7e9.

Files selected for processing: 4
  • .github/workflows/pr-structure.yml
  • pipeline-scripts/issue_structure.py
  • pipeline-scripts/pr_structure.py
  • pipeline-scripts/pr_structure_test.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Notice: 29 open PRs — past the runaway threshold (25)

This is not a request to defer this PR. There is no cap on open PRs (#19397) -- nothing blocks opening or pushing a PR.

This notice only means the count is high enough to be worth a glance for a runaway — something opening PRs in a loop, or a merge pipeline that has stalled so nothing is draining.

Currently open:

If the queue is draining normally, ignore this. Otherwise:

  1. Check whether CI is dispatching at all — see the ci-dispatch-watchdog status on these PRs
  2. Approved PRs land through the merge train the coordinator sequences (merge commits, never squash) -- check the open chore(merge-train) PR is moving, not each PR on its own
  3. Look for a loop opening near-identical PRs

Warn-only runaway detector — .github/workflows/pr-queue-gate.yml. It never blocks a merge.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

✅ SSOT Configuration Compliance: Passing

🎉 No new hardcoded values of either class — ssot and other both block.

Known backlog in pipeline-scripts/hardcoded_values_baseline.txt is suppressed and tracked in #14371.

@mrveiss

mrveiss commented Nov 1, 2026

Copy link
Copy Markdown
Owner Author

Code review on PR #20525 (head 76b315c): changes needed.

Read only; nothing was run. Injection and permissions are clean, and train and bot exclusions work.

  • Medium, pipeline-scripts/pr_structure.py:27-28: excluded() skips only train-* heads and user.type == "Bot". The pin-lowering job opens automation/duplication-pins PRs with a personal token, so they arrive as OWNER/User. Once this check is required, one with no milestone can't merge and the ratchet stops lowering until someone labels it by hand. Reuse EXCLUDED_PREFIXES from pipeline-scripts/branch_sync_core.py:34-39 and add a contrast case.
  • Low, pr_structure.py:33: it imports the private _milestone_item and _phase_item; a rename turns the check red on every PR. Make them public.
  • Low, .github/workflows/pr-structure.yml:26: the sparse checkout lists .github/actions/upsert-pr-comment, which nothing uses.

@mrveiss

mrveiss commented Nov 1, 2026

Copy link
Copy Markdown
Owner Author

Review answers: automation/ heads are now excluded through the shared EXCLUDED_PREFIXES with a contrast case, and the two helpers are public. The sparse-checkout low was not applied: issue_structure loads .github/actions/upsert-pr-comment at import through issue_api.load_upsert, and the script failed with FileNotFoundError without it. It stays, autobot_shared is added, and a new test runs the script from only the listed paths.

@mrveiss

mrveiss commented Nov 1, 2026

Copy link
Copy Markdown
Owner Author

Code review on PR #20525 (head 2814f12): approve.

excluded() now reuses EXCLUDED_PREFIXES, with a contrast case for automation/, and the helpers are public. Keeping the sparse-checkout path is right, given the author's FileNotFoundError and the new test running from only the listed paths. The exclusion also covers rescued/ heads, which come from their own job. Read only; I didn't run the tests. Making the check required on main remains a settings change, so Refs is correct.

This was referenced Nov 2, 2026
@mrveiss

mrveiss commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

Landed through the merge train (PR #20594), merge 655489c, with the content check clean. Proof: git rev-list --no-merges --count origin/main..head = 0; the head moved only by syncing main after the train froze it. Closing and deleting the branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

phase:M1.7 Docker docs and the docs close-out

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant