Skip to content

fix(ci): stop the path-filter comment self-triggering the to-do scanner - #6765

Merged
devantler merged 3 commits into
mainfrom
claude/todo-scanner-self-trigger-6763
Aug 29, 2026
Merged

devantler merged 3 commits into
mainfrom
claude/todo-scanner-self-trigger-6763

Conversation

@devantler

Copy link
Copy Markdown
Contributor

🤖 Generated by the Agentic Engineer

Why

Our to-do scanner files a GitHub issue whenever it sees the uppercase marker in a comment. That is exactly what it is for — but it means a comment that merely talks about the scanner files an issue about itself. One landed yesterday and produced #6763: an issue whose entire body was a comment block, with no work behind it. It was also the only issue in the whole portfolio missing an Issue Type, so it showed up as triage debt on top of being noise.

What

Refers to the marker as "to-do" in that one explanatory comment — the same convention the shared workflow in devantler-tech/actions already applies to its own source, for this exact reason — and adds a test so the trap cannot come back unnoticed.

The guard is deliberately narrow: filing issues from real markers is the scanner's job, so it checks only that this one comment block stays clean rather than banning the marker repository-wide.

Fixes #6763

The shared scanner keys on the uppercase marker wherever it appears in a
comment, so prose that merely names the marker files an issue against
itself. The explanatory comment on the todos-contract path filter did
exactly that when it landed, producing ksail#6763 — an issue whose entire
body was the comment block, with no work behind it.

Spell the marker as "to-do" in that prose, matching the convention the
shared workflow in devantler-tech/actions already applies to its own
source for the same reason, and pin the trap with a test so it cannot
come back silently.

The guard is deliberately narrow. Filing issues from real markers is the
scanner's job, so it asserts only that this one explanatory block does
not spell the marker — it does not ban the marker repository-wide. The
test assembles the marker at runtime rather than writing it out, because
spelling it in the test file would reintroduce the defect being pinned,
and it requires the comment block to be non-empty so deleting the comment
cannot make it pass vacuously.

Fixes #6763

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

✅MegaLinter analysis: Success

✅ Linters with no issues

actionlint, bash-exec, git_diff, hadolint, jscpd, jsonlint, lychee, markdown-table-formatter, markdownlint, prettier, prettier, shellcheck, shfmt, stylelint, syft, trivy-sbom, trufflehog, v8r, v8r, yamllint

Notices

⚠️ Your configuration references items that have been removed from MegaLinter and are ignored: REPOSITORY_GITLEAKS. See Removed linters to find their replacements.

See detailed reports in MegaLinter artifacts

MegaLinter is provided by OX Security
Show us your support by starring ⭐ the repository

@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

