Skip to content
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

Add golangci github action and replace the deprecated golint #10187

Merged
merged 15 commits into from
Sep 6, 2023

Conversation

z1cheng
Copy link
Member

@z1cheng z1cheng commented Jul 6, 2023

What this PR does / why we need it:

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • CVE Report (Scanner found CVE and adding report)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation only

Which issue/s this PR fixes

fixes #10097

How Has This Been Tested?

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I've read the CONTRIBUTION guide
  • I have added unit and/or e2e tests to cover my changes.
  • All new and existing tests passed.

Signed-off-by: z1cheng <imchench@gmail.com>
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 6, 2023
@netlify
Copy link

netlify bot commented Jul 6, 2023

Deploy Preview for kubernetes-ingress-nginx canceled.

Name Link
🔨 Latest commit 48d8684
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-ingress-nginx/deploys/64f045e9a5d9500008dcae22

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jul 6, 2023
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If Ingress contributors determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels Jul 6, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @z1cheng. Thanks for your PR.

I'm waiting for a kubernetes 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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-priority size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 6, 2023
Signed-off-by: z1cheng <imchench@gmail.com>
.golangci.yml Show resolved Hide resolved
@z1cheng z1cheng marked this pull request as ready for review July 7, 2023 07:31
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 7, 2023
.golangci.yml Outdated Show resolved Hide resolved
Signed-off-by: z1cheng <imchench@gmail.com>
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 7, 2023
.golangci.yml Show resolved Hide resolved
@rikatz
Copy link
Contributor

rikatz commented Jul 9, 2023

/ok-to-test

Signed-off-by: z1cheng <imchench@gmail.com>
Copy link
Member

@cpanato cpanato left a comment

Choose a reason for hiding this comment

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

a few comments

.github/workflows/golangci-lint.yml Outdated Show resolved Hide resolved
.github/workflows/golangci-lint.yml Outdated Show resolved Hide resolved
.github/workflows/golangci-lint.yml Outdated Show resolved Hide resolved
hack/verify-golint.sh Outdated Show resolved Hide resolved
Signed-off-by: z1cheng <imchench@gmail.com>
Signed-off-by: z1cheng <imchench@gmail.com>
Signed-off-by: z1cheng <imchench@gmail.com>
Signed-off-by: z1cheng <imchench@gmail.com>
@z1cheng z1cheng requested a review from cpanato July 11, 2023 12:37
@cpanato
Copy link
Member

cpanato commented Jul 11, 2023

@z1cheng now you have to fix the lints 😄

@cpanato
Copy link
Member

cpanato commented Jul 11, 2023

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 11, 2023
@tao12345666333
Copy link
Member

I think we should also keep a makefile entry to run golang-ci locally.

@z1cheng
Copy link
Member Author

z1cheng commented Jul 11, 2023

@tao12345666333 Now only static-check entry in makefile runs hack/verify-all.sh in a container:

https://github.com/kubernetes/ingress-nginx/blob/5b35651a1a40f5506d06540c1fcd103dc41a16d5/Makefile#L125C1-L129C21

I can add golint entry in makefile if necessary.

Signed-off-by: Chen Chen <imchench@gmail.com>
Signed-off-by: Chen Chen <imchench@gmail.com>
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 24, 2023
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 31, 2023
@z1cheng
Copy link
Member Author

z1cheng commented Aug 31, 2023

This PR can be merged, since the lint errors has been fixed and it passed all checks :)

cc @rikatz @cpanato @tao12345666333

Copy link
Member

@cpanato cpanato left a comment

Choose a reason for hiding this comment

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

/approve

/assign @rikatz

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 31, 2023
@rikatz
Copy link
Contributor

rikatz commented Sep 6, 2023

/lgtm
/hold cancel
Thank you!

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Sep 6, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cpanato, rikatz, z1cheng

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

The pull request process is described 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

@k8s-ci-robot k8s-ci-robot merged commit 8a6af60 into kubernetes:main Sep 6, 2023
44 checks passed
@z1cheng z1cheng deleted the add_golangci_action branch September 8, 2023 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-priority needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Run golangci-lint on project, fix and implement gh actions
6 participants