-
Notifications
You must be signed in to change notification settings - Fork 402
ci: keep needs rebase labels current #1460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,33 @@ | ||
| # github-automation Specification | ||
|
|
||
| ## Purpose | ||
| Repository automation around the Codex review merge gate: the `Codex review labels` workflow and its synchronization script keep `🤖 codex: ok` / `🤖 codex: needs work` labels faithful to current-head CI state and Codex review evidence, with token sourcing that stays within GitHub API quotas and degrades safely when privileged credentials are unavailable. | ||
| Repository automation around the Codex review merge gate: the `Codex review labels` workflow and its synchronization script keep `🤖 codex: ok` / `🤖 codex: needs work` labels faithful to current-head CI state and Codex review evidence, keep `needs rebase` faithful to confirmed merge-conflict state, and use token sourcing that stays within GitHub API quotas and degrades safely when privileged credentials are unavailable. | ||
| ## Requirements | ||
| ### Requirement: Needs-rebase label sync | ||
|
|
||
| The Codex label synchronization script MUST add `needs rebase` when GitHub | ||
| reports a confirmed merge conflict, MUST remove it when GitHub reports a known | ||
| non-conflict state, and MUST preserve its current value when merge state is | ||
| ambiguous. It MUST NOT infer a conflict from the pull request merely being | ||
| behind the base branch. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This commit changes scheduled GitHub label-sync behavior and updates the main spec directly, but it does not add or update a matching Useful? React with 👍 / 👎. |
||
|
|
||
| #### Scenario: Confirmed conflict gains the label | ||
|
|
||
| - **WHEN** GitHub reports the pull request as `CONFLICTING` or `DIRTY` | ||
| - **THEN** the synchronizer adds `needs rebase` | ||
|
|
||
| #### Scenario: Review-blocked pull request loses a stale label | ||
|
|
||
| - **GIVEN** a pull request has `needs rebase` | ||
| - **WHEN** GitHub reports it as `BLOCKED` by review or status requirements | ||
| - **THEN** the synchronizer removes `needs rebase` | ||
|
|
||
| #### Scenario: Base lag alone does not create the label | ||
|
|
||
| - **WHEN** GitHub reports a pull request as `BEHIND` without a confirmed conflict | ||
| - **THEN** the synchronizer preserves the current label state | ||
| - **AND** it does not add `needs rebase` to an unlabelled pull request | ||
|
|
||
| ### Requirement: Codex review label sync write-token fallback | ||
|
|
||
| The `Codex review labels` workflow MUST execute the label synchronization script from the trusted default branch and MUST prefer a dedicated GitHub App installation token, then a repository-provided write token, before falling back to the default `github.token`. | ||
|
|
@@ -297,4 +322,3 @@ labels, so the override MUST NOT apply there: a change that would leave | |
| - **WHEN** a budget is exceeded | ||
| - **THEN** no pull-request label set is resolved and the check fails | ||
| regardless of any label on the originating pull request | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a PR keeps a stale
needs rebaselabel and GitHub reportsUNSTABLEorHAS_HOOKS, this table makesneeds_rebase_label_target()preserve the label even though GitHub documents those merge-state values as mergeable/non-conflict states, and the owning spec requires removing the label for known non-conflicts; the scheduled sync can therefore continue advertising a false rebase blocker until the PR reachesCLEAN. Include those mergeable statuses here or derive removal from themergeablefield instead. GitHub docsUseful? React with 👍 / 👎.