Repository navigation
Description
Problem or Motivation
In the iteration lane, a workstation pull request opens after a passing gate (OD6 a), and the implement Job opens its pull request at the end (OD3 a). Then no early draft shows the work in progress, and the issue loses this signal. The owner requires that the issues and releases keep the project status visible (2026-11-11).
Proposed Solution & Architectural Design
Generalize the marker upsert of publish_pr_evidence (src/devops_cli/github/pr_evidence.py). At each gate end, one note on the issue of the branch <type>/<issue>-<slug> gives one of these:
- the state of the gate;
- the failed rows, with at most 20 test IDs;
- the fallback reason.
The note is edited in place. The implement Job uses the same helper for its run table, its branch and a compare link.
Target Subsystem
SDLC, Git & PR Governance (src/devops_cli/github/).
Existing Tool Considered
The marker upsert of publish_pr_evidence and the paced GitHub session cover the need. Cost (estimate): about 120,000 tokens and 2 hours to build, about 3,000 tokens a month to keep, about 15,000 tokens to fix.
Acceptance Criteria
- Each issue has one note, edited in place.
- The note gives at most 20 test IDs.
- A test proves that the text holds no host name and no private address.
Dependencies
Source: #4667
Alternatives check of 2026-12-01: rejected.
Rejected by ADR 0006. A newer fact can change an ADR.
Tool: PyGithub (https://pypi.org/project/PyGithub), GNU Library or Lesser General Public License (LGPL), last activity 2026-08-20, maintained.
Reason: Searches found PyGithub, a GitHub client that can list, create and edit an issue comment. It covers the in-place note only, not the gate state, test ID cap or redaction. ADR 0006 rejects it as the session transport.
Covers:
- List, create and edit one issue comment
- Reach the GitHub API from Python code
- Find a comment by its body text
Lacks:
- Gate state, failed rows and fallback reason
- At most 20 test IDs with an overflow count
- Redaction of host names and private addresses
- Issue number from the branch form
Proposed design
Problem statement
A workstation pull request opens only after a passing gate, and the implement Job opens its pull request at the end, so no early draft shows the work in progress and the issue loses that signal. The owner requires that the issues keep the project status visible. This change writes one gate note on the issue at each gate end, edited in place, that shows the gate state, the failed rows and the fallback reason.
Acceptance criteria
Requirement: One gate note per issue
The gate note writer SHALL keep exactly one gate note on the issue of the branch and update it in place.
Scenario: A later gate updates the first note
- WHEN The issue already holds a gate note and a later gate writes its result.
- THEN The writer updates the existing comment and creates no second comment.
Requirement: Test ID cap
The gate note SHALL list at most 20 failed test IDs.
Scenario: More than 20 failed test IDs
- WHEN A gate result holds 25 failed test IDs.
- THEN The note lists the first 20 test IDs in order and one line that states that 5 more exist.
Requirement: No internal host name and no private address
The gate note text MUST hold no internal host name and no private address.
Scenario: A fallback reason with an internal host name and a private address
- WHEN The fallback reason holds
runner-1.internaland10.0.0.5. - THEN The note holds neither
runner-1.internalnor10.0.0.5.
Requirement: Gate state and failed rows
The gate note SHALL state the gate result, the failed rows and the fallback reason.
Scenario: A failing gate
- WHEN A gate fails with failed rows and a fallback reason.
- THEN The note holds the gate state, the failed rows and the fallback reason.
Requirement: One marker upsert
The pull request evidence, the gate note and the roadmap step comment writer SHALL use one marker upsert helper.
Scenario: Each caller uses the shared helper
- WHEN A test replaces
upsert_marked_commentwith a fake and runspublish_pr_evidence,publish_gate_noteandcomment.post. - THEN The fake records one call from each caller.
Requirement: Issue from branch
The gate note writer SHALL resolve the issue number from the branch <type>/<issue>-<slug>.
Scenario: A feature branch
- WHEN The branch is
feat/4702-gate-note. - THEN The writer resolves issue 4702.
Requirement: Implement run note
The implement Job SHALL write its run table, its branch and a GitHub compare link in the gate note.
Scenario: The implement Job writes its note
- WHEN The implement Job ends its run on branch
feat/4702-gate-noteforowner/repowith default branchmain. - THEN The note holds the run table, the branch and
https://github.com/owner/repo/compare/main...feat/4702-gate-note.
Existing Tool Considered
PyGithub (https://pypi.org/project/PyGithub) is the tool that the alternatives block of the issue body names. The block records the verdict rejected, by ADR 0006, and its Lacks: list is the answer for what the tool lacks here. The project keeps the gidgethub session and builds the helper itself: about 120,000 tokens and 2 hours to build, about 3,000 tokens a month to keep, and about 15,000 tokens to fix.
Key questions
- How does
publish_pr_evidencekeep one comment per pull request?: It lists the issue comments. It keeps the one whose body opens withCONST_PR_EVIDENCE_MARKERand whose author is the session login. It updates that comment or creates it. A comment of another author never matches. [sources: src/devops_cli/github/pr_evidence.py:92, src/devops_cli/github/pr_evidence.py:123, src/devops_cli/github/pr_evidence.py:131, src/devops_cli/config/constants.py:5075] - Where does the shared marker upsert live?: Extract the one marker upsert to
upsert_marked_commentinsrc/devops_cli/github/marked_comment.py, and make the existing shared writerpostinsrc/devops_cli/roadmap/steps/comment.pycall it, so the pull request evidence, the gate note and the roadmap step share one tested path. Putbuild_gate_noteandpublish_gate_noteinsrc/devops_cli/github/gate_note.py;publish_pr_evidenceandpublish_gate_notecall the upsert with their marker, andpostkeeps its no-write-when-identical rule. (best practice) [sources: src/devops_cli/roadmap/steps/comment.py:153, src/devops_cli/roadmap/steps/comment.py:180, src/devops_cli/github/pr_evidence.py:123, src/devops_cli/config/constants.py:5075]- Chosen: Move the one upsert into
src/devops_cli/github/marked_comment.pyand havepostcall it.postalready implements the own-author and marker match (refactor(roadmap): one marked-comment writer for every job #5025), so a new helper beside it would be a second copy; one module gives all three callers one tested path. - Rejected: Extract only the
pr_evidence.pylogic into a new helper and leavepostas it is. Two copies of the author and marker checks drift, and a fix to one misses the other. - Rejected: Copy the marker logic into the gate note. A third copy drifts from both writers, and the gate note would miss a later fix.
- Chosen: Move the one upsert into
- How does the writer find the issue number?: Call
issue_of_branchfromsrc/devops_cli/git/branch_form.py. It reads the form<type>/<issue>-<slug>and returns the number whole, sofeat/4702-gate-notegives 4702 andfeat/23370-xgives 23370; another branch gives None. No API call is needed. (best practice) [sources: src/devops_cli/git/branch_form.py:58, src/devops_cli/git/branch_form.py:67, CONTEXT.md:122]- Chosen: Reuse
issue_of_branch. The project already parses the branch form in one place, andparse_branchreads the number whole and refuses a branch that breaks the form. - Rejected: Write a local parse of the digits after the first
/. A second pattern drifts fromparse_branch, which is the project's rule for the branch form. - Rejected: Read the linked issue from the pull request. The early gate has no pull request yet, and the call costs one more API request.
- Chosen: Reuse
- Which marker separates the gate note from the pull request evidence comment?: Add
CONST_GATE_NOTE_MARKERtosrc/devops_cli/config/constants.py. Match it with the same own-author rule aspublish_pr_evidence. (best practice) [sources: src/devops_cli/config/constants.py:5075, src/devops_cli/github/pr_evidence.py:92, src/devops_cli/roadmap/steps/comment.py:174]- Chosen: Add a new
CONST_GATE_NOTE_MARKER. A distinct marker keeps the match rule unambiguous, and the own-author rule keeps each note single. - Rejected: Reuse
CONST_PR_EVIDENCE_MARKER. A reused marker makes the two note types one, and a body that matches the wrong note overwrites it. - Rejected: Match by the heading text. A person can copy the heading, and a heading match has no stable key.
- Chosen: Add a new
- How does the note show more than 20 failed test IDs?: List the first 20 failed test IDs in order. Add one line that states the count of the rest, such as
5 more failed tests. The note stays at the cap. The project uses this form:repo_mapgives the first files and a last line for the rest, and the implement trace counts the events that it dropped. (best practice) [sources: docs/ROADMAP_WORKFLOW.md:171, docs/roadmap/implement.md:85, src/devops_cli/roadmap/stage/stage_tools.py:337]- Chosen: First 20 IDs and a count of the rest. The note keeps the cap and still tells the reader how many rows the cap hides; the project caps a list and names what it left out.
- Rejected: First 20 IDs with no count. A reader cannot tell a complete list from a cut one, and the trace records the count of its dropped events.
- Rejected: All failed IDs. The body caps the note at 20 test IDs.
- How does the note keep host names and private addresses out?: Run each free-text field through
mask_secretsandmask_private_hostsfromsrc/devops_cli/security/sanitizer.pybefore the note is written.mask_private_hostsmasks private host names and private or loopback addresses with<masked-host>. A test feeds10.0.0.5andrunner-1.internaland asserts that neither string is in the note. (best practice) [sources: src/devops_cli/security/sanitizer.py:432, src/devops_cli/security/sanitizer.py:446, src/devops_cli/security/sanitizer.py:468, docs/HOMELAB_REPO_SWITCH.md:13]- Chosen: Redact free text in the writer. The fallback reason is free text, and one writer keeps the rule for both notes.
- Rejected: Include no free text. The body requires the fallback reason, so the note must show it.
- Rejected: Leave redaction to the caller. Each caller would repeat the rule, and one miss posts a host name.
- Which step writes the gate note?: The gate command that feat(ci): devops ci --remote runs the gate in the cluster #4698 delivers writes the note when its gate run ends. feat(ci): track the iteration lane and push cuts #4667 (fetched 2026-11-26) makes the cluster gate the engine (OD1 a) and requires every push to follow a passing gate (OD6 a), and it lists feat(ci): devops ci --remote runs the gate in the cluster #4698 as
devops ci --remote runs the gate in the cluster. The implement Job calls the same writer for its run table, its branch and the compare link. (best practice) [sources: https://github.com/feat(ci): track the iteration lane and push cuts #4667, docs/roadmap/implement.md:68]- Chosen: The gate command from feat(ci): devops ci --remote runs the gate in the cluster #4698. The gate is the cluster CI gate, and the command that ends the gate holds the result.
- Rejected: The roadmap stage step. The stage job writes the plan comment, not the result of the cluster CI gate.
- Rejected: Every check run writes a note. Each run would edit the note, and the last edit wins with no gate result.
- Rejected: A scheduled sweep writes the note. The sweep adds a delay and needs a second read of the gate state.
- What form does the compare link take?: Use the GitHub compare URL
https://github.com/<owner>/<repo>/compare/<base>...<branch>. The base is the default branch. (best practice) [sources: CHANGELOG.md:5, tests/fixtures/github/hello_world_repositories.json:60]- Chosen: GitHub compare URL from the default branch to the branch. The branch has no pull request yet, so the compare view shows the work.
- Rejected: A link to the pull request. The early gate has no pull request.
- Rejected: The branch name as plain text. A reader must copy the name to see the diff.
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 11, 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.(ci)scope of the title gives the scope.The owner requires visible status on issues, but the feature does not block delivery or fix a defect.It keeps project status visible on the issue as the owner requires, but it is a visibility aid, not a blocker.The body estimates about 120,000 tokens and 2 hours to build, which is moderate work.Both post quality gate results from the implement job in src/devops_cli/github/, but #4129 writes the evidence comment on the delivery PR while the candidate writes a gate-state note on the issue.devops-cli-service commentedon Nov 14, 2026
Alternatives check: partly
Reason: The web searches returned no relevant library (only container images and unrelated documentation pages), so I read the facts of the closest candidates: peter-evans/create-or-update-comment implements the marker-based single-comment upsert on issues, which is the "one note, edited in place" part of the acceptance criteria, but it is a JavaScript workflow action that the Python helper in src/devops_cli/github/ and the implement Job cannot call, and it produces none of the gate content. The project's own session transport (gidgethub) only offers raw create/edit comment calls, so the marker upsert, the test-ID cap and the redaction test stay project work: partly covered.
Tool: peter-evans/create-or-update-comment (https://github.com/peter-evans/create-or-update-comment)
Covers:
Lacks:
Tools considered:
Searches run:
Sources:
Checked on 2026-11-14. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 15, 2026
Refine cannot set this item to Ready at 0820a64 while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.
devops-cli-service commentedon Nov 20, 2026
The result in the alternatives block of the issue body changed. Before this check:
partly, tool https://github.com/peter-evans/create-or-update-comment. A person decides what the new result means for the item.Searches (5)
Tools considered:
Searches run:
Sources:
devops-cli-service commentedon Nov 26, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.
devops-cli-service commentedon Nov 26, 2026
The result in the alternatives block of the issue body changed. Before this check:
rejected, tool https://pypi.org/project/PyGithub. A person decides what the new result means for the item.Searches (5)
Tools considered:
Searches run:
Sources:
devops-cli-service commentedon Dec 1, 2026
The result in the alternatives block of the issue body changed. Before this check:
partly, tool https://pypi.org/project/PyGithub. A person decides what the new result means for the item.Searches (6)
Tools considered:
Searches run:
Sources: