fix(ci): make issue triage labeling deterministic - #1206
Conversation
Signed-off-by: phernandez <paul@basicmachines.co>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 31ca315e07
ℹ️ 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".
Signed-off-by: phernandez <paul@basicmachines.co>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 76f0f02db2
ℹ️ 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".
Signed-off-by: phernandez <paul@basicmachines.co>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ee06e942f7
ℹ️ 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".
Signed-off-by: phernandez <paul@basicmachines.co>
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Signed-off-by: phernandez <paul@basicmachines.co>
Signed-off-by: phernandez <paul@basicmachines.co>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6e95cce6ee
ℹ️ 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".
Signed-off-by: phernandez <paul@basicmachines.co>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a081c1d163
ℹ️ 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".
Signed-off-by: phernandez <paul@basicmachines.co>
Why
The Claude issue-triage workflow advertises priority, component, complexity, and status labels that do not exist in this repository. Its only label tool accepted arbitrary candidate labels, silently ignored unknown names, and immediately added every candidate that happened to exist. Because the tool was add-only, label discovery mutated the live issue and Claude could not undo mistakes.
This has recurred since the helper was introduced on July 16: at least 12 triage comments explicitly report accidental label application. On issue #1205, an enhancement tracker ended up labeled as a bug, documentation request, duplicate, good first issue, question, and Cloud issue as well.
What Changed
--add-labelinterface with one semantic classification:--type bug|enhancement|documentation|question --component cloud|none.Implementation Details
The helper first verifies that current labels are readable before any mutation. It then uses GitHub's additive labels endpoint to apply the requested type and optional Cloud component. After that POST succeeds, it reads the labels again and deletes obsolete values from the automated triage ownership set (
bug,enhancement,documentation,question, andcloud). The second read includes a competing owned label added during the initial read/POST window, while targeted DELETE requests leave template, maintainer, and unrelated automation labels untouched.The workflow uses
claude-issue-triage-${{ github.event.issue.number }}as its concurrency group withcancel-in-progress: false. Runs for different issues remain independent, while attempts for the same issue are serialized so one complete classification wins instead of two DELETE loops removing each other's desired labels.Repeated valid calls converge on one type and one Cloud/non-Cloud component choice. Unsupported attempts and failed preflight reads stop before the first write. A failed additive request leaves the prior classification intact. A failed post-add reconciliation read leaves the desired label added but performs no destructive calls, allowing a later rerun to converge safely. Duplicate detection remains read-only; Claude links the original issue in prose rather than labeling or closing the new issue.
The tests invoke
scripts/edit-issue-labels.shwith ordinarybashon POSIX. On Windows they derivebash.exefrom the installed Git executable, because the unqualified Windowsbashcommand launches WSL rather than Git Bash. Temporary shell fixtures use LF line endings and POSIX-form paths so Git Bash parses them consistently.Testing
Automated
uv run pytest -p pytest_mock --no-cov -q tests/test_claude_issue_triage.py: 13 passedjust fast-check: Ruff checks and formatting passed; ty passedbash -n scripts/edit-issue-labels.sh: passeduv run ruff check tests/test_claude_issue_triage.py: passeduv run ruff format --check tests/test_claude_issue_triage.py: passedgit diff --check: passedThe focused suite parses the edited workflow as YAML and asserts the single semantic helper contract, per-issue non-cancelling concurrency, the four-type/MCP-component taxonomy, exact additive POST/targeted DELETE ordering, preservation of non-triage labels, no mutation after a failed preflight read, no deletion after a failed additive or reconciliation read, and reconciliation of bot-owned labels added during the initial mutation window.
Manual
WinError 193.bashselected the WSL launcher rather than Git Bash.Risks / Follow-ups