Skip to content

refactor(roadmap): one open step for every pull request #5020

Description

@dan-petty

Problem or Motivation

Three paths open a draft pull request: stage.py:2438 (_open_pull), implement_run.py:1398 and :1479 (_publish, _pull_request), and src/devops_cli/commands/pr.py:1246 with a REST fallback (:1007). Three sites add labels (stage.py:2570, :2583 and the implement Job). The Status is set in two ways, and stage sets none. A crash between the push and the open leaves a branch with no pull request, which stage.py:1973 cleans later. #3599 (retry a refused text) and #4127 (sync the title and type) each fix one copy.

Proposed Solution & Architectural Design

steps/open.py open_or_update(request) returns the number and created, updated or unchanged. First it looks up the open pull request of the head and the base (the logic of pr.py:937). It takes the title and body from the pull_form rules, adds the title labels as a set, sets In Progress for a delivery through the Status writer, records .pr and upserts one marked comment. When GitHub refuses the text, it tries one more time with the form-checked text (#3599). When the pull request exists, it changes only the fields that differ (#4127).

CLI devops roadmap step open. Stage, the implement Job and devops pr create call it in the same pull request. #3599 and #4127 fold here; #4045 and the metadata part of #3991 then change only steps/open.py. #4713 then moves only the call site of the implement Job to its end.

Open tool: the GitHub pulls API with head and base filters (gidgethub).

Timeouts: request 30 s with one retry < step 120 s.

Cost: about 1.2M tokens and 1 agent-day.

Target Subsystem

Roadmap steps (src/devops_cli/roadmap/steps/), stage, the implement runner Job and devops pr create.

Existing Tool Considered

The GitHub pulls API with head and base filters, through gidgethub.

Acceptance Criteria

  • A test with the fake GitHub: a second run makes no second pull request; a refused text is sent again one time; an update changes only the fields that differ.
  • A dry-run test sees 0 requests.
  • The devops pr create tests stay green.
  • A structural test fails when a module other than steps/open.py calls create_draft_pull.

Dependencies

Source: #5014

Owner decision 2026-11-13

The approved pipeline split (tracker #5482, Phase 1) adds to this scope:

  • steps/open.py is also a sweep step that recovers a PR that a killed unit did not open. Due: the branch head equals the checked_sha of its producer in the record, and no open PR exists for that head and base. At most 3 requests.

  • It refuses a second open PR for an issue.

  • It refuses a checked head whose commit message holds [skip ci].

  • The person path of devops pr create (feat(pr): pr create gates the change and pushes once #4708) uses this module when it merges first.

  • Tests for the recovery, the second-PR refusal and the marker refusal.

  • Live proof: after the merge and the release, stage and the implement Job open their PRs as the App through steps/open.py. A comment gives the result lines, and one recovery from a branch with no PR if one occurs in 7 days.

Alternatives check of 2026-11-15: not-applicable.
Class: refactor, no search.
Tool: none found.

Activity

  1. added
    source/agent
    on Nov 12, 2026
  2. added
    type/refactor
    scope/roadmap
    status/new
    value/medium
    effort/medium
    on Nov 12, 2026
  3. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor
  4. added
    priority/p2-medium
    on Nov 12, 2026
  5. added
    status/in-progress
    and removed
    status/new
    on Nov 15, 2026
  6. devops-cli-service commented on Nov 15, 2026

    @devops-cli-service
    Contributor

    Alternatives check: not-applicable

    Class: refactor. The check makes no search and no model call for an item of this class.

    Tool: none found

    Checked on 2026-11-15. A person decides what this means for the item. The check changes no label and closes no issue.

  7. added
    status/in-review
    and removed
    status/in-progress
    on Nov 15, 2026
  8. removed
    status/in-review
    on Nov 15, 2026
  9. added a commit that references this issue on Nov 15, 2026
  10. devops-cli-service commented on Nov 15, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-15 23:51 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p2-mediumscope/roadmapsource/agenttype/refactorvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions