Skip to content

Fix lint-go CGO failure by normalizing ResolveGhAwRef formatting and string construction#38778

Merged
pelikhan merged 3 commits into
mainfrom
copilot/cgo-fix-workflow-failure
Jun 12, 2026
Merged

Fix lint-go CGO failure by normalizing ResolveGhAwRef formatting and string construction#38778
pelikhan merged 3 commits into
mainfrom
copilot/cgo-fix-workflow-failure

Conversation

Copilot AI commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

The CGO workflow run #11644 failed in lint-go due to formatting/lint violations in ResolveGhAwRef (pkg/workflow/action_resolver.go). The failure was isolated to a small block that tripped gofmt and perfsprint.

  • Root cause addressed

    • ResolveGhAwRef built the commits API path with fmt.Sprintf, which triggered perfsprint.
    • The same block had formatting drift that triggered gofmt in CI.
  • Code changes

    • Replaced formatted string construction with direct concatenation for the commits API path.
    • Normalized the function block formatting without changing control flow or error semantics.
  • Behavioral impact

    • No functional logic change intended; this is a lint/format compliance correction in production code.
// before
apiPath := fmt.Sprintf("/repos/github/gh-aw/commits/%s", ref)

// after
apiPath := "/repos/github/gh-aw/commits/" + ref

Copilot AI and others added 2 commits June 12, 2026 04:22
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix workflow failure on main for run #11644 Fix lint-go CGO failure by normalizing ResolveGhAwRef formatting and string construction Jun 12, 2026
Copilot AI requested a review from pelikhan June 12, 2026 04:35
@pelikhan pelikhan marked this pull request as ready for review June 12, 2026 13:48
Copilot AI review requested due to automatic review settings June 12, 2026 13:49
@pelikhan pelikhan merged commit dd9c75b into main Jun 12, 2026
1 check passed
@pelikhan pelikhan deleted the copilot/cgo-fix-workflow-failure branch June 12, 2026 13:49

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.

Pull request overview

This pull request primarily addresses a lint-go CGO CI failure by eliminating a perfsprint-triggering fmt.Sprintf and re-normalizing formatting in ResolveGhAwRef (pkg/workflow/action_resolver.go). It also updates a compiled smoke-test workflow to use $HOME-based Copilot config paths and adjusts related environment variable setup.

Changes:

  • Replaced fmt.Sprintf with direct string concatenation for the GitHub commits API path in ResolveGhAwRef.
  • Normalized the surrounding Go block formatting without changing error semantics.
  • Updated .github/workflows/smoke-copilot-aoai-entra.lock.yml to use $HOME/.copilot paths and moved XDG_CONFIG_HOME / GH_AW_MCP_CONFIG setup into the run: script.
Show a summary per file
File Description
pkg/workflow/action_resolver.go Avoids perfsprint lint by removing fmt.Sprintf for the commits API path and normalizes formatting in ResolveGhAwRef.
.github/workflows/smoke-copilot-aoai-entra.lock.yml Switches Copilot config paths from /home/runner to $HOME and adjusts config-related environment setup in the workflow.

Copilot's findings

Tip

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

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

Comment on lines +1852 to +1856
trap 'rm -f "$HOME/.copilot/settings.json"' EXIT
mkdir -p "$HOME/.copilot"
printf '%s' '{"builtInAgents":{"rubberDuck":false}}' > "$HOME/.copilot/settings.json"
export XDG_CONFIG_HOME="$HOME"
export GH_AW_MCP_CONFIG="$HOME/.copilot/mcp-config.json"
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.

3 participants