-
Notifications
You must be signed in to change notification settings - Fork 5.9k
refactor: fix brew-bump.sh script and automate homebrew releases #4996
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
This moves the git clone step from the `brew-bump.sh` script into the `npm-brew.yaml` as part of the job using actions/checkout instead.
✨ code-server docs for PR #4996 is ready! It will be updated on every commit.
|
Codecov Report
@@ Coverage Diff @@
## main #4996 +/- ##
=======================================
Coverage ? 71.58%
=======================================
Files ? 29
Lines ? 1675
Branches ? 373
=======================================
Hits ? 1199
Misses ? 405
Partials ? 71 Continue to review full report at Codecov.
|
NotesRan out of time with asher but stopped at the step where we push latest changes to fork |
Agreed. The original intent of that block was to prevent duplicate PRs since
My thinking is that is should be marked as green. Reason? Because running this job again and having the version already in upstream isn't a failure and shouldn't be marked as red. It should only be red if it fails to push a version (meaning that version never gets to Homebrew upstream). In a world with more options, I would do this:
Red should be used to signal failures. But to counter myself...we should match the error code of ➜ ~ brew bump-formula-pr --version="4.0.1" code-server --no-browse --no-audit
Error: These pull requests may be duplicates:
code-server 4.0.1 https://github.com/Homebrew/homebrew-core/pull/92582
Duplicate PRs should not be opened. Use --force to override this error Hmmm going back to the other side I feel like this should be a warning, not an error. I don't know. As you can tell, I can understand both sides. I can go either way. |
A little different than that I think, it just checks whether
Pretty much the same thoughts going through my head. I think...ultimately if the action goes red we have to take a look at it. If we see it already uploaded then we have nothing to do, in which case we just wasted our time. So maybe green would be the least frustrating. I definitely agree if there was some kind of warning state that would be ideal. Or if we could somehow make use of skipped steps. But that would require we check beforehand whether the PR was already submitted in a previous step and if so skip the actual publish step. |
I agree, I think for now, I'll add back the check to do that.
Yeah, I think for now, it's okay but we could revisit this if we think we need that. |
FWIW, I did look at the Homebrew docs. (omitted some info) {
"name": "code-server",
"full_name": "code-server",
"tap": "homebrew/core",
"desc": "Access VS Code through the browser",
"license": "MIT",
"homepage": "https://github.com/cdr/code-server",
"versions": {
"stable": "4.1.0",
"head": null,
"bottle": true
} We could get the latest published version but we'd have to check for a PR somehow. Seems like a lot of work for not a lot of benefit so I think we'll go with make green if PR already open. |
@code-asher ready for another review! |
Blocked by #5006 |
) * refactor: checkout homebrew-core in action instead of script This moves the git clone step from the `brew-bump.sh` script into the `npm-brew.yaml` as part of the job using actions/checkout instead. * refactor: clean up brew-bump.sh script * fixup * fixup!: remove step to clean up homebrew repo * fixup!: use correct ./ci path steps-lib.sh * fixup!: add exit code 0 for duplicate PRs
This fixes the
brew-bump.sh
script by using the correct logic. It also moves agit clone
line from the script to a step in thehomebrew
job.Testing Plan
coder/code-server
VERSION
to4.1.0-4970-6afc87b46dfa70adc0afe164a89662aac1a0b0cd
(otherwise it will fail) and disablenpm
jobHOMEBREW_GITHUB_API_TOKEN
as secret to fork (using my own token).✅ tested this with @cdr-oss account on Coder workspace
✅ tested with @cdrci account and it worked: Homebrew/homebrew-core#97235 (oops, should have just used the
--dry-run
option)Other Notes
🔑 Updated the
HOMEBREW_GITHUB_API_TOKEN
under secrets with a PAT generated by @deansheather from the @cdrci account which has the scopesrepo
andworkflow
.Fixes #4950