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

Fixes Hub version to latest in Makefile #788

Merged
merged 1 commit into from
Jun 17, 2022

Conversation

PuneetPunamiya
Copy link
Member

Initially, Hub version was hard coded in makefile to fetch
the specific version and after each release to get the latest
version we had to update the version in the Makefile

Hence this patch fixes the version to latest where in the script
it fetches the latest Hub version

Signed-off-by: Puneet Punamiya [email protected]

Changes

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

See the contribution guide for more details.

Release Notes

@tekton-robot tekton-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label May 16, 2022
@tekton-robot tekton-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label May 16, 2022
@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 16, 2022
@nikhil-thomas
Copy link
Member

nikhil-thomas commented May 16, 2022

/hold

this jq -r could get us into a tricky situation.

This patch will get chronologically latest version of hub, not the semver latest.

ie
if we publish

  • 1.7.0 today
  • 1.8.0 tomorrow
  • 1.7.1 day after tomorrow.

on day after tomorrow this patch will return 1.7.1 (chronological latest)

hence i had to use sort -V in here (-V for version aware sort)

@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 May 16, 2022
@nikhil-thomas
Copy link
Member

/hold

this jq -r could get us into a tricky situation.

This patch will get chronologically latest version of hub, not the semver latest.

ie if we publish

  • 1.7.0 today
  • 1.8.0 tomorrow
  • 1.7.1 day after tomorrow.

on day after tomorrow this patch will return 1.7.1 (chronological latest)

hence i had to use sort -V in here (-V for version aware sort)

for example

$ curl -sL https://api.github.com/repos/tektoncd/pipeline/releases | jq -r ".[].tag_name"                                                                                                                                                        255 ↵
v0.35.1
v0.35.0
v0.34.1
v0.34.0
v0.32.4
v0.32.3
v0.31.4
v0.31.3
v0.30.4
v0.30.3
v0.33.4
v0.33.3
v0.33.2
v0.33.1
v0.33.0
v0.32.2
v0.31.2
v0.30.2
v0.32.1
v0.31.1
v0.30.1
v0.29.1

see v0.32.x releases appearing 0.33.x.
so on any day if there is a datewise newer patch release for an older version (eg: v0.32.x), then the patch in this pr will retrieve that version instead of the latest version (eg: v0.33.x).

🧑‍💻 👉 this situation could be solved using the bash sort command with its -V (version aware sort flag).

eg:

curl -sL https://api.github.com/repos/tektoncd/pipeline/releases | jq ".[].tag_name"  | sort -Vr
"v0.35.1"
"v0.35.0"
"v0.34.1"
"v0.34.0"
"v0.33.4"
"v0.33.3"
"v0.33.2"
"v0.33.1"
"v0.33.0"
"v0.32.4"
"v0.32.3"
"v0.32.2"
"v0.32.1"
"v0.32.0"
"v0.31.4"
"v0.31.3"
"v0.31.2"
"v0.31.1"
"v0.31.0"
"v0.30.4"
"v0.30.3"
"v0.30.2"
"v0.30.1"
"v0.30.0"
"v0.29.1"

@PuneetPunamiya could you drop the -r from jq and pipe the output of jq through sort -Vr

@tekton-robot tekton-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels May 25, 2022
@tekton-robot tekton-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels May 25, 2022
@PuneetPunamiya
Copy link
Member Author

@nikhil-thomas I have updated the patch could you please take a final look at it once ?

@sm43
Copy link
Member

sm43 commented May 27, 2022

/approve

Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label May 30, 2022
Initially, Hub version was hard coded in makefile to fetch
the specific version and after each release to get the latest
version we had to update the version in the Makefile

Hence this patch fixes the version to latest where in the script
it fetches the latest Hub version

Signed-off-by: Puneet Punamiya <[email protected]>
@tekton-robot tekton-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jun 15, 2022
@piyush-garg
Copy link
Contributor

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 15, 2022
@nikhil-thomas
Copy link
Member

/hold cancel
/lgtm
/approve

@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 Jun 17, 2022
@tekton-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nikhil-thomas, sm43, vdemeester

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:
  • OWNERS [nikhil-thomas,sm43,vdemeester]

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 merged commit d47b941 into tektoncd:main Jun 17, 2022
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. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. 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.

6 participants