Skip to content

feat(dupes): add an opt-in --fail-on-new gate for new duplication - #125

Merged
kvlonge merged 1 commit into
mainfrom
feat/dupes-new-cluster-gate
Nov 5, 2026
Merged

kvlonge merged 1 commit into
mainfrom
feat/dupes-new-cluster-gate

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Why

fensu dupes is advisory only, so a project that wants to stop new copies has no way to fail CI on them without also failing on its existing backlog.

Changes

  • New opt-in --fail-on-new flag (requires --since). It exits 1 when a cluster not hidden by [dupes] (allowlist or contract exemptions) touches lines changed since the revision, and prints a failure line naming the remedy.
  • The report says the run is gated: the text heading changes, and JSON advisory is false under the flag. Without the flag, output and exit codes are unchanged.
  • Help, README and docs pages updated in place for the new exit contract.
  • One clippy unwrap_or simplification in the roles path parser, which the current stable toolchain requires for make check-ci.

Verification

  • cargo test -p fensu-cli --test dupes: 10 passed. The new table test covers a new copy failing, an allowlisted copy passing, an untouched existing cluster passing, the flag absent staying advisory, JSON advisory: false, and the flag without --since exiting 2.
  • make check-ci: exit 0. make test: 1350 passed, 12 skipped.
  • Website Playwright tests left to CI (no local browser space).
  • Hygiene scan clean.

With --since REV --fail-on-new, fensu dupes exits 1 when a cluster not
hidden by [dupes] touches lines changed since REV, so CI can block new
copies without failing on the existing backlog. The report says it is
gated (JSON advisory is false). The default stays advisory.

Also apply a clippy unwrap_or simplification the current stable toolchain
requires in the roles path parser.
@kvlonge
kvlonge enabled auto-merge (squash) November 5, 2026 04:45
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying fensu with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0db20c6
Status: ✅  Deploy successful!
Preview URL: https://db536aeb.fensu.pages.dev
Branch Preview URL: https://feat-dupes-new-cluster-gate.fensu.pages.dev

View logs

@kvlonge
kvlonge merged commit 3b3e8ba into main Nov 5, 2026
35 checks passed
@kvlonge
kvlonge deleted the feat/dupes-new-cluster-gate branch November 5, 2026 04:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant