-
Notifications
You must be signed in to change notification settings - Fork 21
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
Setup steps after release-please to automate gem version syncing #208
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
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.
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.
I wonder if we'll have to do anything here to checkout the newly-created release PR branch. The action (workflow?) itself is running on
main
, so my guess is that the checkout and commit will also happen onmain
.In your testing, I think the action was running on the branch, so the automated commit was also on the branch.
If I'm right about this, then maybe we'll want a separate action that only triggers on release PR's, and all that action does is sync the versions.
Not sure how to test any of this, though, without pushing to
main
and creating a release PR.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.
Yeah you're right, I didn't think this through with the different branch it runs vs the one it creates. It couldn't be that simple 😅
It seems the "outputs" object has access to a PR object if one was created (which it'd have been in this case), and that PR object has access to both head & base branch names: https://github.com/googleapis/release-please/blob/cb106cd0b5ae5c3e2a3b015487dc615eba72b842/src/pull-request.ts#L15-L17, so maybe we can checkout the right branch for that PR and run the sync/commit there?
I think that'd mean set the
ref
attribute according to actions/checkout docs, to something likesteps.release.outputs.pr.headBranchName
. It's definitely hard to test all this, without triggering the real thing!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.
I pushed that change, but I am now also thinking (and this may be a bit controversial): what if we removed the VERSION for each gem, and let the gemspec use
Judoscale::VERSION
viarequire_relative ../judoscale-ruby/.../version.rb
Since we're treating the version the same anyway, it's in theory not necessary to have that constant on each gem (it's more of a common thing, not a requirement). The gemspec is also built via checking out the entire source code so it has access to judoscale-ruby, and the gemspec doesn't need to be included in the code that's shipped with the gem. (it's statically built locally when pushing the *.gem)
It might make things more difficult if we ever go back from generating the same version across the board, though. (but then we wouldn't have any automated syncing anyway) We also report that VERSION as adapter version to the API, so there's that.
Anyway, food for thought.
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.
I don't think that's controversial at all! It sounds much more reasonable than what we're doing now. 😂
Let's do that!!
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.
Sounds good, let's give it a shot.
I pushed a separate PR with that change #210, since I was wrapping up some other gemspec improvements already, so pushed a PR on top of that to avoid conflicts. Will close this one for now.