Skip to content

[release-1.37] Fix validate workflow: Update to Node 24 and remove GOPATH structure - #4168

Merged
openshift-merge-bot[bot] merged 7 commits into
openshift-knative:release-1.37from
Kaustubh-pande:fix-lint-wf
Sep 16, 2026
Merged

openshift-merge-bot[bot] merged 7 commits into
openshift-knative:release-1.37from
Kaustubh-pande:fix-lint-wf

Conversation

@Kaustubh-pande

Copy link
Copy Markdown
Contributor

Fixes the Lint job in the validate workflow that was failing due to Node 20 deprecation and GOPATH-based directory structure issues.

Problems

  1. Node 20 Deprecation
    Node 20 is being deprecated. This workflow is running with Node 24 by default.
  • golangci-lint-action@v6 uses deprecated Node 20
  • prettier_action@v4.3 uses deprecated Node 20
  1. GOPATH Directory Structure
    Running in: /home/runner/work/.../src/github.com/openshift-knative/serverless-operator
    Error: golangci-lint couldn't find go.mod
  • Workflow set GOPATH: ${{ github.workspace }}
  • Checked out code to ./src/github.com/${{ github.repository }}
  • Modern Go modules don't need GOPATH structure
  • golangci-lint-action couldn't locate go.mod

Changes

✅ Node 24 Compatibility

Action Before After Reason
golangci-lint-action v6 v9 Node 24 support
prettier_action v4.3 v4.6 Node 24 support

✅ Modern Go Module Structure

Removed:

  • env.GOPATH: ${{ github.workspace }} - Not needed for Go modules
  • checkout.path: ./src/github.com/${{ github.repository }} - Nested path caused issues
  • All working-directory overrides in lint steps

Updated:

  • Checkout now goes directly to workspace root
  • All lint commands run from workspace root
  • prettier path: src/.../templates/*.yamltemplates/*.yaml

Detailed Changes

Before (GOPATH structure):

lint:
  runs-on: ubuntu-latest
  env:
 GOPATH: ${{ github.workspace }}
  steps:
 - name: Checkout
   uses: actions/checkout@v4
   with:
     path: ./src/github.com/${{ github.repository }}

 - name: Go Lint
   uses: golangci/golangci-lint-action@v6
   with:
     working-directory: ./src/github.com/${{ github.repository }}

Result: golangci-lint runs in /home/runner/work/serverless-operator/serverless-operator/src/github.com/openshift-knative/serverless-operator ❌

After (Module structure):

lint:
  runs-on: ubuntu-latest
  steps:
    - name: Checkout
      uses: actions/checkout@v4

    - name: Go Lint
      uses: golangci/golangci-lint-action@v9

Result: golangci-lint runs in /home/runner/work/serverless-operator/serverless-operator ✅

Related Issues

Resolves the lint failure in:
- https://github.com/openshift-knative/serverless-operator/actions/runs/34962067664/job/104357735799

…_action to v4.6 for Node 24 support, remove GOPATH and nested checkout paths
@openshift-ci
openshift-ci Bot requested review from aliok and creydr September 15, 2026 14:46
Fixes:
- Run Checkout before Setup Golang so go.mod exists for caching
- Remove GOPATH and nested ./src/github.com/... path structure
- Force golangci-lint-action@v6 to use Node 24 (avoid deprecation)
- Update prettier_action v4.3 → v4.6 (Node 24 support)
- Remove all working-directory overrides

The critical fix is step ordering: setup-go needs go.mod to exist
before it runs, which requires checkout to happen first.
Comment thread .github/workflows/validate.yaml Outdated
Comment thread .github/workflows/validate.yaml Outdated
Comment thread .github/workflows/validate.yaml Outdated
ACTIONS_RUNNER_FORCE_ACTIONS_NODE_VERSION: node24
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
with:
version: v1.64.8

@dsimansk dsimansk Sep 15, 2026

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.

Suggested change
version: v1.64.8
version: v2.11.4
only-new-issues: true

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, I tried all possible approaches yesterday, but no luck with v2 or the latest version, so I reverted to the previous version. Today, I’ll try a different approach with v2. There are quite a few breaking changes, and the setup needs to be updated accordingly. Let me try.

Comment thread .github/workflows/validate.yaml Outdated
@@ -182,16 +176,17 @@ jobs:

- name: Go Lint - knative-operator
uses: golangci/golangci-lint-action@v6

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.

Suggested change
uses: golangci/golangci-lint-action@v6
uses: golangci/golangci-lint-action@v9

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I have tried this too in any of commit but it still failed and looks like need to change approach little bit. let me try to fix that.

@Kaustubh-pande

Copy link
Copy Markdown
Contributor Author

@dsimansk Looks like this works, but the scan found 37 issues. It seems that v2 is stricter than v1.

https://github.com/openshift-knative/serverless-operator/actions/runs/35051701089/job/104653278982?pr=4168

…PORARY: Exclude 37 linter warnings found during v2.13.2 upgrade
@Kaustubh-pande

Copy link
Copy Markdown
Contributor Author

TEMPORARY: Exclude all above 37 linter warnings found during v2.13.2 upgrade.
TODO: Remove these exclusions once all issues are addressed.

Reference CI run with findings:
https://github.com/openshift-knative/serverless-operator/actions/runs/35051701089/job/104653278982?pr=4168

Excluded warnings breakdown:

  • gosec: 8 issues (G304, G101, G104)
  • prealloc: 6 issues (slice preallocation suggestions)
  • staticcheck: 13 issues (QF1008, QF1001 refactoring suggestions)
  • revive: 10 issues (package-comments, exported comment format)

These are legitimate code quality findings from upgraded linters,
but temporarily excluded to unblock CI while issues are addressed
in separate PRs.

@dsimansk

Copy link
Copy Markdown
Contributor

/approve
/lgtm

@openshift-ci

openshift-ci Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dsimansk, Kaustubh-pande

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [Kaustubh-pande,dsimansk]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Kaustubh-pande

Copy link
Copy Markdown
Contributor Author

/override ci/prow/420-kitchensink-upgrade ci/prow/421-kitchensink-e2e ci/prow/421-mesh-e2e ci/prow/421-mesh-upgrade ci/prow/421-operator-e2e ci/prow/421-test-upgrade ci/prow/421-upstream-e2e ci/prow/421-upstream-e2e-kafka

@openshift-ci

openshift-ci Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

@Kaustubh-pande: Overrode contexts on behalf of Kaustubh-pande: ci/prow/420-kitchensink-upgrade, ci/prow/421-kitchensink-e2e, ci/prow/421-mesh-e2e, ci/prow/421-mesh-upgrade, ci/prow/421-operator-e2e, ci/prow/421-test-upgrade, ci/prow/421-upstream-e2e, ci/prow/421-upstream-e2e-kafka

Details

In response to this:

/override ci/prow/420-kitchensink-upgrade ci/prow/421-kitchensink-e2e ci/prow/421-mesh-e2e ci/prow/421-mesh-upgrade ci/prow/421-operator-e2e ci/prow/421-test-upgrade ci/prow/421-upstream-e2e ci/prow/421-upstream-e2e-kafka

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-merge-bot
openshift-merge-bot Bot merged commit d7716c0 into openshift-knative:release-1.37 Sep 16, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants