Repository navigation
Description
Problem or Motivation
Issue #2748 gives devops pr create the labels of the title of a pull request. The stage job and the implement job open pull requests through their own client, so their pull requests still get no type/* and no scope/* label from code.
- The stage job opens its draft with
create_draft_pullinroadmap/stage.py. When GitHub refuses the pull request, it deletes the remote branch. A label that fails must not delete the branch of an open pull request. It must not leave the job marks unset. - The implement job sets a new title and body on its pull request after the stage job opened it. The labels must follow the new title, so a second write is needed there.
Proposed Solution & Architectural Design
Give both jobs the labels of the title with the pieces that #2748 added: title_labels and declared_label_names in roadmap/title_labels.py, read_title_labels and add_pull_labels in roadmap/pull_labels.py, and RoadmapStore.label_issue.
- Stage: after
_open_pull, add the labels. A failure is reported in the comment of the job on the item. It keeps the branch and the marks. - Implement: after the job sets the title, add the labels of the new title. Remove a
type/*orscope/*label that the old title gave and the new title does not give.
Existing Tool Considered
No new tool is needed. The change reuses title_labels and RoadmapStore.label_issue.
Proposed design
Problem statement
The stage job and the implement job open or update pull requests through their own GitHub client. They bypass devops pr create, so their pull requests receive no type/* or scope/* labels derived from the title. This change adds those labels to both jobs using the pieces that issue #2748 already provides.
Acceptance criteria
Requirement: Stage job adds title labels
The stage job SHALL add type/* and scope/* labels to its draft pull request after _open_pull succeeds.
Scenario: Stage job opens a draft pull request with a title that maps to labels
- WHEN The stage job calls
_open_pulland the pull request opens successfully - THEN The pull request carries the
type/*andscope/*labels derived from its title
Requirement: Stage job label failure keeps branch and marks
A label failure in the stage job SHALL NOT delete the remote branch or unset the job marks.
Scenario: Stage job label call fails after the pull request is open
- WHEN The label call on the open pull request returns an error
- THEN The remote branch still exists and the job marks remain set
Requirement: Stage job label failure reported in comment
A label failure in the stage job SHALL be reported in the job comment on the item.
Scenario: Stage job label call fails
- WHEN The label call on the open pull request returns an error
- THEN The job comment on the item records the label failure
Requirement: Implement job adds labels for new title
The implement job SHALL add type/* and scope/* labels matching the new title after it sets the title on the pull request.
Scenario: Implement job sets a new title that maps to different labels
- WHEN The implement job updates the pull request title and body
- THEN The pull request carries the
type/*andscope/*labels derived from the new title
Requirement: Implement job removes stale labels
The implement job SHALL remove any type/* or scope/* label that the old title gave and the new title does not give.
Scenario: New title maps to a different scope than the old title
- WHEN The implement job sets a new title whose scope differs from the old title
- THEN The old
scope/*label is removed and the newscope/*label is added
Existing Tool Considered
No check has run. The body states no new tool is needed. The change reuses title_labels and declared_label_names in roadmap/title_labels.py, read_title_labels and add_pull_labels in roadmap/pull_labels.py, and RoadmapStore.label_issue, all added by issue #2748.
Key questions
- How does the stage job handle a label failure after the pull request is open?: It reports the failure in the job comment on the item. It keeps the branch and the job marks. It does not delete the branch. (proposed)
- Chosen: Report in comment, keep branch and marks. The pull request is already open. Deleting the branch would lose the open pull request. The body records this decision.
- Rejected: Delete the branch on label failure. This would delete the branch of an already-open pull request. The body rejects this.
- How does the implement job manage labels when it sets a new title?: It adds the
type/*andscope/*labels of the new title. It removes anytype/*orscope/*label that the old title gave and the new title does not give. (proposed)- Chosen: Add new labels and remove stale ones. The body records this. Stale labels would misrepresent the pull request if left in place.
- Rejected: Only add new labels, leave old ones. Stale
type/*orscope/*labels would remain and misrepresent the pull request.
- Which existing code pieces does the change reuse?:
title_labelsanddeclared_label_namesinroadmap/title_labels.py,read_title_labelsandadd_pull_labelsinroadmap/pull_labels.py, andRoadmapStore.label_issue. All are added by issue fix(pr): devops pr create labels the pull request from its title #2748. [sources: src/devops_cli/roadmap/stage.py:799] - Where does the stage job call
_open_pull?: The stage job calls_open_pullat line 848 ofsrc/devops_cli/roadmap/stage.py. The label call goes after that call. [sources: src/devops_cli/roadmap/stage.py:848]
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Oct 30, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
featprefix of the title gives the type.(roadmap)scope of the title gives the scope.It closes a labeling gap left by #2748 but does not block a release or break existing behaviour.It completes automated labeling for roadmap-job PRs, reducing manual label work for maintainers.It reuses existing helpers from #2748 but requires changes in two jobs with distinct failure-handling rules.Both apply 'type/*' and 'scope/*' labels from the PR title, but #2748 targets 'devops pr create' and the candidate targets the stage and implement jobs.fix(pr): pr create adds the labels of the title (#2782)
devops-cli-service commentedon Oct 30, 2026
Status set to Ready at d264e6e (see proposed design in issue body).
devops-cli-service commentedon Nov 2, 2026
Staged: branch
feat/2777-the-stage-and-implement-jobs-label, draft pull request #3169. The pull request plans the item and closes no issue.The task groups, with the tokens of the inputs of each step, for a budget of 40000 tokens:
The plan run made 17 model request(s), and used 437959 input tokens and 8308 output tokens. The tool calls, in order:
list_files({"directory":"src/devops_cli/roadmap"})read_file({"path":"src/devops_cli/roadmap/pull_labels.py"})read_file({"path":"src/devops_cli/roadmap/stage.py","start_line":1000,"end_line":1200})read_file({"path":"src/devops_cli/roadmap/implement_pull.py"})search_code({"text":"set_pull_title"})search_code({"text":"label_issue"})search_code({"text":"edit_pull"})search_code({"text":"update_pull"})read_file({"path":"src/devops_cli/roadmap/implement_run.py","start_line":520,"end_line":640})read_file({"path":"src/devops_cli/roadmap/title_labels.py"})read_file({"path":"src/devops_cli/roadmap/implement_run.py","start_line":580,"end_line":620})search_code({"text":"remove_pull_label"})read_file({"path":"src/devops_cli/roadmap/github_store.py","start_line":720,"end_line":820})search_code({"text":"unlabel"})read_file({"path":"src/devops_cli/roadmap/store.py","start_line":790,"end_line":850})read_file({"path":"src/devops_cli/roadmap/memory_store.py","start_line":350,"end_line":400})list_files({"directory":"src/devops_cli/roadmap"})list_files({"directory":"tests/roadmap"})search_code({"text":"update_pull"})read_file({"path":"src/devops_cli/roadmap/pull_labels.py"})search_code({"text":"label_issue"})read_file({"path":"src/devops_cli/roadmap/implement_run.py","start_line":550,"end_line":620})search_code({"text":"_pull_request"})search_code({"text":"delivery_title"})file_symbols({"path":"tests/roadmap/test_roadmap_implement_job.py"})search_code({"text":"_pull_request("})search_code({"text":"unlabel"})read_file({"path":"src/devops_cli/roadmap/store.py","start_line":800,"end_line":850})read_file({"path":"src/devops_cli/roadmap/stage.py","start_line":1030,"end_line":1175})docs(openspec): fix the plan for #2777
docs(openspec): plan #2777 Label the stage and implement pull requests (
feat(roadmap): the stage and implement jobs label their pull request …
feat(roadmap): the stage and implement jobs label their pull request …
devops-cli-service commentedon Nov 3, 2026
Released in v0.49.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.49.0
devops-cli-service commentedon Nov 3, 2026
Live since 2026-11-03 13:34 UTC