Skip to content

fix: require actual PR references in CI-ready ship notes - #7422

Merged
kunchenguid merged 2 commits into
kunchenguid:mainfrom
ironerumi:fm/fm-6200-upstream
Oct 16, 2026
Merged

kunchenguid merged 2 commits into
kunchenguid:mainfrom
ironerumi:fm/fm-6200-upstream

Conversation

@ironerumi

@ironerumi ironerumi commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Intent

The developer asked to offer the fix for upstream issue #6200 as an upstream pull request. fm_dod_note_reports_ci_ready in bin/fm-dod-lib.sh decides whether a status note is the CI-ready ship report with the glob *PR*"checks green"*|*"checks green"*PR*, so an uppercase PR inside any word (PROD, PROPERTIES) makes a note such as paused: PROD deploy watch, checks green on TEST count as a CI-ready done report, turning a still-monitoring task into a completed one. The issue is labeled ready-for-pr. The developer’s fork already fixed this (commit 1885248 in ironerumi/firstmate): the note must contain "checks green" and an actual PR reference (fm_dod_note_has_pr_reference), not a bare substring.

What Changed

  • Require CI-ready ship notes to include both "checks green" and a recognized pull/merge request reference, avoiding false positives from words containing PR.
  • Add regression coverage for misleading status notes and valid PR/MR URL and number formats.

Risk Assessment

✅ Low: The change is narrowly scoped to requiring an explicit PR/MR reference for CI-ready notes and adding the supported Forgejo plural URL form, with behavior-focused coverage for the relevant accepted and rejected note shapes.

Testing

The focused fm-dod behavior suite passed; live executable checks reproduced the old false positive and verified the target rejects it while preserving valid PR/MR CI-ready reports and downstream gating. Evidence was saved as a reviewer-visible transcript.

  • Live validation: ✅ go - 3 of 3 scenarios driven live against the product
Scenario Result Live Evidence
Reject monitoring notes with incidental PR substrings ✅ pass live ~/.no-mistakes/evidence/01M531EWMQXCT19JVHM76HX1H6/fm-dod-ci-ready-regression.txt
Accept CI-ready notes with genuine PR or MR references ✅ pass live bash tests/fm-dod-lib.test.sh and the target-behavior section of the regression evidence
Preserve downstream done-report gating ✅ pass live Target-behavior section of ~/.no-mistakes/evidence/01M531EWMQXCT19JVHM76HX1H6/fm-dod-ci-ready-regression.txt
Evidence: CI-ready note regression evidence

Source: CI-ready note regression evidence

Regression reproduction against base 4de02c06:
ACCEPTED (bug): paused: PROD deploy watch, checks green on TEST
ACCEPTED (bug): paused: checks green on TEST, PROPERTIES watch

Target f206b23b behavior:
REJECTED (correct): paused: PROD deploy watch, checks green on TEST
REJECTED (correct): paused: checks green on TEST, PROPERTIES watch
REJECTED (correct): PR checks green
REJECTED (correct): PR #12 checks pending
ACCEPTED (correct): PR https://github.com/o/r/pull/5 checks green
ACCEPTED (correct): checks green: PR#12
ACCEPTED (correct): https://gitlab.com/o/r/-/merge_requests/5 checks green
ACCEPTED (correct): https://git.example.org/team/repo/pulls/12 checks green

Downstream ship gate decisions for done reports:
NOT GATED: done: implementation complete
GATED: done: PR https://github.com/o/r/pull/5 checks green

Pipeline

Updates from git push no-mistakes

✅ **Intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

🔧 **Review** - 1 issue found → auto-fixed ✅
  • 🚨 bin/fm-dod-lib.sh:635 - The new PR-reference matcher omits the supported Forgejo/Gitea /pulls/<n> URL form. forge=forgejo is allowed for no-mistakes and existing callers use URLs such as https://git.example.org/team/repo/pulls/12; a legitimate done: PR .../pulls/12 checks green therefore fails fm_dod_note_has_pr_reference, causing fm_dod_should_gate_ship_done to skip the named-head gate and accept an unpushed HEAD. Add the /pulls/[0-9]+ form and cover it in the regression cases; tests/fm-dod-lib.test.sh:268-272 currently only exercises singular /pull/ and GitLab MR URLs.

🔧 Fix applied.
✅ Re-checked - no issues remain.

✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 3 of 3 scenarios driven live against the product
Scenario Result Live Evidence
Reject monitoring notes with incidental PR substrings ✅ pass live ~/.no-mistakes/evidence/01M531EWMQXCT19JVHM76HX1H6/fm-dod-ci-ready-regression.txt
Accept CI-ready notes with genuine PR or MR references ✅ pass live bash tests/fm-dod-lib.test.sh and the target-behavior section of the regression evidence
Preserve downstream done-report gating ✅ pass live Target-behavior section of ~/.no-mistakes/evidence/01M531EWMQXCT19JVHM76HX1H6/fm-dod-ci-ready-regression.txt
  • bash tests/fm-dod-lib.test.sh
  • Base-revision behavior driven from git archive 4de02c06 bin for the reported PROD/PROPERTIES false positives
  • Target fm_dod_note_reports_ci_ready cases for invalid monitoring text and GitHub/GitLab PR or MR references
  • Target fm_dod_should_gate_ship_done cases for ordinary and genuine CI-ready done reports
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

Issues

Closes #6200

Fixes #6200

@ironerumi

Copy link
Copy Markdown
Contributor Author

The only red job, Behavior portable serial 3, passed all 29 tests; its timing-artifact upload then failed after five GitHub artifact-service request timeouts. Could a maintainer please re-run that job?

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thank you @ironerumi, both for the fix and for diagnosing the red job.

I checked the log you pointed to. Behavior portable serial 3 ran every test with failed=0. Only the timing-artifact upload failed, after five CreateArtifact request timeouts on GitHub's side. I've re-run the failed job once (run 38952724199).

Review of the tip (f206b23b) against main 7099556d: fm_dod_note_reports_ci_ready now needs checks green plus a real PR/MR reference (PR #N/PR#N, /pull/N, /pulls/N, /merge_requests/N), so PROD/PROPERTIES no longer count as CI-ready. The documented shape PR <url> checks green still matches, so the named-head gate still applies to every real CI-ready report. The regression cases cover both the rejected and accepted forms. No workflow or CI-script changes. The attestation matches the head and live validation is in the body.

contract-class: restore. The CI-ready done classifier is specified as PR <url> checks green. On main it over-accepts notes where the letters PR only appear inside another word, which can mark a still-monitoring task as done. This brings the classifier back to the specified shape.

Status: waiting on the re-run. Nothing is needed from you. If it goes green and the PR stays mergeable, this is eligible to land.

@kunchenguid
kunchenguid merged commit 15ad1bd into kunchenguid:main Oct 16, 2026
37 of 38 checks passed
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: this is merged. Thank you @ironerumi — really appreciate you taking the time on this.