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 an update timestamp to trigger the creation of a revision when needed. #1364

Merged
merged 9 commits into from
Jul 26, 2021

Conversation

rhuss
Copy link
Contributor

@rhuss rhuss commented Jul 5, 2021

Add an update timestamp anytime a new revision should be triggered. Previously client-side revision names were this trigger but since we switched to server-side revision naming by default that didn't work anymore (and hasn't worked with server-side revision naming before, too).

Fixes #1318.

/lint

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 5, 2021
@google-cla google-cla bot added the cla: yes Indicates the PR's author has signed the CLA. label Jul 5, 2021
Copy link
Contributor

@knative-prow-robot knative-prow-robot left a comment

Choose a reason for hiding this comment

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

@rhuss: 3 warnings.

In response to this:

Add an update timestamp anytime a new revision should be triggered. Previously client-side revision names were this trigger but since we switched to server-side revision naming by default that didn't work anymore (and hasn't worked with server-side revision naming before, too).

Fixes #1318.

/lint

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.

@@ -41,8 +41,9 @@ const (
)

var (
UserImageAnnotationKey = "client.knative.dev/user-image"
ApiTooOldError = errors.New("the service is using too old of an API format for the operation")
UserImageAnnotationKey = "client.knative.dev/user-image"
Copy link
Contributor

Choose a reason for hiding this comment

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

Golint comments: exported var UserImageAnnotationKey should have comment or be unexported. More info.

pkg/serving/config_changes.go Outdated Show resolved Hide resolved
pkg/serving/config_changes.go Show resolved Hide resolved
@knative-prow-robot knative-prow-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 5, 2021
@codecov
Copy link

codecov bot commented Jul 5, 2021

Codecov Report

Merging #1364 (99661ff) into main (b05a111) will increase coverage by 0.09%.
The diff coverage is 81.15%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1364      +/-   ##
==========================================
+ Coverage   78.23%   78.33%   +0.09%     
==========================================
  Files         160      160              
  Lines        8246     8270      +24     
==========================================
+ Hits         6451     6478      +27     
+ Misses       1104     1103       -1     
+ Partials      691      689       -2     
Impacted Files Coverage Δ
pkg/kn/plugin/manager.go 83.95% <ø> (ø)
pkg/kn/commands/revision/describe.go 50.61% <50.00%> (ø)
pkg/serving/config_changes.go 89.85% <72.00%> (+5.10%) ⬆️
pkg/serving/revision_template.go 90.90% <88.23%> (-3.04%) ⬇️
...kg/kn/commands/service/configuration_edit_flags.go 77.91% <100.00%> (+0.27%) ⬆️
pkg/kn/commands/service/export.go 81.48% <100.00%> (+0.46%) ⬆️
pkg/kn/commands/service/update.go 80.59% <100.00%> (+0.29%) ⬆️
pkg/serving/v1/client.go 82.85% <100.00%> (+0.99%) ⬆️

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 b05a111...99661ff. Read the comment docs.

@knative-prow-robot knative-prow-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 14, 2021
@google-cla
Copy link

google-cla bot commented Jul 15, 2021

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added cla: no Indicates the PR's author has not signed the CLA. and removed cla: yes Indicates the PR's author has signed the CLA. labels Jul 15, 2021
@knative-prow-robot knative-prow-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jul 15, 2021
@google-cla
Copy link

google-cla bot commented Jul 15, 2021

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

1 similar comment
@google-cla
Copy link

google-cla bot commented Jul 16, 2021

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

…eviously client side revision names was this trigger but since we switched to server-side revision naming by default that didn't work anymore (and hasn't worked with server-side revision naming before, too).

Fixes knative#1318.
@google-cla google-cla bot added cla: yes Indicates the PR's author has signed the CLA. and removed cla: no Indicates the PR's author has not signed the CLA. labels Jul 16, 2021
@rhuss
Copy link
Contributor Author

rhuss commented Jul 19, 2021

/retest

@rhuss
Copy link
Contributor Author

rhuss commented Jul 19, 2021

/retest

@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 21, 2021
@knative-prow-robot knative-prow-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 21, 2021
@knative-prow-robot knative-prow-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 21, 2021
@rhuss
Copy link
Contributor Author

rhuss commented Jul 21, 2021

@dsimansk PTAL, added some tests and addressed the error return value issue.

@dsimansk
Copy link
Contributor

@rhuss looks good. However lint check isn't happy.

  Error: non-wrapping format verb for fmt.Errorf. Use `%w` to format errors (errorlint)
  Error: SA5011: possible nil pointer dereference (staticcheck)
  Error: SA5011(related information): this check suggests that the pointer can be nil (staticcheck)
  Error: SA5011: possible nil pointer dereference (staticcheck)
  Error: SA5011(related information): this check suggests that the pointer can be nil (staticcheck)
  Error: SA5011: possible nil pointer dereference (staticcheck)
  Error: SA5011(related information): this check suggests that the pointer can be nil (staticcheck)

@rhuss
Copy link
Contributor Author

rhuss commented Jul 23, 2021

@dsimansk thanks for the review. Really would love to catch those lint errors with our build script. Any idea ?

@dsimansk
Copy link
Contributor

dsimansk commented Jul 23, 2021

@dsimansk thanks for the review. Really would love to catch those lint errors with our build script. Any idea ?

Agreed, we should add it to the script. The initial run may take a bit longer ~20s, but then cache will speed subsequent runs up significantly. And it's a matter of executing:

golangci-lint run

@knative-metrics-robot
Copy link

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

File Old Coverage New Coverage Delta
pkg/kn/commands/service/configuration_edit_flags.go 85.0% 85.2% 0.2
pkg/kn/commands/service/export.go 87.6% 88.2% 0.6
pkg/kn/commands/service/update.go 86.7% 86.9% 0.2
pkg/serving/config_changes.go 92.1% 94.5% 2.5
pkg/serving/revision_template.go 97.0% 95.3% -1.6
pkg/serving/v1/client.go 90.7% 91.0% 0.3

@dsimansk
Copy link
Contributor

Thanks!

/approve
/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dsimansk, rhuss

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

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. cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

can no longer force a re-download of an image via "kn update" w/o extra stuff
4 participants