Skip to content

Fix golden fixtures and remove unused helpers after MCP gateway payloadSizeThreshold removal#18844

Merged
pelikhan merged 2 commits intomainfrom
copilot/fix-golden-tests-lint-errors
Feb 28, 2026
Merged

Fix golden fixtures and remove unused helpers after MCP gateway payloadSizeThreshold removal#18844
pelikhan merged 2 commits intomainfrom
copilot/fix-golden-tests-lint-errors

Conversation

Copy link
Contributor

Copilot AI commented Feb 28, 2026

After removing payloadSizeThreshold from the MCP gateway config, three golden fixture files and two helper declarations were left out of sync, breaking TestWasmGolden_CompileFixtures and golangci-lint.

Golden fixtures

Removed the "payloadSizeThreshold": 524288 line from the gateway block in basic-copilot.golden, smoke-copilot.golden, and with-imports.golden to match the renderer's current output:

"gateway": {
  "port": $MCP_GATEWAY_PORT,
  "domain": "${MCP_GATEWAY_DOMAIN}",
  "apiKey": "${MCP_GATEWAY_API_KEY}",
  "payloadDir": "${MCP_GATEWAY_PAYLOAD_DIR}"
}

Unused helpers

  • Removed validationHelpersLog from validation_helpers.go (no remaining call sites)
  • Deleted safe_outputs_env_helpers_test.go — its sole content, assertEnvVarsInSteps, had no callers after the safe outputs env refactor
Original prompt

This section details on the original issue you should resolve

<issue_title>[CI Failure Doctor] Golden outputs and lint fail after removing MCP gateway payloadSizeThreshold</issue_title>
<issue_description>### CI Failure Investigation - Run github/gh-aw#38196

Summary

Several pkg/workflow golden tests and the Go linter failed because the recent MCP gateway configuration change removed the payloadSizeThreshold field but the golden fixtures and helper declarations were not kept in sync.

Failure Details

Root Cause Analysis

  • Golden test shards and the test-wasm-golden target still expect MCP gateway configs to include payloadSizeThreshold, but the compiler output now omits that field, so the comparison between generated JSON and the recorded fixtures fails.
  • golangci-lint now sees two helpers with no callers because recent refactors removed the code paths that used them, resulting in an unused linter failure for assertEnvVarsInSteps and validationHelpersLog.

Failed Jobs and Errors

  • build-wasmmake test-wasm-golden fails because TestWasmGolden_AllEngines detects that the generated JSON is missing the "payloadSizeThreshold": 524288 line that the golden files still expect.
  • testTestWasmGolden_CompileFixtures/{basic-copilot,smoke-copilot} fail for the same reason, with the failure report showing that payloadSizeThreshold was dropped from the MCP gateway env.entries block.
  • lint-gogolangci-lint exits with unused errors at pkg/workflow/safe_outputs_env_helpers_test.go:12:6 (unused assertEnvVarsInSteps) and pkg/workflow/validation_helpers.go:33:5 (unused validationHelpersLog).
Investigation Findings
  • The failure report for the golden fixtures highlights this diff:
@@ -339,4 +339,3 @@@ Keep the MCP gateway payload block in sync
               "apiKey": "\$\{MCP_GATEWAY_API_KEY}",
-              "payloadDir": "\$\{MCP_GATEWAY_PAYLOAD_DIR}",
-              "payloadSizeThreshold": 524288
+              "payloadDir": "\$\{MCP_GATEWAY_PAYLOAD_DIR}"
             }
  • golangci-lint raised the unused errors shown in the log because the helpers no longer exercise assert or logging paths that reference them.

Recommended Actions

  • Regenerate the golden fixtures used by TestWasmGolden_AllEngines and TestWasmGolden_CompileFixtures so that they match the compiler’s new output (the payload gateway block should only include payloadDir).
  • Clean up or reintroduce the logic that references assertEnvVarsInSteps and validationHelpersLog so that the helpers are either used or removed, allowing golangci-lint to finish.
  • After updating the fixtures and helper usage, rerun make test-wasm-golden, go test ./pkg/workflow -run TestWasmGolden, and golangci-lint locally before pushing.

Prevention Strategies

  • When removing or renaming configuration fields, immediately regenerate any golden outputs that encode those fields so the tests serve as an early warning for out-of-sync fixtures.
  • Whenever helper functions become unused due to refactors, either delete them in the same change or update their call sites and rerun the linter to guard against unused failures.

AI Team Self-Improvement

Before landing MCP gateway payload changes, rerun the golden fixture suites and golangci-lint locally and update the expectations they encode so the CI jobs stay green.

Historical Context
  • Issue #17678 documented the MCP gateway v0.1.5 update that introduced several breaking config validation changes, including adjustments to the payload configuration. The current failure is the first time the golden fixtures and linter have been caught out by the removal of payloadSizeThreshold.

🩺 Diagnosis provided by CI Failure Doctor

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/ci-doctor.md@ea350161ad5dcc9624cf510f134c6a9e39a6f94d
  • expires on Mar 1, 2026, 1:39 PM UTC

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…adSizeThreshold removal

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix CI failure in golden tests and linter after MCP change Fix golden fixtures and remove unused helpers after MCP gateway payloadSizeThreshold removal Feb 28, 2026
@pelikhan pelikhan marked this pull request as ready for review February 28, 2026 14:18
Copilot AI review requested due to automatic review settings February 28, 2026 14:18
@pelikhan pelikhan merged commit 056536b into main Feb 28, 2026
1 check passed
@pelikhan pelikhan deleted the copilot/fix-golden-tests-lint-errors branch February 28, 2026 14:18
Copy link
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

Aligns the repository with the earlier MCP gateway payloadSizeThreshold removal by updating wasm golden fixtures and cleaning up now-unused Go test/helpers so CI and lint pass again.

Changes:

  • Update three wasm golden fixtures to remove payloadSizeThreshold from the rendered MCP gateway config block.
  • Remove an unused logger helper (validationHelpersLog) to satisfy golangci-lint.
  • Delete an unused test helper file (safe_outputs_env_helpers_test.go) with no remaining call sites.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pkg/workflow/validation_helpers.go Removes an unused package-level logger variable to fix unused lint failures.
pkg/workflow/testdata/wasm_golden/TestWasmGolden_CompileFixtures/basic-copilot.golden Updates expected rendered gateway JSON to match current output (no payloadSizeThreshold).
pkg/workflow/testdata/wasm_golden/TestWasmGolden_CompileFixtures/smoke-copilot.golden Same golden fixture alignment for smoke-copilot compile fixture.
pkg/workflow/testdata/wasm_golden/TestWasmGolden_CompileFixtures/with-imports.golden Same golden fixture alignment for with-imports compile fixture.
pkg/workflow/safe_outputs_env_helpers_test.go Deletes an unused test helper file to resolve lint failures.

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

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.

[CI Failure Doctor] Golden outputs and lint fail after removing MCP gateway payloadSizeThreshold

3 participants