Repository navigation
Description
Problem
Checked at main (0d90de5).
devops pr create --repo OWNER/NAME --head BRANCH checks the title scope against .github/labels.yml at the base branch only. src/devops_cli/commands/pr.py:1248 passes checkout=_checkout() if repo is None else None, so with --repo the pull request's own labels.yml is never read. The refusal text (form_title_scope in src/devops_cli/lang/en/messages.py:1660) still says "declare the label in the same pull request", which cannot work in that mode.
Seen on 2026-11-19 in dan-petty/vibes: a builder added scope/tools to .github/labels.yml on its branch and devops pr create -R dan-petty/vibes -H fix/177-slo-burn-rate still refused the scope. It worked only when run without -R from the worktree.
Proposed remedy
- With
--head, readlabels.ymlat the head ref as well as the base (the same store call withref=head), and accept a label declared in either. - If that is not wanted, make the message say that with
--repothe label must already be on the base branch.
Acceptance criteria
- A test:
--repoplus--head, with the scope label declared only on the head ref, opens the pull request. - A test: the refusal message matches the mode it runs in.
Alternatives check of 2026-11-20: none.
Tool: none found.
Reason: Searches returned only PR-creation actions and general docs, no tool that reads a repository's labels.yml at a git ref to validate a pull-request title scope. The need is devops-cli's own form rule, which it must fix in place.
Lacks:
- No tool reads labels.yml at a chosen git ref
- No tool validates title scopes inside a CLI's own create path
- No tool emits a mode-specific refusal message
Proposed design
Problem statement
The devops pr create --repo OWNER/NAME --head BRANCH command checks the title scope against .github/labels.yml at the base branch only. It never reads the labels.yml of the head branch. A builder that declares the scope label on its branch is refused. The refusal also tells the user to declare the label in the same pull request, and the --repo mode cannot read that declaration.
Acceptance criteria
Requirement: The scope check reads the head ref
The title scope check MUST accept a scope label that .github/labels.yml declares at the head ref when the caller sets --repo and --head.
Scenario: A label declared only on the head ref
- WHEN A test calls the title scope check with
--repoand--head, the base ref declares noscope/toolslabel, and the head ref declares it - THEN The check returns no error.
Requirement: The scope check keeps the base ref
The title scope check MUST accept a scope label that .github/labels.yml declares at the base ref when the caller sets --repo and --head.
Scenario: A label declared only on the base ref
- WHEN A test calls the title scope check with
--repoand--head, the base ref declaresscope/tools, and the head ref declares noscope/toolslabel - THEN The check returns no error.
Requirement: The refusal message names the refs read
The refusal message MUST name the refs whose .github/labels.yml the check read.
Scenario: Neither ref declares the label
- WHEN A test calls the title scope check with
--repoand--head, and neither the base ref nor the head ref declaresscope/tools - THEN The message names the base ref and the head ref, and it tells the user to declare the label in the same pull request.
Requirement: The check-out mode keeps its message
The title scope check MUST read the check-out only and keep its message when the caller sets no --repo.
Scenario: The check-out mode refuses a scope
- WHEN A test calls the title scope check with no
--repo, and the.github/labels.ymlof the check-out declares noscope/toolslabel - THEN The check returns the refusal, and the message tells the user to declare the label in the same pull request.
Requirement: The check reads the base ref with no head ref
The title scope check MUST read the base ref only when the caller sets --repo and no --head.
Scenario: No head ref is set
- WHEN A test calls the title scope check with
--repoand no--head, and the base ref declares noscope/toolslabel - THEN The check returns the refusal, and the message names the base ref only.
Existing Tool Considered
The alternatives check of 2026-11-20 in the issue body records verdict none and no tool. It lists that no tool reads labels.yml at a chosen git ref, validates title scopes inside a CLI's own create path, or emits a mode-specific refusal message. The change does what the block says no tool covers: it reuses the existing declared_label_set call with ref=head and passes the union of the base and head labels to title_problems. It adds no dependency. The written cost is about 10 lines of code and one test, about 4,000 tokens to build, about 500 tokens a month to keep, about 2,000 tokens for one fix, and under one hour of elapsed time.
Key questions
- Should the title scope check read
.github/labels.ymlat the head ref when--repoand--headare set?: Yes. The check reads the base ref and the head ref, and it accepts a label that either ref declares. (best practice) [sources: src/devops_cli/commands/pr.py, src/devops_cli/roadmap/pull_form.py:222, openspec/specs/pull-request-form/spec.md]- Chosen: Read the base ref and the head ref. It accepts the label that the builder declared on its branch and keeps the label that the base ref declares.
- Rejected: Read the base ref only and reword the message. It refuses a correct pull request and leaves the reported defect.
- Rejected: Read the head ref only. It refuses a label that the base ref declares and that a pull request into that base ref needs.
- How does the check read
labels.ymlat the head ref?: The check passesheadto the samedeclared_label_setcall that readslabels.yml. It then passes the union of the base and head label sets totitle_problems. (best practice) [sources: src/devops_cli/roadmap/pull_describe.py:108, src/devops_cli/commands/pr.py]- Chosen: Reuse
declared_label_setwithref=head. It already reads the file at a ref and returns the declared labels. - Rejected: Add a YAML reader in the check. It adds code and a dependency for no gain.
- Chosen: Reuse
- Which text does the refusal message show in each mode?: One message takes the refs that the check read. In
--repoand--headmode it names the base ref and the head ref. In the check-out mode it keeps the instruction to declare the label in the same pull request. (best practice) [sources: src/devops_cli/lang/en/messages.py:1659, src/devops_cli/roadmap/pull_form.py:222]- Chosen: One message with the refs read as a parameter. One text holds each mode, and a test asserts the text of each mode.
- Rejected: Two separate message fields. It duplicates the text, and the two copies can drift.
- What does the check do when
--repois set and--headis not?: The check reads the base ref only. The refusal message names the base ref only. (best practice) [sources: src/devops_cli/commands/pr.py]- Chosen: Read the base ref only. No head ref exists to read.
- Rejected: Require
--headwith--repo. It changes the command contract beyond this defect.
- Does the change add a dependency or a new tool?: No. The change reuses
declared_label_setand adds no dependency. [sources: src/devops_cli/roadmap/pull_describe.py:108, src/devops_cli/commands/pr.py]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 19, 2026
Both use the labels.yml lookup in pr create, but #2748 adds the auto-label mechanism while the candidate fixes a bug where --repo mode skips the head ref read.devops-cli-service commentedon Nov 19, 2026
Next step: the alternatives check records a verdict. See the section Proposed design of the body.
devops-cli-service commentedon Nov 20, 2026
The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.
Searches (3)
Searches run:
Sources:
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.
dan-petty commentedon Nov 21, 2026
Seen again on 2026-11-21 with dan-petty/danielpetty.com#16. The pull request adds
scope/harvesterto.github/labels.ymlon its head branch.devops pr create --repo dan-petty/danielpetty.com --head fix/4-harvest-push-and-prrefused the title with "The scopeharvesterhas no label". The cause issrc/devops_cli/commands/pr.py:1248: with--reposet,declared_label_setgetscheckout=Noneand reads only the base ref. The same command without--repo, run in the checkout of the head branch, opened the pull request.dan-petty commentedon Nov 21, 2026
More evidence, 2026-11-21, in the service repository
dan-petty/danielpetty.com, where.github/labels.ymldeclared noscope/labels.--repo dan-petty/danielpetty.com,devops pr createrefused the scoped titlesfix(security),fix(harvester),fix(event-stream),fix(pixelfed)andchore(ci). The error told the builder to declare the label in the same pull request. The branch declared the label, butsrc/devops_cli/commands/pr.py:1248-1249passescheckout=Nonewhen--repois set, sodeclared_label_setreads only the base branch.--repo. 5 other pull requests dropped the scope from the title.labels.yml. They conflict with each other when they merge.dan-petty commentedon Nov 21, 2026
One more case, 2026-11-21: a new repository whose default branch has no
.github/labels.ymlat all. The first pull request ofdan-petty/infraadds that file (it onboards the repository to the roadmap jobs).devops pr createrefuses it with "dan-petty/infra has no .github/labels.yml at main", with--repoand also when it runs from the worktree of the branch with no--repo. So the tool cannot open the pull request thatdevops roadmap onboardasks for (row 3). I opened that draft throughdevops gh api repos/dan-petty/infra/pulls -X POST ... -F draft=true. A fix for this item could read the labels of the head branch, and treat a missing file on the base branch as an empty list.chore(main): release 0.219.0 (#7177)
devops-cli-service commentedon Nov 25, 2026
Released in v0.219.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.219.0
devops-cli-service commentedon Nov 25, 2026
Live since 2026-11-25 17:09 UTC