ci: scope lint reports and allow slower analysis #11554
/gateway review
Verdict: LGTM — approve-worthy, no required changes. Posted as COMMENT rather than APPROVE only because outward approvals on this repo belong to the workspace approver; the requester here is not them. @Roasbeef this one is clean from my side.
Verified
pull_request, merge_group, and workflow_call only (nightly arrives via nightly.yml with tier: nightly). For PR/merge-group, inputs.tier is empty so LINT_BASE=HEAD^1; for nightly it is empty so the pinned issues.new-from-rev baseline in .golangci.yml stands. There is no push trigger, so no path lints master with the override.HEAD^1 is resolvable in the lint job. The job checks out with fetch-depth: 0; on pull_request the checkout is the PR merge commit whose first parent is the base tip; on merge_group it is the queue ref whose first parent is the prior base. The container gets the full repo incl. .git via the existing -v $(pwd):/build mount.CI=1 make -n lint-source LINT_BASE=HEAD^1 and make -n lint-module-run ... both expand to custom-gcl run -v --new-from-rev=HEAD^1; without LINT_BASE the flag is absent. lint-native keeps its own --new-from-rev=$(git merge-base HEAD master) override and lint-config-check is untouched — matching the PR description.Lint code job log for 623e0bb1e9 shows --new-from-rev=HEAD^1 in all 13 root+submodule invocations, no resolution errors, diff-filter stage at 51.7 ms (root) and 17–21 ms (modules). The cited PR #11551 log still exists and shows 1.272 s for the same stage, so the ~25× diff-filter claim checks out. diff: 5889/0 in the stats line shows the filter actively suppressing 5,889 pre-existing issues and reporting zero on unchanged lines.tools/go.mod) on a scratch repo: commit 1 introduces a govet printf issue, commit 2 adds another. Plain run reports both; --new-from-rev=HEAD^1 reports only the new-line issues; a config of issues.new-from-rev: HEAD alone reports nothing, and adding the CLI flag --new-from-rev=HEAD^1 reports the new issues — i.e., the CLI override wins over the pinned config baseline, which is exactly the mechanism this PR relies on.623e0bb1e9 — 15 success, 15 skipped (tier system by design), 0 failures.run.timeout 10m→15m is config-only, job has no explicit timeout-minutes (360m default), and the PR's own lint job passed in 15m6s wall.Not verified
make lint (needs Docker, unavailable in my environment) — covered instead by the head's own CI log above.Required changes
None.
— claudell ⚡ (OpenClaw dev agent; this is a COMMENT review posted as litbot-9000 and does not count toward branch protection)
Approved these changes.
/gateway review
Approve. The mechanism is right and minimal: --new-from-rev=HEAD^1 scopes reports to changed lines against the merge's first parent for PR and merge-group lint, inputs.tier != 'nightly' leaves the pinned baseline untouched for nightly, and the Makefile guard (ifneq ($(LINT_BASE),)) means local/native lint keeps the configured default. The 10→15m timeout is justified by the package-loading time observed on CI runners.
This supersedes my earlier COMMENT review on this same head (623e0bb1e9), which verified the trigger gating and HEAD^1 resolvability under fetch-depth: 0 — nothing has changed since, and the diff re-read checks out. Green CI on the current head.
— claudell ⚡ (OpenClaw dev agent; approval posts as litbot-9000 and does not count toward branch protection)
ziggie1984
yyforyongyu
Summary
Keep PR lint failures scoped to changed lines, reduce diff-filter work, and allow slow CI analysis to finish.
Change Description
Use the checked-out merge commit's first parent (
HEAD^1) as the reporting base for PR and merge-group lint, including submodules. Nightly keeps its existing baseline. Increase golangci-lint's total-work timeout from 10 to 15 minutes.Observed diff-filter time dropped from 1.27 s in PR #11551's lint job to 52 ms in this PR's passing lint job, about 25× faster for that stage. These are separate CI runs. Full package analysis still runs, and total root-linter time was 7m32s versus 7m51s, so an end-to-end speedup has not been demonstrated.
Validation:
HEAD^1reports only the new-line warning and still fails.