diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 4b74a19ae4..9396640457 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -279,11 +279,10 @@ jobs: run: uv python install 3.12 - name: Install dependencies run: uv sync --locked --all-groups --all-extras - - name: Fetch pull request base for the new-duplicate check - if: github.event_name == 'pull_request' || github.event_name == 'merge_group' - run: git fetch --no-tags --depth=1 origin "$BASE_SHA" + - name: Fetch the base for the new-duplicate check + run: git fetch --no-tags --depth=1 origin "$BASE_REF" env: - BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha }} + BASE_REF: ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha || 'main:refs/remotes/origin/main' }} - name: Run static checks run: make check-ci env: diff --git a/Makefile b/Makefile index f1bc9ed265..1ec05742cd 100644 --- a/Makefile +++ b/Makefile @@ -562,20 +562,16 @@ dupes: uv run fensu dupes -# Warn mode: report new duplicated code since DUPES_BASE without failing the build. +# Fails on duplicated code new since DUPES_BASE. A missing base fails too, so the check cannot +# silently disappear. DUPES_BASE ?= origin/main check-dupes-new: @if ! git rev-parse --verify --quiet "$(DUPES_BASE)^{commit}" >/dev/null; then \ - echo "warning: skipped new-duplicate check: base $(DUPES_BASE) is not available"; \ - exit 0; \ + echo "error: new-duplicate check needs base $(DUPES_BASE); fetch it or set DUPES_BASE" >&2; \ + exit 2; \ fi; \ - uv run fensu dupes --since "$(DUPES_BASE)" --fail-on-new; rc=$$?; \ - if [ $$rc -eq 1 ]; then \ - echo "warning: new duplicated code above (warn mode: this check does not fail yet)"; \ - elif [ $$rc -ne 0 ]; then \ - exit $$rc; \ - fi + uv run fensu dupes --since "$(DUPES_BASE)" --fail-on-new check: diff --git a/fensu.toml b/fensu.toml index 1c38e596d6..36f7e53a9d 100644 --- a/fensu.toml +++ b/fensu.toml @@ -1540,8 +1540,7 @@ rule_modules = [ "scripts.fensu_policy.rules.native_boundary", "scripts.fensu_policy.rules.unused_state", ] -select = ["FPRS", "XSB072", "XSB073", "XSB075"] -warn = ["XSB076", "XSB077"] +select = ["FPRS", "XSB072", "XSB073", "XSB075", "XSB076", "XSB077"] [targets.rust.rule_options.XSB076] schema_paths = ["crates/sqlbuild-orchestration/src/store"]