Repository navigation
Description
Problem Description
devops pr create must set In Progress on the issue that the new pull request closes (_finish_created_pr in src/devops_cli/commands/pr.py, set_delivered_status in src/devops_cli/roadmap/pull_status.py). The step reads closingIssuesReferences of the pull request immediately after it opens. GitHub links the closing issue asynchronously, so the read can give no issue. Then set_delivered_status returns None, the command prints nothing, and the issue keeps its old Status until devops pr ready sets In Review.
Reproduction Steps
- Claim an item that holds
status/new(for exampledevops roadmap claim <n> --as agent --confirm). - Push a branch and run
devops pr create --title "feat(<scope>): ..." --body "... Closes #<n> ...". - Read the labels of issue
<n>after the command exits.
Expected vs Actual Behavior
Expected: the issue holds status/in-progress after devops pr create, or the command says that it found no closing issue.
Actual (2026-11-12, two of two pull requests checked): PR #5111 (opened 15:06:13Z, closes #4685) got its title labels at 15:06:17Z, so _finish_created_pr ran, but #4685 kept status/new. A GraphQL read some minutes later gave #4685 as the closing issue. PR #5109 (opened 14:49:23Z, closes #5018) had the same result: #5018 went from status/new to status/in-review at 14:55:53Z with no status/in-progress between.
Environment Diagnostics
origin/main at 3109817, devcontainer, uv run devops.
Logs, Traces, or Terminal Output
devops pr create printed only "Opened a draft pull request ... When its checks pass, mark it ready with devops pr ready." and exited 0.
Pre-Submission Checklist
- I have verified that no sensitive credentials, private keys, or internal tokens are contained in this issue report.
- I have checked existing issues and pull requests to ensure this is not a duplicate.
Source: #5111
Alternatives check of 2026-11-16: none.
Tool: none found.
Proposed design
Problem statement
devops pr create reads the closing issue at once. GitHub links the closing issue asynchronously. The read can return no issue, so set_delivered_status returns None, the command prints no message, and the issue keeps its old Status. The fix retries the read for a bounded time and reports a missing link.
Acceptance criteria
Requirement: Retry closing-issue read
devops pr create SHALL retry the closingIssuesReferences read after the pull request opens until GitHub returns a closing issue or the bounded wait ends.
Scenario: Issue linked after the first read
- WHEN A unit test mocks the first
closingIssuesReferencesread with no issue and the second read with issue 4685. - THEN The test asserts that
_finish_created_prcallsset_delivered_statusfor issue 4685.
Requirement: Warn when no closing issue appears
devops pr create SHALL print a warning that it found no closing issue when the bounded wait ends with no linked issue.
Scenario: No closing issue after the wait
- WHEN A unit test mocks every
closingIssuesReferencesread with no issue and runsdevops pr create. - THEN The test asserts that the command prints the no-closing-issue warning and exits 0.
Requirement: Status setter returns the linked issue
set_delivered_status SHALL return the number of the issue whose status it sets.
Scenario: One linked issue
- WHEN A unit test gives
set_delivered_statusa pull request that closes issue 4685, which holdsstatus/new. - THEN The test asserts that
set_delivered_statusreturns 4685 and that issue 4685 holdsstatus/in-progress.
Existing Tool Considered
No open, maintained tool or library covers the need. The alternatives check of 2026-11-16 found no tool that waits for GitHub's asynchronous issue-PR link and then sets the issue status label. The fix builds a small project-specific retry in _finish_created_pr and a return value in set_delivered_status: about 20k-40k tokens to build, keep and fix, and 1-2 days elapsed.
Key questions
- How should
devops pr createhandle GitHub's asynchronous closing-issue link?: Use a bounded retry of the pull request'sclosingIssuesReferencesread after the pull request opens. Callset_delivered_statuswhen the first issue appears. (best practice) [sources: src/devops_cli/commands/pr.py:1166, src/devops_cli/roadmap/pull_status.py:63, tests/commands/test_pr_status.py]- Chosen: Bounded retry of
closingIssuesReferences. It uses GitHub's authoritative link and follows the existing poll pattern inpr.py. - Rejected: Parse
Closes #<n>from the pull request body. The body is text, not the authoritative link, and can name an issue that GitHub does not link. - Rejected: Wait without a bound. A missing or malformed closing reference would hang the command.
- Rejected: Keep the immediate read. The issue shows that GitHub can link the issue after the read, so the status is lost.
- Chosen: Bounded retry of
- What wait bound and interval should the retry use?: Add dedicated closing-issue poll constants in
src/devops_cli/config/defaults.pyand use them in_finish_created_pr. (best practice) [sources: src/devops_cli/config/defaults.py, src/devops_cli/commands/pr.py]- Chosen: Add dedicated closing-issue poll constants. It follows the existing PR poll pattern and gives this wait its own meaning.
- Rejected: Reuse
DEFAULT_PR_UPDATE_HEAD_POLL_ATTEMPTSandDEFAULT_PR_UPDATE_HEAD_POLL_INTERVAL_SECONDS. These constants govern a head update, so reuse hides a different wait behind an unrelated name. - Rejected: Use a fixed inline delay. It hides the timing in code and does not follow the repository's configured poll pattern.
- What should
devops pr createdo when no closing issue appears before the wait ends?: Print a warning that it found no closing issue for the pull request. Exit 0, because the pull request was created. (best practice) [sources: src/devops_cli/commands/pr.py, src/devops_cli/roadmap/pull_status.py:63]- Chosen: Warn and exit 0. The pull request exists. A missing link is not a creation failure, and the issue asks for a message.
- Rejected: Exit 1. A nonzero exit reports a failed create after GitHub opened the pull request.
- Rejected: Print nothing. The issue reports this silent result as the defect.
- Should
set_delivered_statusreturn the issue number it updates?: Yes. Return the linked issue number after the label update, and return None only when no issue is linked. (best practice) [sources: src/devops_cli/roadmap/pull_status.py:63, tests/roadmap/test_roadmap_status_labels.py]- Chosen: Return the issue number. The caller can tell a successful status write from a missing link and print the right message.
- Rejected: Keep returning None. The caller cannot tell success from a missing link, which causes the silent failure.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 12, 2026
#2717 delivered the code that sets status/in-progress on pr create; this candidate is a defect in that delivery where the async GitHub link makes the read miss the issue.devops-cli-service commentedon Nov 16, 2026
Alternatives check: none
Reason: The issue is a defect in devops-cli's own
devops pr createflow (its_finish_created_pr/set_delivered_statusreadsclosingIssuesReferencesbefore GitHub links the issue), not a capability an external tool supplies. Searches for tools or libraries covering GitHub's async issue-PR link or setting an issue's status label at PR creation found only unrelated Docker images and a GitHub community discussion describing the same race, and no open maintained library exists that covers this need.Tool: none found
Lacks:
Searches run:
Sources:
Checked on 2026-11-16. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 17, 2026
Status set to Ready at c58b592 (see proposed design in issue body).
devops-cli-service commentedon Nov 17, 2026
Released in v0.173.2: https://github.com/dan-petty/devops-cli/releases/tag/v0.173.2
devops-cli-service commentedon Nov 17, 2026
Live since 2026-11-17 16:55 UTC