CI has settled: 65 checks green. The single red is Analyze (go), GitHub's managed CodeQL
(event: dynamic) failing on cgo extraction — intermittent rather than caused by this change
(#6766 and #6742 pass it at the same time, and main passes it on its 5 newest runs). Tracked in
#6767, which also records that it gates the merge through the code_scanning ruleset rule.

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Aug 29, 2026 •

Copy link
Copy Markdown

@devantler I will perform a full review of the pull request. The review will assess the current change set independently of the tracked intermittent Analyze (go) failure.

✅ Action performed

Full review finished.

@coderabbitai

coderabbitai Bot commented Aug 29, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 379af918-e99c-4e71-9a7b-3c7049799b42

📥 Commits

Reviewing files that changed from the base of the PR and between 43da333 and 88aea14.

📒 Files selected for processing (2)
  • .github/workflows/ci.yaml
  • internal/ciharness/todos_workflow_test.go

Included review availability: Your plan provides up to 2 included reviews per hour; 0 remain after this review.

📜 Recent review details
⏰ Context from checks skipped due to timeout. (6)
  • GitHub Check: 🧪 System Test (Docker) (Talos, Docker, true, --name system-test-cluster-with-image-verificatio...
  • GitHub Check: 🧪 System Test (Docker) (Talos, Docker, true, --cni Calico --csi Disabled --load-balancer Disab...
  • GitHub Check: 🧪 System Test (Docker) (Talos, Docker, true, --name system-test-cluster --cni Cilium --csi Ena...
  • GitHub Check: 🧪 System Test (Docker) (Talos, Docker, true, --gitops-engine ArgoCD --local-registry ghcr.io/d...
  • GitHub Check: 🧪 System Test (Docker) (Talos, Docker, true, --gitops-engine Flux --local-registry ghcr.io/dev...
  • GitHub Check: 🧪 System Test (Docker) (Talos, Docker, true)
🧰 Additional context used
📓 Path-based instructions (4)
Use Go 1.26.1 or newer, matching the version declared in `go.mod`.

📄 CodeRabbit inference engine (AGENTS.md)

Files:

  • internal/ciharness/todos_workflow_test.go
Generated files must not be hand-edited; run `make generate` as the canonical regeneration command.

📄 CodeRabbit inference engine (AGENTS.md)

Files:

  • internal/ciharness/todos_workflow_test.go
Validate workflow changes with `mega-linter-runner -f go`; MegaLinter runs `actionlint` for GitHub Actions workflows.

📄 CodeRabbit inference engine (AGENTS.md)

Files:

  • .github/workflows/ci.yaml
Add regression tests for confident bug fixes and run flaky-test candidates repeatedly with `go test -run -count=10 ./...`.

📄 CodeRabbit inference engine (AGENTS.md)

Files:

  • internal/ciharness/todos_workflow_test.go
🔇 Additional comments (2)
.github/workflows/ci.yaml (1)

166-166: LGTM!

Also applies to: 179-181

internal/ciharness/todos_workflow_test.go (1)

5-5: LGTM!

Also applies to: 26-42, 78-126


📝 Walkthrough

Walkthrough

The workflow comment now uses lowercase, hyphenated “to-do” wording and explains why it avoids the uppercase scanner marker. A Go regression test reads the comment block above todos-contract: and verifies that the marker does not appear.

Merge Risk: ⚪ Minimal · up to 88aea

This change narrowly prevents a CI comment from triggering the to-do scanner while preserving real marker handling, and adds a regression test; no actionable merge-blocking risk remains beyond normal checks and review.


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error)

Check name Status Explanation Resolution
Linked Issues check ❌ Error The changes do not implement the primary objectives in issue #6763. They do not add or modify the dedicated todos-contract path filter and job, or ensure the required workflow and harness changes tr… Implement the todos-contract path filter and associated job for .github/workflows/todos.yaml, .github/workflows/ci.yaml, and internal/ciharness/**. Ensure scanner-only changes execute the validation and that the filter and its asser…
✅ Passed checks (4 passed)
Check name Status Explanation
Out of Scope Changes check ✅ Passed The changed comment and regression test are related to the TODO scanner workflow and its CI harness. No unrelated changes are present.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files. (1 skipped: 1 …
Title check ✅ Passed The title clearly and concisely describes the CI comment change that prevents the to-do scanner from triggering on its own explanatory comment.
Description check ✅ Passed The description directly explains the scanner self-trigger issue, the comment fix, the regression test, and the scope of the guard.
Full details: Linked Issues check

Explanation

The changes do not implement the primary objectives in issue #6763. They do not add or modify the dedicated todos-contract path filter and job, or ensure the required workflow and harness changes trigger that validation.

Resolution

Implement the todos-contract path filter and associated job for .github/workflows/todos.yaml, .github/workflows/ci.yaml, and internal/ciharness/**. Ensure scanner-only changes execute the validation and that the filter and its assertions are covered.

Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files. (1 skipped: 1 unsupported.)


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

devantler and others added 2 commits August 29, 2026 06:06
Explains what the test pins — the bare reusable-workflow call, the immutable
pin, and why the ignore pattern is asserted exactly rather than loosely.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The doc comment added in the previous commit opened with the function's own
name, which embeds the uppercase marker the scanner keys on — the exact trap
the sibling test in this file exists to pin. Reworded so the comment carries
no marker, and said why it does not lead with the name.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Aug 29, 2026 •

Copy link
Copy Markdown

@devantler I will perform a full review of the pull request. I will assess the current change set independently of the tracked intermittent CodeQL failure.

✅ Action performed

Full review finished.

@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

Readiness record @ 88aea14269d618926e5bec141b2ddd660c8c43df

Tried and evaluated as a user — RED/GREEN ablation, run locally at this exact head.

State ci.yaml filter comment TestCIFilterCommentDoesNotSpellTheScannerMarker
GREEN (as shipped) says to-do PASS
RED (ablated) marker restored FAIL at todos_workflow_test.go:119

The ablation fixture was asserted to have actually built (git diff --numstat → 1+/1-, the reworded
line flipping back), and the failure was checked to be the intended assertion rather than a sibling
conjunct — it is the NotContains on the marker, reporting
comment must not spell the scanner marker: doing so files a spurious issue (ksail#6763). Reverted
afterwards and re-run green, so the tree is unmodified.

Census, with a positive control. Marker occurrences on comment lines: ci.yaml → 0,
todos_workflow_test.go → 0. The control (a fixture comment containing the marker) matched 1, so the
zero is a real absence rather than a broken pattern.

Worth recording explicitly, because a naive census reads as a failure here: the marker still appears
3× in ci.yaml and 2× in the test file — as job names, an echo string, and the Go test-function
identifier. None is a comment, and the scanner keys on the marker in comments, so those are
correctly untouched. The test scopes itself the same way: it walks only the contiguous comment block
immediately above the todos-contract: filter key, which is exactly the block that produced #6763.

The test also carries a proper guard against passing vacuously —
require.NotEmpty(t, block, "the todos-contract filter must keep its explanatory comment") — so
deleting the comment fails the test rather than silently satisfying it.

Pentad: checks green · 0 unresolved threads · 0 non-thread findings · no conflict ·
green_review=cr@88aea1426 (CodeRabbit completed 05:04:07Z, "No actionable comments were generated";
the only body section is the excluded informational 🔇 Additional comments).

Promoting and merging on that basis. Closes the untyped-residual issue #6763.

@devantler
devantler marked this pull request as ready for review August 29, 2026 05:16
@devantler
devantler merged commit 5980ad5 into main Aug 29, 2026
76 checks passed
@devantler
devantler deleted the claude/todo-scanner-self-trigger-6763 branch August 29, 2026 05:17
@github-project-automation github-project-automation Bot moved this from 🫴 Ready to ✅ Done in 🌊 Project Board Aug 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

scanner

1 participant