Skip to content

fix: enforce consolestderr on wasm and guard native/wasm CI parity - #67634

Merged
pelikhan merged 3 commits into
mainfrom
pelikhan-console-stderr-linter-ci-parity
Oct 11, 2026
Merged

pelikhan merged 3 commits into
mainfrom
pelikhan-console-stderr-linter-ci-parity

Conversation

@pelikhan

@pelikhan pelikhan commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Fixes #67609.

  • Mirror the dedicated consolestderr -test=false CI step on WebAssembly, using the existing wasm package scope.
  • Parse the custom-linter job's YAML and compare native and wasm analyzer sets, including both bulk and dedicated steps. Keep the registry guard without its brittle hard-coded step count.
  • Explicitly track the pre-existing native-only contextcancelnotdeferred exception from contextcancelnotdeferred still enforced on native CI only - wasm LINTER_FLAGS omission unfixed (issue 55932 auto-expired, 2nd oc #65753, rejecting stale exceptions once parity is restored.
  • Ignore full-line shell comments in block-scalar commands before scanning target assignments and analyzer flags. Retain the production parity guard and a small standalone parser regression without exact workflow-format preconditions. Update the linter design notes.

Validation

  • go test ./pkg/linters -count=1
  • consolestderr -test=false against the native production package set and the existing wasm package set
  • go run github.com/rhysd/actionlint/cmd/actionlint -shellcheck= -pyflakes= .github/workflows/cgo.yml
  • PATH="/opt/homebrew/bin:$PATH" make agent-report-progress (initial publication: build, changed-package lint, impacted tests, and workflow drift guard all passed; 337 workflows compiled successfully)

Full make fmt completed Go formatting but encountered an unrelated existing JavaScript formatter error in testdata/copilot_sdk_web_fetch_contract.json (convertToJson is not defined). Incidental formatting changes outside this issue were removed.

Mirror the dedicated consolestderr check for WebAssembly and compare native and wasm analyzer sets independently of registry membership. Track the existing contextcancelnotdeferred exception and cover target drift regressions.

Fixes #67609

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@pelikhan
pelikhan marked this pull request as ready for review October 11, 2026 05:35
Copilot AI balanced review requested due to automatic review settings October 11, 2026 05:35
@github-actions

Copy link
Copy Markdown
Contributor

🔎 PR Code Quality Reviewer is reviewing code quality for this pull request...

@github-actions

github-actions Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Generated by Ponytail Reviewer for #67634

@github-actions

github-actions Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff

🧪 Test quality analysis by Test Quality Sentinel

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One opportunity to make this smaller.

net: -95 lines possible.

Generated by ✂️ Ponytail Reviewer for #67634 · codex · gpt56 · 6.71 AIC · ⌖ 5.22 AIC · ⊞ 13.5K
Comment /ponytail to run again

Comment thread pkg/linters/ci_sync_test.go Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Block-scalar shell comments can still be misclassified as active linter enforcement.

1 open finding
What changed in this PR

Adds WebAssembly enforcement for consolestderr and guards native/WASM linter parity.

Changes:

  • Adds the dedicated WASM lint step.
  • Parses CI YAML to compare analyzer sets.
  • Adds parity regression tests and documentation.
File Description
.github/​workflows/​cgo.yml Adds WASM consolestderr enforcement.
pkg/​linters/​doc_sync_test.go Implements target-parity validation.
pkg/​linters/​ci_sync_test.go Adds regression scenarios.
pkg/​linters/​README.md Documents parity policy and exception.

🧠 Review effort: Balanced


💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread pkg/linters/doc_sync_test.go Outdated
@github-actions

Copy link
Copy Markdown
Contributor

🏗️ Design Decision Gate — ADR Required

This PR makes significant changes to core business logic (>100 new lines in pkg/) but does not have a linked Architecture Decision Record (ADR).

📄 Draft ADR committed: docs/adr/67634-enforce-native-wasm-linter-parity-in-ci.md — review and complete it before merging.

🔒 This PR cannot merge until an ADR is linked in the PR body.

📋 What to do next
  1. Review the draft ADR committed to your branch — it was generated from the PR diff (.github/workflows/cgo.yml, pkg/linters/ci_sync_test.go, pkg/linters/doc_sync_test.go, pkg/linters/README.md)
  2. Complete the missing sections — add context the AI couldn't infer, refine the decision rationale, and list real alternatives you considered
  3. Commit the finalized ADR to docs/adr/ on your branch
  4. Reference the ADR in this PR body by adding a line such as:

    ADR: ADR-67634: Enforce Native/WebAssembly Custom-Linter Parity via YAML-Parsing CI Sync Tests

Once an ADR is linked in the PR body, this gate will re-run and verify the implementation matches the decision.

🔍 Decision inferred from the diff
📋 Michael Nygard ADR Format Reference

An ADR must contain these four sections to be considered complete:

  • Context — What is the problem? What forces are at play?
  • Decision — What did you decide? Why?
  • Alternatives Considered — What else could have been done?
  • Consequences — What are the trade-offs (positive and negative)?

All ADRs are stored in docs/adr/ as Markdown files numbered by PR number.

🏗️ ADR gate enforced by Design Decision Gate 🏗️ · pi · opus50 · 38.2 AIC · ⌖ 45 AIC · ⊞ 1.8K · ◷
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 36.2 AIC · ⌖ 5.57 AIC · ⊞ 21.2K
Comment /review to run again

Comment thread pkg/linters/ci_sync_test.go Outdated

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Skills-Based Review 🧠

Applied /diagnosing-bugs and /tdd to this CI-parity fix. The change is well-scoped and well-tested — no actionable issues found.

📋 Verification performed
  • Ran go test ./pkg/linters -run 'TestCIEnforcedLinter' -v -count=1: all three tests pass (TestCIEnforcedLinterTargetDrift, TestCIEnforcedLintersMatchTargets, TestCIEnforcedLintersMatchRegistry).
  • Ran go test ./pkg/linters -count=1: full package passes.
  • gofmt -l and go vet ./pkg/linters/... are clean on the new/modified test files.
  • actionlint on .github/workflows/cgo.yml reports no errors.
  • Verified the new consolestderr (wasm) step uses the same LINTER_PACKAGES scope as the existing wasm bulk step, so parity is scoped correctly.

Why this is a solid fix (per /diagnosing-bugs)

  • Root cause addressed, not just symptom: rather than only adding the missing wasm step (the proximate bug from #67609), the PR adds a generic TestCIEnforcedLintersMatchTargets regression test that structurally parses cgo.yml's lint-go-custom job and diffs native vs. wasm analyzer sets — this prevents the class of bug (native/wasm drift), not just this one instance.
  • The notYetEnforced/nativeOnly exception maps require non-empty reasons and are asserted to go stale once parity is restored ("restored parity makes native exception stale" test case), which avoids exceptions silently living forever.

Strong test coverage (per /tdd)

  • ci_sync_test.go's table-driven TestCIEnforcedLinterTargetDrift covers meaningful edge cases: missing dedicated step on each target, bulk-flag drift on each target, restored parity, GOOS/GOARCH expressed via step env: instead of inline, single- vs double-quoted LINTER_FLAGS, and commented-out steps not counting as enforcement. These are exactly the cases that would have silently reintroduced the original drift.
  • The regex widening (LINTER_FLAGS=["']([^"']+)["']) and the YAML-based step/env parser in parseCIEnforcedLinterSets are more robust than the previous brittle string-count assertion it replaces.

No blocking concerns. Nit (non-blocking): ci_sync_test.go and doc_sync_test.go both locally reimplement similar YAML-based CI workflow parsing — if more CI-sync tests are added later, consider consolidating parseCIEnforcedLinterSets and its workflow struct into a small shared test helper file to keep the two files from drifting apart in how they interpret cgo.yml.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · 69.6 AIC · ⌖ 14.5 AIC · ⊞ 10.3K
Comment /matt to run again

Filter full-line shell comments before both target and analyzer scans. Replace workflow-format-dependent mutation tests with a focused standalone block-scalar regression while retaining the production parity guard.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@pelikhan
pelikhan merged commit dace583 into main Oct 11, 2026
55 checks passed
@pelikhan
pelikhan deleted the pelikhan-console-stderr-linter-ci-parity branch October 11, 2026 07:26
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.

consolestderr (78th linter) CI-enforced on native only - omitted from the wasm custom-linters run (ci_target_asymmetry recurrenc

2 participants