-
Notifications
You must be signed in to change notification settings - Fork 6.3k
fix(brew-bump.sh): add checks and handle errors #4236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report
Merging #4236 (9aac550) into main (8f72481) will not change coverage.
The diff coverage isn/a
.
❗ Current head 9aac550 differs from pull request most recent head 8ef950a. Consider uploading reports for the commit 8ef950a to get more accurate results
Impacted file tree graph
@@ Coverage Diff @@ ## main #4236 +/- ## ======================================= Coverage 65.09% 65.09% ======================================= Files 36 36 Lines 1882 1882 Branches 380 380 ======================================= Hits 1225 1225 Misses 559 559 Partials 98 98
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 8f72481...8ef950a. Read the comment docs.
✨ Coder.com for PR #4236 deployed! It will be updated on every commit.
- Host: https://codercom-mntbit5ie-codercom.vercel.app/docs/code-server
- Last deploy status: success
- Commit: 8ef950a
- Workflow status: https://github.com/cdr/code-server/actions/runs/1284649852
b590dcd
to
9aac550
Compare
@jawnsy
jawnsy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left some really minor suggestions for your consideration, this is good-to-go as it is
test/scripts/steps-lib.bats
Outdated
@jawnsy
jawnsy
Sep 27, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you change the functions to return stuff instead of echo, then you'd have to change this to check the $status
instead of $output
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! Okay if/after I refactor, I'll update these!
feat(script): add steps-lib, is_env_var_set & test feat(brew-bump): add check for VERSION feat(brew-bump): check HOMEBREW_GITHUB_API_TOKEN feat(steps-lib): add directory_exists helper fn fix(brew-bump): check that git clone worked feat(brew-bump): add check for remote upstream fix: remove upstream command thing feat(steps-lib): add file_exists helper function feat(brew-bump): add check for git-askpass.sh feat(steps-lib): add is_executable function & test feat(brew-bump): add check for is_executable refactor: use GIT_ASKPASS as variable
9aac550
to
8ef950a
Compare
Uh oh!
There was an error while loading. Please reload this page.
This PR adds a lot of bash helper functions (+ tests) used in
brew-bump.sh
in order to ensure this script doesn't fail when publishing a release.image
TODOs
steps-lib.sh
$VERSION
cdr/ci/homebrew
$HOMEBREW_GITHUB_API_TOKEN
git-ask-pass.sh
GIT_ASKPASS
in isolated environmentFixes #3962
Test Plan
To test out the other parts of the script (specifically
GIT_ASKPASS
), here is what I did:https://master.cdr.dev/workspaces
brew-bump.sh
and addsteps-lib.sh
to Workspace.chmod +x test-brew.sh
VERSION="1.2.3" HOMEBREW_GITHUB_API_TOKEN="<redcated>" ./test-brew.sh
(make sure the token hadrepo
andworkflow
in scope).Notes
Ran into issues with scripts that used
set -u
so that's why I created a new file calledsteps-lib.sh
.See: sstephenson/bats#171