Skip to content

ci: migrate golangci to v2 schema and correct issues #259

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sebrandon1
Copy link
Member

@sebrandon1 sebrandon1 commented Mar 31, 2025

Similar to other v2 migrations:

There were a number of things that the latest version of golangci-lint flagged for fixing.

Also, I added a .github/workflows/pre-main.yaml that contains a job to run the linter prior to merging PRs.

@openshift-ci openshift-ci bot requested review from deads2k and TrilokGeer March 31, 2025 19:55
Copy link
Contributor

openshift-ci bot commented Mar 31, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: sebrandon1
Once this PR has been reviewed and has the lgtm label, please assign deads2k for approval. For more information see the Code Review Process.

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

Needs approval from an approver in each of these files:

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

Copy link
Contributor

openshift-ci bot commented Mar 31, 2025

Hi @sebrandon1. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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-ci openshift-ci bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Mar 31, 2025
@sebrandon1
Copy link
Member Author

It seems like Actions aren't enabled on this repository. Is that something that can be enabled by an admin?

@sebrandon1
Copy link
Member Author

/ok-to-test

@openshift-ci openshift-ci bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 24, 2025
Copy link
Member

@swghosh swghosh left a comment

Choose a reason for hiding this comment

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

Like the idea of linting our codebase,
but we cannot use GitHub actions immediately.

@@ -0,0 +1,27 @@
name: Test Incoming Changes
Copy link
Member

Choose a reason for hiding this comment

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

We could add a make target in this repository that runs the linter with the proposed .golangci.yaml config.

Copy link
Member

Choose a reason for hiding this comment

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

And, add a new linter test onto our CI configs, feel free to raise PRs on o/release for this.

That way we do not need to introduce extraneous GitHub Actions (and end up paying for runners).

Copy link
Member Author

Choose a reason for hiding this comment

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

This PR uses ubuntu-latest runners which are the free tier, no billing plan required.

https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories

As for the make target, I agree we could also add that. The action golangci/golangci-lint-action@v7 automatically detects the .golangci.yml and uses those settings and manages the installation and running of the linter for us.

Copy link
Contributor

openshift-ci bot commented Apr 30, 2025

@sebrandon1: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-operator 423bb1e link true /test e2e-operator
ci/prow/e2e-operator-tech-preview 423bb1e link false /test e2e-operator-tech-preview

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-test Indicates a non-member PR verified by an org member that is safe to test.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants