Skip to content

ci: keep needs rebase labels current - #1460

Merged
Soju06 merged 3 commits into
mainfrom
fix/auto-needs-rebase-label-20260723
Jul 24, 2026
Merged

ci: keep needs rebase labels current#1460
Soju06 merged 3 commits into
mainfrom
fix/auto-needs-rebase-label-20260723

Conversation

@Komzpa

@Komzpa Komzpa commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • sync the existing needs rebase label in the scheduled Codex label workflow
  • add it for confirmed DIRTY or CONFLICTING merge states
  • remove it for every known mergeable or non-conflict state, including
    BEHIND, BLOCKED, HAS_HOOKS, and UNSTABLE
  • preserve the current value only while GitHub reports UNKNOWN
  • add the required OpenSpec change and cover label decisions plus exact GitHub
    API writes

Why

The label was maintained manually, so it could remain stale after a conflict
was resolved. Base-branch lag alone is not proof that a pull request needs
conflict repair, while BLOCKED commonly represents review or status policy.
The existing 15-minute synchronizer already owns recurring label freshness, so
the rebase label now follows the same path.

Validation

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 440f9af56f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/scripts/sync_codex_ok_labels.py Outdated
PENDING_CHECK_STATES = {"EXPECTED", "IN_PROGRESS", "PENDING", "QUEUED", "REQUESTED", "WAITING"}
UNMERGEABLE_STATES = {"DIRTY", "BLOCKED"}
NEEDS_REBASE_STATES = {"CONFLICTING", "DIRTY"}
NO_REBASE_STATES = {"BLOCKED", "CLEAN"}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Remove stale rebase labels for mergeable statuses

When a PR keeps a stale needs rebase label and GitHub reports UNSTABLE or HAS_HOOKS, this table makes needs_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 reaches CLEAN. Include those mergeable statuses here or derive removal from the mergeable field instead. GitHub docs

Useful? React with 👍 / 👎.

Comment on lines +8 to +12
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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add the required OpenSpec change artifact

This commit changes scheduled GitHub label-sync behavior and updates the main spec directly, but it does not add or update a matching openspec/changes/<slug>/ proposal/tasks/spec delta for the behavior change; this repo treats OpenSpec changes as a hard readiness gate for behavior and operator-contract changes, so the PR would be blocked even though code and tests were added. Add the change artifact for the needs-rebase sync behavior before marking this ready.

Useful? React with 👍 / 👎.

@Soju06
Soju06 merged commit 6d0bbdb into main Jul 24, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants