Repository navigation
Description
Problem or Motivation
D4 of the approved pipeline split design (owner approval 2026-11-13, tracker #5482) adds no new label and removes the labels that nothing writes. The repository holds these labels, and no code, workflow or issue form writes them: review/ai-reviewed, review/approved, review/changes-requested, documentation, duplicate, good first issue, help wanted, invalid, question and wontfix. .github/labels.yml does not hold them, and the label sync never deletes a label.
The issue forms write bug, enhancement and triage (.github/ISSUE_TEMPLATE/bug_report.yml and feature_request.yml), so these labels stay.
Proposed Solution & Architectural Design
- Add a
removedlist to.github/labels.ymlwith the 10 labels above. - The label sync (
sync_labelsinsrc/devops_cli/commands/gh.py) deletes each label of theremovedlist that the repository holds.--dry-runprints the deletes and makes no request. - A test fails when a label of the
removedlist is also a desired label, or when an issue form writes it. - Run the sync from a worktree at
origin/mainafter the merge.
Target Subsystem
GitHub labels (.github/labels.yml, src/devops_cli/github/labels.py, src/devops_cli/commands/gh.py).
Acceptance Criteria
- Test first: with a fake GitHub that holds
wontfix, the sync deletes it, and keepsbug. The test fails on the base. - A test: a label in the
removedlist and in an issue form fails the check. - A test:
--dry-runsends 0 requests. - Live proof: after the merge, the sync runs against devops-cli. A comment on this issue gives the deleted labels and the label count before and after.
Existing Tool Considered
The label sync of devops and the GitHub labels REST API cover the need. Build: 50,000 to 100,000 agent tokens and 0.25 day.
Related
Tracker #5482, Phase 2. #5235 (the roadmap-state record states the D4 rule).
Source: #5482
Alternatives check of 2026-11-17: not-applicable.
Class: chore, no search.
Tool: none found.
Proposed design
Problem statement
The repository holds ten labels that no code, workflow or issue form writes. The label sync adds and updates labels but never deletes one. The change adds a removed list to the label specification, deletes each removed label that the repository holds, and refuses a removed label that is still desired or written by an issue form.
Acceptance criteria
Requirement: Removed labels in the label file
The label specification SHALL hold a removed list with the ten labels that nothing writes.
Scenario: Dry-run lists the removed labels
- WHEN
uv run devops gh label sync --dry-runruns in the repository - THEN the plan lists
review/ai-reviewed,review/approved,review/changes-requested,documentation,duplicate,good first issue,help wanted,invalid,questionandwontfix.
Requirement: Delete test fails on the base
The delete test MUST fail on the base commit.
Scenario: The test fails before the sync change
- WHEN the delete test runs on the base commit
- THEN the test fails because the sync sends no delete request for
wontfix.
Requirement: Delete a held removed label
The label sync SHALL delete each removed label that the repository holds.
Scenario: The sync deletes wontfix and keeps bug
- WHEN a fake GitHub holds
wontfixandbug, the removed list holdswontfix, and the desired labels holdbug - THEN the sync sends one delete request for
wontfixand sends no delete request forbug.
Requirement: Refuse a removed label that is desired
The label sync MUST refuse a removed label that the desired labels also hold.
Scenario: A desired and removed conflict stops the sync
- WHEN a fixture holds
wontfixin both the desired list and the removed list - THEN the sync raises
ValidationErrorand sends no request.
Requirement: Refuse a removed label in an issue form
The label sync MUST refuse a removed label that an issue form writes.
Scenario: An issue form conflict stops the sync
- WHEN a fixture issue form writes
wontfixand the removed list holdswontfix - THEN the sync raises
ValidationErrorand sends no request.
Requirement: Dry-run sends no request
The label sync with --dry-run MUST send no request.
Scenario: A dry-run records zero requests
- WHEN a test calls
sync_labelswith--dry-runand a fake client - THEN the fake client records zero requests and the output lists the removed labels.
Requirement: Live deletion proof
The merged sync SHALL delete the ten labels from devops-cli and report the counts.
Scenario: Run the sync after merge
- WHEN
uv run devops gh label sync --repo dan-petty/devops-cliruns after the merge - THEN the command deletes the ten labels, prints the label count before and after, and a comment on the issue records the deleted labels and the counts.
Existing Tool Considered
The alternatives check of 2026-11-17 recorded not-applicable for this chore and found no tool. The change uses the existing devops gh label sync command and the GitHub labels REST API; the issue estimates 50,000 to 100,000 agent tokens and 0.25 day to build.
Key questions
- How does
.github/labels.ymlhold the removed labels and keep the desired labels?: Change.github/labels.ymlto a mapping withlabels:andremoved:. Updateload_label_specsto return both lists.sync_labelspasses the removed list to the sync. (best practice) [sources: .github/labels.yml, src/devops_cli/commands/gh.py, src/devops_cli/github/labels.py]- Chosen: Mapping with
labelsandremovedin.github/labels.yml. The issue asks for one label file. The loader changes in one module. The file stays the single source of the labels. - Rejected: Separate
.github/labels-removed.ymlfile. It splits the label specification into two files and does not follow the issue text.
- Chosen: Mapping with
- What does
--dry-runprint when it makes no request?: It prints a planned delete for each label in theremovedlist. The live run deletes only the labels that the repository holds. The dry-run sends no request. (best practice) [sources: src/devops_cli/commands/gh.py, src/devops_cli/github/labels.py]- Chosen: Print all removed labels as planned deletes. The dry-run makes no request, so it cannot read the remote labels. The plan shows the full removal set.
- Rejected: Read the remote labels in the dry-run. It breaks the zero-request rule of the issue.
- Where does the sync refuse a removed label that is desired or written by an issue form?: Add a pure function
validate_removed_labels(removed, desired, issue_form_labels)insrc/devops_cli/github/labels.py.sync_labelscalls it before any request. The function raisesValidationErroron a conflict. A unit test passes fixture lists. (best practice) [sources: src/devops_cli/github/labels.py, src/devops_cli/commands/gh.py, .github/ISSUE_TEMPLATE/bug_report.yml, .github/ISSUE_TEMPLATE/feature_request.yml]- Chosen: Validate in the sync before any request. A conflict stops the run before a delete. One function serves the command and the test.
- Rejected: Validate only in a test. A future issue form could add a removed label and the sync would delete it.
- How does the sync delete a label?: Extend
sync_repository_labelsto delete each removed label by name through the GitHub client that the module already uses. The sync sends one delete request for each held removed label. (best practice) [sources: src/devops_cli/github/labels.py, src/devops_cli/commands/gh.py]- Chosen: Use the existing GitHub client in
src/devops_cli/github/labels.py. The label sync already uses this client, so the delete path needs no new transport. - Rejected: Call
gh label deletewithrun_ghdirectly. It adds a second request path and skips the client.
- Chosen: Use the existing GitHub client in
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 13, 2026
It is a cleanup task with no user-facing impact and no blocking dependency.Both touch .github/labels.yml, but 3753 writes the file from the onboard command while the candidate adds a removed list and a delete step to the sync.devops-cli-service commentedon Nov 17, 2026
Alternatives check: not-applicable
Class: chore. The check makes no search and no model call for an item of this class.
Tool: none found
Checked on 2026-11-17. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 20, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.
chore(github): delete the labels that nothing writes (#5503)
chore(main): release 0.235.0 (#7597)
devops-cli-service commentedon Nov 28, 2026
Released in v0.235.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.235.0
devops-cli-service commentedon Nov 28, 2026
Live since 2026-11-28 17:56 UTC