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 lint for aliasing autoscaling import correctly #10885

Merged
merged 1 commit into from Mar 22, 2021

Conversation

julz
Copy link
Member

@julz julz commented Mar 4, 2021

Someone very kindly did the work to add the linter I hacked up for funsies when I fixed these before to golanglint-ci, so we might as well use it!

Also, fix up a package that I apparently forgot to git add when I fixed these before, and never spotted because we didn't lint it :).

/hold I think I'll need to bump the golanglint-ci version in knative/.github before this will work

/assign @markusthoemmes

@knative-prow-robot knative-prow-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 4, 2021
@google-cla google-cla bot added the cla: yes Indicates the PR's author has signed the CLA. label Mar 4, 2021
@knative-prow-robot knative-prow-robot added area/API API objects and controllers size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 4, 2021
@codecov
Copy link

codecov bot commented Mar 4, 2021

Codecov Report

Merging #10885 (1561a25) into main (05f16c6) will decrease coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #10885      +/-   ##
==========================================
- Coverage   87.99%   87.95%   -0.05%     
==========================================
  Files         188      188              
  Lines        9113     9113              
==========================================
- Hits         8019     8015       -4     
- Misses        839      842       +3     
- Partials      255      256       +1     
Impacted Files Coverage Δ
pkg/apis/serving/v1/revision_lifecycle.go 92.72% <100.00%> (ø)
pkg/reconciler/revision/reconcile_resources.go 80.95% <0.00%> (-2.39%) ⬇️
pkg/activator/net/revision_backends.go 90.41% <0.00%> (-0.92%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 05f16c6...1561a25. Read the comment docs.

Copy link
Contributor

@markusthoemmes markusthoemmes left a comment

Choose a reason for hiding this comment

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

Pretty cool!

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 4, 2021
julz added a commit to julz/.github that referenced this pull request Mar 4, 2021
To pick up importas linter for knative/serving#10885.
@vagababov
Copy link
Contributor

But I liked the short one?
Why make it longer everywhere, rather than the other way?

@julz
Copy link
Member Author

julz commented Mar 4, 2021

I don't actually care much (at all ;)) which alias we pick, so much as that we're consistent (it's easy to change the lint if we want a different import). I picked this alias in #10666 because it concatenates the final two bits of the path without the slash, which has at least some logic to it (and is consistent with how we generally import other things that clash, e.g. servingv1 etc).

@vagababov
Copy link
Contributor

autoscaling is loooong :) so let's pick the short one.
It is also internal construct, so less important to be super explicit. :)

@julz
Copy link
Member Author

julz commented Mar 4, 2021

If we do want to rename again, importas has a handy -fix mode that can do it automatically 😈, but I don't personally feel like I care enough (and there's at least some rationale for the concatenation)

Base automatically changed from master to main March 8, 2021 17:41
knative-prow-robot pushed a commit to knative-extensions/.github that referenced this pull request Mar 8, 2021
@julz
Copy link
Member Author

julz commented Mar 10, 2021

rebased, hopefully this should run nicely now golangci-lint version is bumped 🤞

@markusthoemmes
Copy link
Contributor

This needs another rebase now and some workaround for the misspell issue :(

And fix a file that I apparently forgot to `git add` when I fixed this
before, and never spotted because we didn't lint it :).
@julz
Copy link
Member Author

julz commented Mar 22, 2021

lets try this again

@julz
Copy link
Member Author

julz commented Mar 22, 2021

\o/ think everything has now trickled through and this is mergable!

/unhold

@knative-prow-robot knative-prow-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 22, 2021
Copy link
Contributor

@markusthoemmes markusthoemmes left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 22, 2021
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: markusthoemmes

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

@knative-prow-robot knative-prow-robot merged commit 60a7f99 into knative:main Mar 22, 2021
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. area/API API objects and controllers cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants