Pin the installer script and declare the CLI version - #1
Open
jlaneve wants to merge 3 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Install Astro CLIfetchedgodownloader.shfromastronomer/astro-cli@mainand piped it to bash.mainis mutable, so a merge there changes what runs in a caller's CI. A security review at a prospect flagged the same line indeploy-action, which shipped the fix in v0.15.0; this is the matching change here.The URL now names a commit. It appears twice, so it moved into
GODOWNLOADER_URL. A commit and not a tag for two reasons: a tag can be moved and GitHub resolves it at fetch time, so the bytes can change under a fixed URL; and astro-cli's copy at a release tag names the release before it, because the bump PR targetsmainwhile GA tags are cut fromrelease-X.Ybranches that never receive it.versionalso picks up a real default.""did not mean "latest" — it meant the installer chose, and the installer read a hardcoded constant on astro-cli'smainthat only catches up when a human merges the post-release bump PR. That lag has run from 9 minutes to 13 days: v1.41.0 shipped on 31 March and the constant was not bumped until 13 April, so for two weeks an unsetversioninstalled 1.40.1 while loggingUsing Latest(v1.40.1). Pinning the script alone would have frozen that at the pinned commit's 1.44.0. The version belongs on the input, where it shows in a diff and reads as a version rather than a hash.1.45.0 is what an unset
versioninstalls today, so nobody's CLI moves. Anyone wanting to track the newest has no option in this change —version: latestis the follow-up, and it needs astro-cli v1.46.0 first, since it reads theinstall.shasset that astronomer/astro-cli#2252 publishes and no released version carries one yet.Call-stack diff
Install Astro CLI action.yaml └─ INPUT_VERSION=${{ inputs.version }} + │ # now "1.45.0", not "" ├─ astro already on PATH? # unchanged, short circuits ├─ download-url set? # unchanged, short circuits └─ curl installer | bash - └─ raw/astro-cli/main/godownloader.sh + └─ raw/astro-cli/0dfc4bff/godownloader.shUnchanged: the install directory, both outputs, and the two
download-urlpaths.🎟 Issue(s)
Related: astronomer/deploy-action#160
🧪 Functional Testing
The three existing jobs cover the already-in-PATH skip and both
download-urlpaths. None of them touched the installer, which is the only path this changes — so this adds two that do:inputs.version.defaultout ofaction.yaml, installs with no inputs, and assertsastro versionmatches. A pin naming a version that does not exist now fails CI instead of shipping.1.44.0and asserts it.The first is the one worth having. It follows the default automatically, so it keeps checking the pin after someone bumps it.
Run by hand before pushing, since the workflow only runs on
push:yamllintpasses on both files with the repo config, reporting only the pre-existingon:truthy warning.One behaviour note for review: with an explicit version,
godownloader.shresolves the tag throughapi.github.com, which it skipped when the version was empty and it used its own constant. That is an unauthenticated call, 60/hour per IP, and runners share addresses. It is the same path every existing caller ofversion:already takes, but it is now the default path. Theinstall.shfollow-up removes it, since a stamped installer needs no lookup.📸 Screenshots
N/A.
📋 Checklist
make testbefore taking out of draft — no Go code; this repo has no Makefilemake lintbefore taking out of draft — ranyamllintwith the repo config instead@v0.0.1, so nothing onmainreaches them until a new tag is cut; the README still points at@v0.0.1and should be bumped with that release