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

fix the latest_version function #101

Merged
merged 2 commits into from
Nov 2, 2021

Conversation

dprotaso
Copy link
Member

@dprotaso dprotaso commented Nov 2, 2021

it's aware of the new tag format and the manual jump from
v0.26 => v1.0

note: lates_version returns the tag which may now include prefixes

it's aware of the new tag format and the manual jump from
v0.26 => v1.0
@google-cla google-cla bot added the cla: yes Indicates the PR's author has signed the CLA. label Nov 2, 2021
@knative-prow-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dprotaso

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 added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 2, 2021
@dprotaso
Copy link
Member Author

dprotaso commented Nov 2, 2021

/hold - there's a bug

@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 Nov 2, 2021
@dprotaso
Copy link
Member Author

dprotaso commented Nov 2, 2021

/hold cancel

@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 Nov 2, 2021
@dprotaso
Copy link
Member Author

dprotaso commented Nov 2, 2021

/hold I'll verify in serving

@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 Nov 2, 2021
@dprotaso
Copy link
Member Author

dprotaso commented Nov 2, 2021

/hold cancel

@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 Nov 2, 2021
@dprotaso
Copy link
Member Author

dprotaso commented Nov 2, 2021

verified the behaviour

  • serving, main => picked knative-v1.0.0
  • serving, release-1.0 => picked v0.26.0
  • serving, release-0.26 => picked v0.25.1

@benmoss
Copy link
Member

benmoss commented Nov 2, 2021

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 2, 2021
@knative-prow-robot knative-prow-robot merged commit b284d49 into knative:main Nov 2, 2021
@tzununbekov
Copy link
Member

I was wondering if using Github's latest endpoint could help save some lines:

function latest_version() {
  local origin=$(git config --get remote.origin.url | sed 's/.*:\(.*\)\..*$/\1/')
  curl -I -s https://github.com/${origin}/releases/latest | grep "location:" | awk -F/ '{print $NF}' | sed 's/ //g'
}

@dprotaso
Copy link
Member Author

dprotaso commented Nov 2, 2021

looking https://docs.github.com/en/rest/reference/repos#get-the-latest-release - it's is sorted by created_at time

but we need to sort by our semver versions since we'll produce newer patch releases for older branches

@dprotaso
Copy link
Member Author

/cherry-pick release-1.0

@knative-prow-robot
Copy link

@dprotaso: new pull request created: #106

In response to this:

/cherry-pick release-1.0

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.

@dprotaso
Copy link
Member Author

/cherry-pick release-0.26
/cherry-pick release-0.25
/cherry-pick release-0.24

@knative-prow-robot
Copy link

@dprotaso: #101 failed to apply on top of branch "release-0.26":

Applying: fix the latest_version function
Using index info to reconstruct a base tree...
M	library.sh
M	release.sh
Falling back to patching base and 3-way merge...
Auto-merging release.sh
CONFLICT (content): Merge conflict in release.sh
Auto-merging library.sh
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 fix the latest_version function
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-0.26
/cherry-pick release-0.25
/cherry-pick release-0.24

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.

pierDipi pushed a commit to pierDipi/hack that referenced this pull request Dec 6, 2021
* fix the latest_version function

it's aware of the new tag format and the manual jump from
v0.26 => v1.0

* latest_version on the main branch will return the tag with the knative- prefix
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/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.

4 participants