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

Resolve lint errors causing CI to break #87

Merged
merged 1 commit into from
Aug 13, 2023

Conversation

tzifudzi
Copy link
Contributor

@tzifudzi tzifudzi commented Aug 13, 2023

What type of PR is this?

Cleanup

What this PR does / why we need it:

It resolves lint errors causing new PRs to fail lint checks.

Changes are

  • making minor changes to resolve lint errors e.g. unnecessary use of fmt.Sprintf
  • removing linters which are no longer actively maintained
  • disabling depguard as a linter

See additinoal info section for more regarding why the below changes were made

Which issue(s) this PR fixes:

#78

Additional info

Lint errors are failing with the following errors. See example failing Github Actions in PR #81

pkg/testcases/context_test.go:22:2: import 'sigs.k8s.io/windows-operational-readiness/pkg/flags' is not allowed from list 'Main' (depguard)
        "sigs.k8s.io/windows-operational-readiness/pkg/flags"

To resolve the above errors, I disabled depguard because it has a known breaking issue. See golangci/golangci-lint#3906 fore more. For the meantime, we will simply remove the dependency until the issue is resolved. In summary, lint checks are failing because depguard used to allow all dependencies by default, but its v2 release inverts that logic to deny by default. We do not have control over the allow list because it is abstracted by golangci-lint

Other changes include removing linters which are no longer actively maintained

WARN [runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused. 
WARN [runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused. 
WARN [runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused. 
WARN [runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. 

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: tzifudzi
Once this PR has been reviewed and has the lgtm label, please assign jsturtevant for approval. For more information see the Kubernetes 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

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 13, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @tzifudzi. Thanks for your PR.

I'm waiting for a kubernetes-sigs 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-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 13, 2023
@knabben knabben merged commit 5075a31 into kubernetes-sigs:main Aug 13, 2023
@tzifudzi tzifudzi mentioned this pull request Sep 5, 2023
@tzifudzi tzifudzi mentioned this pull request Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants