Repository navigation
emu_downloads: put the build id back in the download url - #420
Draft
rootkiller6788 wants to merge 2 commits into
Draft
rootkiller6788 wants to merge 2 commits into
rootkiller6788 wants to merge 2 commits into
Conversation
download_build() asks ci.android.com for a build by id, but the url it
builds has a literal "{0}" in the path where the id should go, so it
always requests build 0 and never downloads the build the user asked
for.
That {0} was a .format() placeholder that got missed when the line was
rewritten as an f-string in c70f927. Both placeholders wanted the build
id.
Locks down the url so a placeholder can't silently survive a rewrite of that line again.
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.
The
createsubcommand is documented as taking a build id (emu-docker create 12345678 "C google_apis x86_64"), butdownload_build()builds the ci.android.com url with a literal{0}where the id should go, so it always asks for build 0. That 404s and you just end up with an error page saved assdk-repo-linux-emulator-<id>.zip.It's a leftover from c70f927, where this line went from
"...submitted/{0}/...emulator-{0}.zip".format(build_id)to an f-string and only the second placeholder got replaced.cloud-buildcalls the same helper, so it was broken there too.Put
{build_id}in the path and added a test that pins the url, so the same thing can't quietly come back.Ran
pytest tests/ --ignore=tests/e2e -q(43 passed). The new test fails against the old line, which is how I know it's actually covering this.