Skip to content

Enforce pre-submission lint hygiene and add an early CI lint gate to reduce lint-fix PR churn#31921

Merged
pelikhan merged 3 commits into
mainfrom
copilot/copilot-opt-reduce-lint-fix-churn
May 13, 2026
Merged

Enforce pre-submission lint hygiene and add an early CI lint gate to reduce lint-fix PR churn#31921
pelikhan merged 3 commits into
mainfrom
copilot/copilot-opt-reduce-lint-fix-churn

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 13, 2026

Copilot PRs were repeatedly failing on lint/format issues after submission, creating avoidable follow-up “lint-fix” PRs and wasting agent throughput. This change tightens pre-submission validation and moves lint feedback to the front of CI.

  • Pre-submission gate now requires lint cleanliness

    • Updated agent-report-progress in Makefile from:
      • build + fmt + test-unit
      • to build + fmt + lint + test-unit
    • Updated gate messaging/help text to explicitly require zero lint errors before report_progress.
  • Agent policy tightened for Checkpoint 2

    • Updated AGENTS.md two-checkpoint guidance to align with the new gate.
    • Added an explicit self-check: confirm lint reports zero errors before calling report_progress.
  • Early CI lint/fmt gate before heavyweight jobs

    • Added a dedicated lint-gate job in .github/workflows/cgo.yml.
    • Wired heavyweight jobs (test, build, build-wasm, actions-build, security*, cross-platform/container jobs, etc.) to needs: [lint-gate] so lint failures surface early and block expensive execution.
# Makefile
agent-report-progress: build fmt lint test-unit
	@echo "Pre-PR validation passed (zero lint errors). Safe to call report_progress."

Copilot AI changed the title [WIP] Enforce make fmt && make lint in pre-submission agent validation Enforce pre-submission lint hygiene and add an early CI lint gate to reduce lint-fix PR churn May 13, 2026
Copilot AI requested a review from gh-aw-bot May 13, 2026 11:22
@pelikhan pelikhan marked this pull request as ready for review May 13, 2026 11:27
Copilot AI review requested due to automatic review settings May 13, 2026 11:27
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR tightens pre-submission validation and restructures the CGO CI workflow so lint/format failures surface early and prevent expensive downstream jobs from running, reducing follow-up “lint-fix” PR churn.

Changes:

  • Update make agent-report-progress to include lint (in addition to build, fmt, and test-unit) and clarify the gate messaging.
  • Align AGENTS.md checkpoint guidance with the stricter pre-PR gate, explicitly calling out “zero lint errors” before report_progress.
  • Add a new lint-gate job in .github/workflows/cgo.yml and wire many heavyweight jobs to needs: [lint-gate] so failures block early.
Show a summary per file
File Description
Makefile Expands the pre-PR gate to include lint and updates help/output messaging accordingly.
AGENTS.md Updates the two-checkpoint guidance to require a lint-clean agent-report-progress before PR updates.
.github/workflows/cgo.yml Introduces an early lint-gate job and makes major jobs depend on it to fail fast.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 3/3 changed files
  • Comments generated: 2

Comment thread .github/workflows/cgo.yml

- name: Run formatting + lint gate
run: |
make fmt-check
Comment thread .github/workflows/cgo.yml
Comment on lines +57 to +64
- name: Install golangci-lint
run: make install-golangci-lint

- name: Run formatting + lint gate
run: |
make fmt-check
make lint

@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot review all comments

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 13, 2026

@copilot review all comments

Addressed the actionable review feedback in commit 59ac9cb.

  • lint-gate no longer runs make lint (which redundantly re-ran fmt-check and duplicated Go linting with lint-go).
  • lint-gate now runs only fast formatting/JS/JSON checks:
    • make fmt-check
    • make fmt-check-json
    • make lint-cjs

This keeps early CI feedback while avoiding repeated Go lint work.

@pelikhan pelikhan merged commit b2b30eb into main May 13, 2026
@pelikhan pelikhan deleted the copilot/copilot-opt-reduce-lint-fix-churn branch May 13, 2026 14:17
Copilot AI requested a review from pelikhan May 13, 2026 14:17
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.

[copilot-opt] Reduce lint-fix PR churn: enforce make fmt && make lint in pre-submission agent validation

5 participants