-
Notifications
You must be signed in to change notification settings - Fork 263
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
change display versions #1601
change display versions #1601
Conversation
Welcome @kobayashi! It looks like this is your first PR to knative/client 🎉 |
Hi @kobayashi. Thanks for your PR. I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the 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. |
/ok-to-test |
hack/build-flags.sh
Outdated
version_eventing=$(grep "knative.dev/eventing " "${base}/go.mod" \ | ||
| sed -s 's/.* \(v.[\.0-9]*\).*/\1/') | ||
|
||
if [[ "${patch}" -ne 0 ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic below would imply that for a version 1.2.0
you get a serving and eventing version 0.29.0
, while for 1.2.1
you get 1.2.1
for eventing and serving (regardless of what the actual versions of eventing and serving are). This is not as it should work.
Instead, the algorithm should work like this:
$version
is${TAG}
- For the serving version:
- Take
major.minor
from${version}
(via e.g.cut -f1-2 -d.
) - Take
patch
from the serving dependency in go.mod (e.g.echo $version_serving | cut -f3 -d.
with$version_serving
being the full version extracted from go.mod ad it is now) - Combine all of them to calculate the serving version (
major.minor
from${version}
+.patch
from the go.mod dependency.
- Take
Same for eventing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally, I'd prefer the logic to be executed withing version
cmd. Keep providing go module version and transform it into 1.y.z
.
https://github.com/knative/client/blob/main/pkg/kn/commands/version/version.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update. IMO it's fine to keep it in the script for now, given it's already very close to done.
@rhuss can you pls check the changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kobayashi sorry for the delay. I have tested the changes locally and it produces desired results imo. Thanks for the fix!
Thanks for the PR ! I added some comment about the algorithm, I think it currently does not work as expected. |
Codecov Report
@@ Coverage Diff @@
## main #1601 +/- ##
=======================================
Coverage 79.79% 79.79%
=======================================
Files 163 163
Lines 8820 8820
=======================================
Hits 7038 7038
Misses 1089 1089
Partials 693 693 Continue to review full report at Codecov.
|
71b6352
to
2ffeba4
Compare
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dsimansk, kobayashi 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 |
Co-authored-by: kobayashi <[email protected]>
Fix for file not found error message discrepancy in windows (knative#1575) (#967) Co-authored-by: Gunjan Vyas <[email protected]> change display versions (knative#1601) (#985) Co-authored-by: kobayashi <[email protected]>
Description
Change display versions for Serving and Eventing for major/minor updates.
Changes
hack/build-flags.sh
to check patch number to Serving and Eventing versionsReference
Fixes #1542