-
Notifications
You must be signed in to change notification settings - Fork 146
Add make_latest property to the GH release POST request during publish
#1157
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
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.
thanks for restarting the effort and conversation around this one, @pfarnach. i think this does get us most of the way there, but we'll need to find a more dynamic approach that considers cases where the stable release branch is not named main
| @@ -0,0 +1,3 @@ | |||
| export default function isLatestRelease({ type, main }) { | |||
| return type === "release" && main ? "true" : "false"; | |||
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.
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.
Hi @travi thanks for looking at my PR!
I'm having trouble finding explicit docs about the branch object (the closest thing I could find is here) so I'm going off my very cursory understanding of the source code. It seems like main in this context is a boolean (rather than a string representing the branch name) that's set here, based on the index of the branch that's passed into the config. In any case, that also doesn't seem very reliable unless there's something ensuring the main/master/whatever branch is the first element there.
Would it be enough to just check the type value and remove the main check? From what I can tell, the other possible values are maintenance and prerelease but could use a gut-check on 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.
i think you did find the closest thing to documentation on that detail. with the lack of a better doc, i went spelunking through what the core package passes to this lifecycle method to refresh my understanding. looks like i landed in the same places you explored. some of this is from before i joined the project and doesnt always stick in my brain properly. i think you landed on the correct approach.
Would it be enough to just check the type value and remove the main check? From what I can tell, the other possible values are maintenance and prerelease but could use a gut-check on that.
main accounts for "next"-type releases. not a prerelease, not a maintenance release. normal release, but not to the default channel. so given that, main is needed for determining "latest" and you've handled it appropriately here.
sorry for my confusion before and thanks for your patience
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.
| @@ -0,0 +1,3 @@ | |||
| export default function isLatestRelease({ type, main }) { | |||
| return type === "release" && main ? "true" : "false"; | |||
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 think you did find the closest thing to documentation on that detail. with the lack of a better doc, i went spelunking through what the core package passes to this lifecycle method to refresh my understanding. looks like i landed in the same places you explored. some of this is from before i joined the project and doesnt always stick in my brain properly. i think you landed on the correct approach.
Would it be enough to just check the type value and remove the main check? From what I can tell, the other possible values are maintenance and prerelease but could use a gut-check on that.
main accounts for "next"-type releases. not a prerelease, not a maintenance release. normal release, but not to the default channel. so given that, main is needed for determining "latest" and you've handled it appropriately here.
sorry for my confusion before and thanks for your patience
|
Appreciate the review, @travi -- I fixed the integration tests and added three more to cover the publishing-without-assets flow |
|
🎉 This PR is included in version 12.0.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This PR implements the requested change from this stalled PR #884
And fixes #817