Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 4, 2026

Security linter failing on unhandled error returns from RenderJSONMCPConfig() in MCP configuration renderers.

Changes

  • Explicitly discard error return value using _ = in 4 MCP renderer callsites:
    • pkg/workflow/copilot_mcp.go
    • pkg/workflow/claude_mcp.go
    • pkg/workflow/custom_engine.go
    • pkg/workflow/codex_mcp.go

Context

RenderJSONMCPConfig() returns error but the current implementations always return nil. The calling functions don't propagate errors, so the return value is intentionally discarded to satisfy the linter.

// Before
RenderJSONMCPConfig(yaml, tools, mcpTools, workflowData, options)

// After
_ = RenderJSONMCPConfig(yaml, tools, mcpTools, workflowData, options)
Original prompt

Reference: https://github.com/github/gh-aw/actions/runs/21662252902/job/62449464153#step:8:1

Fix tests


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@pelikhan
Copy link
Contributor

pelikhan commented Feb 4, 2026

@copilot review changes and validate "latest" is a known release route

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing tests in the application Fix gosec G104 violations in MCP config renderers Feb 4, 2026
Copilot AI requested a review from pelikhan February 4, 2026 07:41
@pelikhan pelikhan marked this pull request as ready for review February 4, 2026 07:42
Copilot AI review requested due to automatic review settings February 4, 2026 07:42
@pelikhan pelikhan merged commit c2a1daf into main Feb 4, 2026
50 of 51 checks passed
@pelikhan pelikhan deleted the copilot/fix-tests-yet-again branch February 4, 2026 07:42
Copilot AI requested a review from pelikhan February 4, 2026 07:43
Copilot stopped work on behalf of pelikhan due to an error February 4, 2026 07:43
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

This PR fixes gosec G104 linter violations by explicitly discarding error return values from RenderJSONMCPConfig() calls. The function currently always returns nil, and the calling interface methods (RenderMCPConfig) don't return errors, making explicit error discard with _ = the appropriate solution.

Changes:

  • Added explicit error discard (_ =) to 4 RenderJSONMCPConfig() callsites in MCP configuration renderers

Reviewed changes

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

File Description
pkg/workflow/custom_engine.go Added _ = to discard error from RenderJSONMCPConfig call in CustomEngine's RenderMCPConfig method
pkg/workflow/copilot_mcp.go Added _ = to discard error from RenderJSONMCPConfig call in CopilotEngine's RenderMCPConfig method
pkg/workflow/codex_mcp.go Added _ = to discard error from RenderJSONMCPConfig call in CodexEngine's RenderMCPConfig method
pkg/workflow/claude_mcp.go Added _ = to discard error from RenderJSONMCPConfig call in ClaudeEngine's RenderMCPConfig method

💡 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.

2 participants