script/query: don't restrict ./script.sh get-latest
to a single tag
#350
+11
−13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While fixing #349 I noticed the oddity that was
script.sh get-latest
. On one side we havescript.sh
that has access to the full tag list but only returns one, and on the other we have the Python code that spawns multiple timescript.sh
if the tags it gets aren't up to its expectations.Simplify that by making
script.sh
return the full sorted list of tags. Then we let Python code do its filtering based on database content. Code is more straight forward that way.Merged 3d81fa4 quickly to fix the ugly user-facing bug, but this is refactoring so let's do a round of review.
Commit message:
./script.sh get-latest <offset>
gets the full list of tags, filters it, sorts it then returns a single result. On the Python side, it gets the first one. If that works, it uses it, else it tries the second one, etc.That is a weird implementation: modify get-latest to return all tags so that Python code only has to spawn a single subprocess.
Also, rename it from
get-latest
toget-latest-tags
. This makes things more explicit (what latest?) and also explicits that more than one tag is required.