have downloadIstioCandidate.sh ask github for the latest#1977
have downloadIstioCandidate.sh ask github for the latest#1977istio-merge-robot merged 4 commits intoistio:masterfrom
Conversation
release/downloadIstioCandidate.sh
Outdated
There was a problem hiding this comment.
you shouldn't need a temp file, can't you just chain the grep,... with pipes?
There was a problem hiding this comment.
I got started with a file from initially using cut, then again from parsing out two pieces of data (the version and the URL--I couldn't find a decent way to try to split stdout into two pipes). If I only grab the version and continue with the pre-existing approach of using a URL template than I can forego the file.
There was a problem hiding this comment.
you only need 1 pass so you can do it all with awk for instance
| awk ' /version/ {version=$3} /url/ {url=$5} END {print version,url}'for instance (not actual correct regex or field index number, just an illustration)
release/downloadIstioCandidate.sh
Outdated
There was a problem hiding this comment.
maybe just using the
"tag_name": "0.3.0",
to get the version is enough (+ checking for
"draft": false,
)
There was a problem hiding this comment.
The doc on the API (https://developer.github.com/v3/repos/releases/#get-the-latest-release) says "Draft releases and prereleases are not returned by this endpoint", so that's why I don't bother to check for draft or pre-release.
There was a problem hiding this comment.
then we just need to get the version and nothing else ?
Codecov Report
@@ Coverage Diff @@
## master #1977 +/- ##
==========================================
- Coverage 81.24% 79.93% -1.32%
==========================================
Files 215 74 -141
Lines 17091 6896 -10195
==========================================
- Hits 13885 5512 -8373
+ Misses 2695 1098 -1597
+ Partials 511 286 -225
Continue to review full report at Codecov.
|
|
this is good to go except not this week for the same reason as |
|
@mattdelco PR needs rebase |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ldemailly The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
|
/test all [submit-queue is verifying that this PR is safe to merge] |
|
/test istio-pilot-e2e |
|
/test all [submit-queue is verifying that this PR is safe to merge] |
|
Automatic merge from submit-queue. |
|
verified that it worked on my mac: |
This change allows downloadIstioCandidate.sh to automatically ask github for the latest version. It seems to work on Mac and Linux and I've preserved the behavior to allow ISTIO_VERSION to override the version. This file isn't to be confused with ../downloadIstio.sh that's used to grab the latest stable.
The main tradeoff I can think of (besides if I've unknowlying added an inappropriate dependency) is that if we have a release like 0.3.0 and then do a new release for a patch update (e.g., a hypothetical 0.2.15) then github might report that 0.2.15 is the latest. I'm not sure I have a good solution for this. Even if I have the script take the max(github-latest, ISTIO_VERSION-in-file) then this won't be ideal either if the version in the script is stale, and my eventual hope/goal would be to get rid of the baked-in version (and the need to update it).
Thoughts on whether this is a worthwhile or achievable goal?