Skip to content

fix(roadmap): remove the orphan draft of a failed stage marks write - #4142

Merged
dan-petty merged 4 commits into
mainfrom
fix/4051-stage-orphan-draft
Nov 8, 2026
Merged

dan-petty merged 4 commits into
mainfrom
fix/4051-stage-orphan-draft

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

The stage job pushed a branch and opened a draft before it wrote the marks. If the marks write failed, a draft stayed with no stage.pr mark. The job now writes a stage.pending mark (branch and time) before the push. An open item with that mark, a pushed branch, a draft and no stage.pr, older than 1 hour, is an orphan: the job closes the draft, deletes the branch and clears the mark. A pushed branch without the mark is never touched.

Closes #4051

Change: openspec/changes/archive/2026-11-08-4051-remove-the-orphan-draft-that-a/

@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them labels Nov 8, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Point to review (the owner has not confirmed this approach): the job removes an orphan draft by an intent mark, stage.pending (branch name and time), that a Service-only write sets BEFORE the push. An orphan is an open item with that mark, a pushed branch, a draft and no stage.pr, and a mark at least 1 hour old. A pushed branch without the mark is never touched, and a young mark is left alone. This replaces the plain branch-pattern rule, which could delete the branch of a person or of another agent. Cost: one more set_marks write per staged item (1 read and 1 PATCH), and one open_pulls read per round, only when an orphan exists.

Known gap: a CLOSED item with a stage.pending mark and no stage.pr is not judged. The issue names open items, and _reconcile already covers closed items that hold the branch mark.

Rollout: no setting is added, renamed, removed or tightened. The 1-hour age is a constant (CONST_ROADMAP_STAGE_ORPHAN_AGE_SECONDS). The example ConfigMap key-walk test (#4093) passes (tests/k8s/test_k8s_configmap_keys.py). Nothing was applied to the cluster.

Test record:

  • Fail-to-pass run on origin/main (devops ci fail-to-pass --base origin/main): 17 failed, 1 passed (a guard test). Output: .data/agent/state/4051-fail-to-pass.txt in the author worktree.
  • Full devops ci under the lock: all rows passed except one test of mine (limit class of the new constant), fixed in ccc8cd2. After the fix: 21221 other tests passed, coverage 92.98 percent. The pytest row took 12m15s (known issue fix(ci): the pytest step of devops ci exceeds the 5-minute budget #3593).
  • After the rebase onto origin/main (682d206): docs generate --check clean; tests/roadmap/test_roadmap_limit_classes.py, tests/roadmap/stage and tests/k8s/test_k8s_configmap_keys.py gave 1681 passed, 1 skipped.

@dan-petty
dan-petty marked this pull request as ready for review November 8, 2026 06:03
@dan-petty
dan-petty merged commit 5f7ff52 into main Nov 8, 2026
25 checks passed
@dan-petty
dan-petty deleted the fix/4051-stage-orphan-draft branch November 8, 2026 12:04
dan-petty pushed a commit that referenced this pull request Nov 8, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.88.1](v0.88.0...v0.88.1)
(2026-11-08)


### Bug Fixes

* **roadmap:** fail a status read in its own row
([#4143](#4143))
([7c6821e](7c6821e))
* **roadmap:** post the alternatives comment only on a change
([#4139](#4139))
([e99e92d](e99e92d))
* **roadmap:** remove the orphan draft of a failed stage marks write
([#4142](#4142))
([5f7ff52](5f7ff52))
* **service:** bound Service session answers and export queue
([#4140](#4140))
([8620c7b](8620c7b))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(roadmap): remove the orphan draft that a failed marks write left

1 participant