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

Update golangci-lint and add golangci-lint GitHub workflow #5158

Merged
merged 1 commit into from
Oct 4, 2024

Conversation

nawazkh
Copy link
Member

@nawazkh nawazkh commented Oct 3, 2024

What type of PR is this?
/kind cleanup

What this PR does / why we need it:

  • This PR updates golangci-lint to 1.60.2
  • Adds pr-golangci-lint job to the repo.
  • Removes golangci-lint from make test target so that make test solely focuses on test coverage and not on linter signal.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #5110

Special notes for your reviewer:

  • cherry-pick candidate

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests

Release note:

Update Golangci-lint to v1.60.2 and add golangci-lint PR GitHub workflow

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Oct 3, 2024
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 3, 2024
Copy link

codecov bot commented Oct 3, 2024

Codecov Report

Attention: Patch coverage is 50.71429% with 69 lines in your changes missing coverage. Please review.

Project coverage is 51.34%. Comparing base (553cd0f) to head (97b2c12).
Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
exp/controllers/helpers.go 46.15% 6 Missing and 1 partial ⚠️
api/v1alpha1/azureasomanagedcluster_webhook.go 0.00% 3 Missing ⚠️
...pi/v1alpha1/azureasomanagedcontrolplane_webhook.go 0.00% 3 Missing ⚠️
api/v1alpha1/azureasomanagedmachinepool_webhook.go 0.00% 3 Missing ⚠️
azure/services/privatedns/record_client.go 0.00% 3 Missing ⚠️
internal/test/record/logger.go 0.00% 2 Missing and 1 partial ⚠️
...1beta1/azuremanagedcontrolplanetemplate_webhook.go 50.00% 2 Missing ⚠️
...v1beta1/azuremanagedmachinepooltemplate_webhook.go 50.00% 2 Missing ⚠️
azure/scope/machinepool.go 33.33% 2 Missing ⚠️
azure/services/availabilitysets/client.go 0.00% 2 Missing ⚠️
... and 37 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5158      +/-   ##
==========================================
- Coverage   51.36%   51.34%   -0.02%     
==========================================
  Files         273      273              
  Lines       24676    24671       -5     
==========================================
- Hits        12674    12668       -6     
- Misses      11212    11214       +2     
+ Partials      790      789       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 3, 2024
@nawazkh
Copy link
Member Author

nawazkh commented Oct 3, 2024

linter is green locally, waiting for the tests to be green.

@nawazkh
Copy link
Member Author

nawazkh commented Oct 3, 2024

pull-cluster-api-provider-azure-load-test-custom-builds test job complains the below

./scripts/../scripts/ci-build-azure-ccm.sh: line 48: pushd: /home/prow/go/src/sigs.k8s.io/cloud-provider-azure: No such file or directory
Image registry is capzcicommunity.azurecr.io
./scripts/../scripts/ci-build-azure-ccm.sh: line 52: IMAGE_TAG_CCM: unbound variable

IMAGE_TAG_CCM gets defaulted at line 48

pushd "${AZURE_CLOUD_PROVIDER_ROOT}" && IMAGE_TAG=$(git rev-parse --short=7 HEAD) &&
IMAGE_TAG_CCM="${IMAGE_TAG_CCM:-${IMAGE_TAG}}" && IMAGE_TAG_CNM="${IMAGE_TAG_CNM:-${IMAGE_TAG}}" &&
export IMAGE_TAG_CCM && export IMAGE_TAG_CNM && popd
, so this error doesn't seem to be the root cause.

Did something change at prow that is keeping AZURE_CLOUD_PROVIDER_ROOT empty ?
Is this /home/prow/go/src/sigs.k8s.io/cloud-provider-azure supposed to exist at prow?

@nawazkh nawazkh force-pushed the update_golang_ci_2 branch from eccb3e5 to 1efc2d6 Compare October 3, 2024 21:33
@nawazkh
Copy link
Member Author

nawazkh commented Oct 3, 2024

Message: The storage account named capzcioidcissuer12063 is already taken. for pull-cluster-api-provider-azure-e2e-aks :/

/test pull-cluster-api-provider-azure-e2e-aks

@nawazkh

This comment was marked as resolved.

@nawazkh nawazkh mentioned this pull request Oct 3, 2024
4 tasks
@nawazkh
Copy link
Member Author

nawazkh commented Oct 3, 2024

/test pull-cluster-api-provider-azure-conformance-ipv6-with-ci-artifacts

@nawazkh
Copy link
Member Author

nawazkh commented Oct 4, 2024

/test pull-cluster-api-provider-azure-e2e

@nawazkh nawazkh changed the title [WIP] Update golangci-lint and add golangci-lint GitHub workflow Update golangci-lint and add golangci-lint GitHub workflow Oct 4, 2024
@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 Oct 4, 2024
@nawazkh
Copy link
Member Author

nawazkh commented Oct 4, 2024

hold for squash
/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 Oct 4, 2024
Adds
- pr-golangci-lint job
- exports GO_VERSION in the makefile that is used in other make targets
- updates .golangci.yml with CAPI changes, and also rebases CAPZ additions to it.
- update .golangci.yml
- ignore package comments across CAPZ
@nawazkh nawazkh force-pushed the update_golang_ci_2 branch from bd3500a to 97b2c12 Compare October 4, 2024 20:27
@nawazkh
Copy link
Member Author

nawazkh commented Oct 4, 2024

squashed all the commits.
/unhold

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 4, 2024
@k8s-ci-robot
Copy link
Contributor

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

Test name Commit Details Required Rerun command
pull-cluster-api-provider-azure-load-test-custom-builds 97b2c12 link false /test pull-cluster-api-provider-azure-load-test-custom-builds

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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.

@Jont828
Copy link
Contributor

Jont828 commented Oct 4, 2024

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 4, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 03f914c797ea53c9e1e0ca38c5100572cef38615

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Jont828

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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 4, 2024
@k8s-ci-robot k8s-ci-robot merged commit 4fec820 into kubernetes-sigs:main Oct 4, 2024
27 of 31 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.18 milestone Oct 4, 2024
@nawazkh nawazkh deleted the update_golang_ci_2 branch October 4, 2024 22:29
@nojnhuh nojnhuh mentioned this pull request Nov 4, 2024
4 tasks
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. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Bump golangci-lint to v1.60.2
3 participants