Skip to content

[WIP] Fix failing GitHub Actions job by updating golangci-lint version#12

Merged
chatterjee-sid merged 1 commit into
mainfrom
copilot/update-golangci-lint-version
Apr 22, 2026
Merged

[WIP] Fix failing GitHub Actions job by updating golangci-lint version#12
chatterjee-sid merged 1 commit into
mainfrom
copilot/update-golangci-lint-version

Conversation

Copilot AI commented Apr 22, 2026

Copy link
Copy Markdown
Contributor
  • Inspect failing GitHub Actions lint job logs and confirm root cause
  • Review current .github/workflows/ci.yml lint job steps and module coverage
  • Update lint workflow to use a Go 1.22-compatible golangci-lint version while keeping Go 1.22
  • Add golangci-lint version output in the lint job for debugging
  • Validate workflow logic still runs lint for payflow/monitor, payflow/chaos, and payflow/tests
  • Run relevant repository checks locally to ensure no regressions
  • Run parallel validation and address any actionable findings
Original prompt

Please fix the failing GitHub Actions job (Lint) in this repository by updating the workflow to use a golangci-lint version compatible with Go 1.22.x.

Context:

  • Repo: MananVelani/payflow
  • Failing job: 72529378065
  • Workflow file: .github/workflows/ci.yml
  • Failure message:
    • "Can't run linter goanalysis_metalinter: buildir: failed to load package goarch: could not load export data: internal error in importing "internal/goarch" (unsupported version: 2)"
  • Current workflow installs golangci-lint v1.57.2 via install.sh, while actions/setup-go installs Go 1.22.x.

Task requirements:

  1. Update .github/workflows/ci.yml to install a newer golangci-lint version that supports Go 1.22.x (either via the official golangci-lint action or by bumping the version in install.sh).
  2. Keep Go version at 1.22.
  3. Ensure the lint job still runs for modules:
    • payflow/monitor
    • payflow/chaos
    • payflow/tests
  4. Add a golangci-lint version print to aid debugging.
  5. Open a pull request targeting the main branch.

Reference PR to update: #11

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: Please find a solution for failing job 72529378065. Use the logs, job definition, and any referenced files where the failure occurred. Keep your response focused on the solution and include code suggestions when appropriate.

Assistant: The failing job is the Lint job in PayFlow CI at ref 1454d05dea0f261d1d83a0e33612b0647669081e. It fails while running golangci-lint with:

can't run linter goanalysis_metalinter ... internal error in importing "internal/goarch" (unsupported version: 2)

This is a version mismatch: actions/setup-go@v5 installs Go 1.22.12, but the workflow installs golangci-lint v1.57.2, which is too old to analyze packages compiled with newer Go export formats. Fix: upgrade golangci-lint (preferred), or downgrade Go to a version supported by v1.57.2.

Recommended fix (upgrade golangci-lint)

Edit .github/workflows/ci.yml at ref 1454d05... and change the install step from v1.57.2 to a recent version that supports Go 1.22+.

Current (fails):

- name: Install golangci-lint
  run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.57.2

Replace with (example: v1.64.8):

- name: Install golangci-lint
  run: |
    curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh \
      | sh -s -- -b "$(go env GOPATH)/bin" v1.64.8
    golangci-lint version

This resolves the goanalysis_metalinter / unsupported version crash on Go 1.22.

Optional improvement (more stable install)

Instead of the curl script, you can use the maintained action:

- name: Install golangci-lint
  uses: golangci/golangci-lint-action@v6
  with:
    version: v1.64.8
    args: --timeout=5m

Then in your lint steps, just run golangci-lint run ./... as you already do.

Alternative fix (if you must keep v1.57.2)

Pin Go to an older version that v1.57.2 supports (not recommended long-term), e.g.:

- name: Setup Go
  uses: actions/setup-go@v5
  with:
    go-version: '1.21'

Notes (non-fatal but worth fixing)

Your cache step warns: Dependencies file is not found ... Supported file pattern: go.sum because the cache key uses hashFiles('**/go.sum') at repo root, but the go.sum files are inside subdirectories and may not exist until after go mod tidy. This doesn’t fail the job; it just reduces cache effectiveness. If desired, run go mod download/go mod tidy before caching, or adjust caching per module directory.

Applying the golangci-lint upgrade should make job 72529378065 pass.

User: can you make the change yourself?

Assistant: I can, but I need you to approve the pending automated change request first—once you accept it, I’ll push the workflow update (upgrade golangci-lint to a Go 1.22–compatible version and add golangci-lint version) and open/update PR #11.

This pull request was created from Copilot chat.

@IAMonlyParthGandhi IAMonlyParthGandhi marked this pull request as ready for review April 22, 2026 15:06
Copilot AI review requested due to automatic review settings April 22, 2026 15:06

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.

Copilot wasn't able to review any files in this pull request.


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

@chatterjee-sid chatterjee-sid merged commit 32c11e2 into main Apr 22, 2026
1 check failed
Copilot stopped work on behalf of IAMonlyParthGandhi due to an error April 22, 2026 15:09
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.

4 participants