fpga-releaser: fix --skip-gh and inverted needs_gh check#502
Merged
Conversation
Commit 5bb0735 reparenthesized the needs_gh expression as 'not (args.skip_gh or args.zip is None)', which evaluates to 'not args.skip_gh and args.zip is not None' -- the opposite of the intent for the default invocation. With no --skip-gh and no --zip, needs_gh became False, api stayed None, and get_latest_artifact_info crashed with AttributeError. Additionally, --skip-gh on its own would fall through to process_gh_build and attempt to fetch artifacts from GitHub, defeating the purpose of the flag. Require --zip or --local when --skip-gh is set so the tool never touches GitHub in that mode.
290bfac to
d689eae
Compare
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.
#500 broke the normal release flow due to a logic bug that makes a normal run with no --skip-gh and no --zip fail:
The change in #500 is equivalent to
not args.skip_gh and args.zip is not None, so for the default invocation (no --skip-gh, no --zip) needs_gh evaluated to False, meaning theapistayed None, andget_latest_artifact_infoblew up dereferencing that None.In the original intention of this code, skip-gh really meant skip-gh-release. Even when fixing the bug above, the system still accessed the github api when skip-gh was set so this PR actually fixes that problem also so skip-gh really does skip github now, releases and APIs.