Skip to content

perf(roadmap): intake places a new item in five calls #4452

Closed

Description

@dan-petty

Problem or Motivation

When devops roadmap intake --confirm files a new candidate, it makes 13 GitHub calls, one after the other. In two profiled runs (#4404), these calls took 30.5 s and 30.1 s. Each call took 0.9 s to 3.3 s.

_apply_placement in src/devops_cli/roadmap/intake/intake.py makes these writes:

  1. create_issue, with the source/agent label only.
  2. add_sub_issue, when the candidate has a parent.
  3. label_issue for each label, for example the type and the scope: 2 calls.
  4. set_field for Status, Value and Effort. Each set_field of GitHubRoadmapStore reads the issue and then sends one PATCH: 6 calls.
  5. comment, the reason comment.
  6. set_field for Priority: 2 calls.

The issue is new, so no other writer can change it between these calls. The reads of set_field and the separate label calls give no protection for a new issue.

Proposed Solution & Architectural Design

Write a new candidate in as few calls as GitHub permits:

  1. create_issue sends all labels (source, type, scope, Status, Value and Effort) and the body with its job record block, in one POST.
  2. add_sub_issue and the reason comment stay as they are.
  3. One set_field for Priority stays last, so a run that stops before the end leaves an issue that the next intake round decides again.

For an issue that already exists, the plan checks if Status, Value and Effort can go in one PATCH after one read.

Target: the whole intake call takes 1 minute or less (#4404). This item cuts the write phase of a new candidate to 5 calls and 10 s or less.

Target Subsystem

roadmap

Existing Tool Considered

The REST call that opens an issue already takes labels, and create_issue_args already passes them. with_record already writes the job record block into a body. This change adds no library. Cost: about 25,000 tokens to build, about 2,000 tokens a year to keep, and about 2 hours of elapsed time.

Source: #4404

Proposed design

Problem statement

Intake writes a new candidate with 13 GitHub calls in a row. Two profiled runs took about 30 s each. Each call took 0.9 s to 3.3 s. The reads of set_field and the separate label calls give no protection for a new issue. The change files a new candidate with 5 GitHub calls and sets Priority last.

Acceptance criteria

Requirement: One request files a new candidate

Intake SHALL file a new candidate with its source, type, scope, Status, Value and Effort labels in one create_issue request.

Scenario: Filed labels of a new candidate

  • WHEN intake confirms a new candidate that has a parent and sets Status, Value and Effort
  • THEN the store records one create_issue call whose labels hold the source, type, scope, Status, Value and Effort labels

Requirement: No separate label or field write

Intake MUST make no label_issue call and no set_field call for Status, Value or Effort of a new candidate.

Scenario: Writes of a new candidate

  • WHEN intake confirms a new candidate that has a parent and sets Status, Value and Effort
  • THEN the store records one create_issue, one add_sub_issue, one comment and one set_field for Priority, and no other write

Requirement: Job record of the filed fields

The body of a new candidate MUST hold the job record with the Status, Value and Effort that intake sets.

Scenario: Record of a filed candidate

  • WHEN intake files a new candidate with Status, Value and Effort
  • THEN the body passed to create_issue holds a job record with the three values

Requirement: Priority last

Intake MUST set Priority with one set_field after the create request, the sub-issue link and the comment.

Scenario: Order of the writes

  • WHEN intake confirms a new candidate that has a parent
  • THEN the Priority set_field is the last write that the store records

Requirement: Fields of an existing issue in one PATCH

The store SHALL write Status, Value and Effort of an existing issue with one read and one PATCH.

Scenario: Writes of an existing candidate

  • WHEN intake places an existing candidate that sets Status, Value and Effort
  • THEN the store records one read of the issue and one PATCH that carries the three labels and the job record

Requirement: A person's label stays

The batched field write MUST refuse the write when a person changed one of the three labels since the plan.

Scenario: A person changed a field

  • WHEN a person changes the Value label of the issue after the plan and before the batched write
  • THEN the store raises RoadmapItemChangedError and writes no field

Requirement: Dry run shows one create request

The dry-run write plan MUST list one create request that carries every label of a new candidate.

Scenario: Dry-run writes of a new candidate

  • WHEN a person runs devops roadmap intake --dry-run for a new candidate
  • THEN the write plan holds one create request with every label, then the sub-issue link, the comment and the Priority write

Existing Tool Considered

No alternatives check has run. No open, maintained tool or library covers this need. The change uses the GitHub REST calls that the store already makes, and it adds no library. The written cost is about 25,000 tokens to build, about 2,000 tokens a year to keep, and about 2 hours of elapsed time.

Key questions

  • Which labels must the one create_issue request of a new candidate carry?: The source label when an agent files it, the type and scope labels the title gives, and the Status, Value and Effort labels the decision sets. Priority stays out of the request, so its write stays last. [sources: src/devops_cli/roadmap/intake/intake.py, src/devops_cli/roadmap/stores/store.py]
  • How many GitHub calls does the write phase of a new candidate make after the change?: Five: one create POST, one sub-issue POST, one comment POST, and the Priority set_field, which reads the issue and sends one PATCH. [sources: src/devops_cli/roadmap/intake/intake.py, src/devops_cli/roadmap/stores/github_store.py]
  • Where does the job record of the filed Status, Value and Effort come from?: Intake builds the body with the existing with_record helper, with the Status, Value and Effort values, and passes it to create_issue. (best practice) [sources: src/devops_cli/roadmap/stores/github_store.py, tests/roadmap/stores/test_roadmap_github_store_record_writes.py]
    • Chosen: Build the body with the existing record helper. with_record already writes the job record block, and one helper keeps one format for every write.
    • Rejected: Add a field list to the create_issue signature. It puts the record format in a second place and changes the signature of every store.
  • Can Status, Value and Effort of an existing issue go in one PATCH after one read?: Yes. The store writes the three fields with one read and one PATCH. It refuses the write when a person changed one of the three labels since the plan. (best practice) [sources: docs/adr/0002-roadmap-jobs-act-as-a-machine-account.md, src/devops_cli/roadmap/stores/github_store.py]
    • Chosen: One read and one PATCH for the three fields. The issue PATCH takes labels and body in one request, and one read keeps the person-change guard. Six calls become two.
    • Rejected: One set_field for each field. Each set_field reads and then PATCHes, so three fields take six calls.
    • Rejected: One PATCH with no read. ADR 0002 requires a comparison with the value the job last set before it overwrites a field.
  • How does the store offer the batched field write?: Add set_fields(item, fields) to RoadmapStore, to GitHubRoadmapStore and to the store fake. Run the store contract suite over it. (best practice) [sources: src/devops_cli/roadmap/stores/store.py, tests/support/fakes/roadmap_store.py, tests/roadmap/stores/test_roadmap_store_contract.py]
    • Chosen: A new set_fields(item, fields) method. It keeps set_field for the Priority write with its marks, and it names the batch at the call site.
    • Rejected: A list argument on set_field. It changes a signature that every caller and the fake use, and it mixes one field with many.
    • Rejected: No batched write. An existing candidate keeps six calls for the three fields.
  • What does the dry-run write plan show for a new candidate?: One create request that carries every label, then the sub-issue link, the reason comment and the Priority write. It shows no separate label or field write. [sources: src/devops_cli/roadmap/intake/intake_requests.py, tests/roadmap/intake/test_roadmap_intake_dry_run.py]
  • Which test shows that a new candidate makes five write calls?: A test over the store fake counts the calls of one new candidate: one create_issue, one add_sub_issue, one comment and one set_field. [sources: tests/roadmap/intake/test_roadmap_intake_github_requests.py, tests/support/fakes/roadmap_store.py]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

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

Activity

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

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/infra. The perf prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P2-Medium. Intake works but is slow; the fix cuts time but does not block a release.
    • Value: Medium. Faster intake saves agent and user time on every new candidate.
    • Effort: Low. One function changes to send labels and fields in fewer calls.
    • Related: feat(github): single-entry item intake with duplicate detection and placement (devops roadmap intake) #742, which asks for a different change. Both work on the intake write phase, but #742 builds the command and this item cuts its API calls.
  4. added
    priority/p2-medium
    on Nov 11, 2026
  5. added
    status/ready
    and removed
    status/new
    on Nov 11, 2026
  6. devops-cli-service commented on Nov 11, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at c653bde (see proposed design in issue body).

  7. devops-cli-service commented on Nov 11, 2026

    @devops-cli-service
    Contributor

    Alternatives check: not-applicable

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

    Tool: none found

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

  8. added
    status/in-progress
    and removed
    status/ready
    on Nov 15, 2026
  9. added
    status/in-review
    and removed
    status/in-progress
    on Nov 15, 2026
  10. removed
    status/in-review
    on Nov 15, 2026
  11. 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/lowpriority/p2-mediumscope/roadmapsource/agenttype/infravalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions