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

Hygiene: enabled presets and various linters. #6518

Merged
merged 1 commit into from
Apr 21, 2023

Conversation

bendory
Copy link
Contributor

@bendory bendory commented Apr 10, 2023

Changes

Context: #5899
There are no expected functional changes in this PR.

Explicitly enabled:

  • maintidx
  • makezero
  • mustag
  • nakedret
  • nilerr
  • nilnil
  • noctx
  • nolintlint
  • nosprintfhostport

Implicitly enabled: all other default linters in the presets.

  • fixed presets configuration, which wasn't formated properly and did not in fact activate the presets
  • explicitly disabled some linters (enabled by presets) that highlight too many issues to resolve in this PR
  • fixed host-port issues identified by nosprintfhostport
  • removed defunct nolint:revive pragmas
  • fixed format of //nolint directives in conformance with nolintlint
  • added needed //nolint directives.

Note: hub resolver now passes context.Context through to http GET call. It is possible that, prior to this
change, the http GET would succeed despite a context timeout or cancellation; after this change, that call
would fail with a context timeout or cancellation error. I consider this a pathological condition and not a
functional change.

/kind cleanup

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • [N/A] Has Docs if any changes are user facing, including updates to minimum requirements e.g. Kubernetes version bumps
  • [N/A] Has Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including functionality, content, code)
  • Has a kind label. You can add one by adding a comment on this PR that contains /kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep
  • [N/A] Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings)
  • [N/A] Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

NONE

@tekton-robot tekton-robot added release-note-none Denotes a PR that doesnt merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 10, 2023
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/hub/resolver.go 77.2% 76.9% -0.3

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/hub/resolver.go 77.2% 76.9% -0.3

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/hub/resolver.go 77.2% 76.9% -0.3

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/hub/resolver.go 77.2% 76.9% -0.3

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/hub/resolver.go 77.2% 76.9% -0.3

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/hub/resolver.go 77.2% 76.9% -0.3

@bendory
Copy link
Contributor Author

bendory commented Apr 11, 2023

/hold
Annoying issues with linter versions and golangci-lint versioning.
My desktop has 1.52.2 where this configuration works, but our CI is using 1.50.1 where it doesn't. 👎
I may just abandon this; putting it on hold for now.

On hold at least until tektoncd/plumbing#1389 is merged + deployed to our CI.

@tekton-robot tekton-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 11, 2023
tekton-robot pushed a commit to tektoncd/plumbing that referenced this pull request Apr 12, 2023
This enables some new linters and disables some deprecated ones.

Context: tektoncd/pipeline#5899

This PR is step one in unblocking tektoncd/pipeline#6518

/kind cleanup
@tekton-robot tekton-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 13, 2023
@tekton-robot tekton-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 14, 2023
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/hub/resolver.go 77.2% 76.9% -0.3

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/hub/resolver.go 77.2% 76.9% -0.3

tekton-robot pushed a commit to tektoncd/plumbing that referenced this pull request Apr 18, 2023
This change will update our plumbing to include
#1389
as well as any other changes since the last upgrade.

Context: tektoncd/pipeline#6518
Issue: tektoncd/pipeline#5899

/kind cleanup
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/hub/resolver.go 77.2% 76.9% -0.3

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/hub/resolver.go 77.2% 76.9% -0.3

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/hub/resolver.go 77.2% 76.9% -0.3

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/hub/resolver.go 77.2% 76.9% -0.3

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/hub/resolver.go 77.2% 76.9% -0.3

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/hub/resolver.go 77.2% 76.9% -0.3

@bendory
Copy link
Contributor Author

bendory commented Apr 20, 2023

/unhold

@tekton-robot tekton-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 20, 2023
Copy link
Member

@imjasonh imjasonh left a comment

Choose a reason for hiding this comment

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

None of these comments are blocking.

/lgtm

.golangci.yml Show resolved Hide resolved
pkg/apis/config/feature_flags.go Show resolved Hide resolved
@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 20, 2023
@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Apr 20, 2023
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/hub/resolver.go 77.2% 76.9% -0.3

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/hub/resolver.go 77.2% 76.9% -0.3

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/hub/resolver.go 77.2% 76.9% -0.3

@imjasonh
Copy link
Member

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 20, 2023
test/step_output_test.go Outdated Show resolved Hide resolved
test/step_output_test.go Outdated Show resolved Hide resolved
Explicitly enabled:
- maintidx
- makezero
- mustag
- nakedret
- nilerr
- nilnil
- noctx
- nolintlint
- nosprintfhostport

Implicitly enabled: all other default linters in the presets.

- increased timeout from 10m --> 20m to allow time for additional tests
- fixed `presets` configuration, which wasn't formated properly and
  did not in fact activate the presets
- explicitly disabled some linters (enabled by `presets`) that highlight
  too many issues to resolve in this PR
- fixed host-port issues identified by `nosprintfhostport`
- fixed issues in step_output_test.go found by `exportloopref`
- removed defunct `nolint:revive` pragmas
- fixed format of `//nolint` directives in conformance with `nolintlint`
- added needed `//nolint` directives.
@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Apr 20, 2023
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/hub/resolver.go 77.2% 76.9% -0.3

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/hub/resolver.go 77.2% 76.9% -0.3

@jerop
Copy link
Member

jerop commented Apr 20, 2023

/retest

@imjasonh
Copy link
Member

/approve

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: imjasonh

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

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 20, 2023
Copy link
Member

@afrittoli afrittoli left a comment

Choose a reason for hiding this comment

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

Thank you @bendory !
/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 21, 2023
@tekton-robot tekton-robot merged commit 7b8bab4 into tektoncd:main Apr 21, 2023
2 checks passed
@bendory bendory deleted the nolintlint branch April 21, 2023 12:12
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. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesnt merit a release note. 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.

None yet

5 participants