-
Notifications
You must be signed in to change notification settings - Fork 8
Go: Use generated release notes in GitHub Release template #88
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
Go: Use generated release notes in GitHub Release template #88
Conversation
| @@ -1,17 +1,7 @@ | |||
| The MongoDB Go Driver Team is pleased to release version {{ .ReleaseVersion }} of the official MongoDB Go Driver. | |||
|
|
|||
| ## Release Notes | |||
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 we should still keep the release notes section to highlight notable changes. For example, 1.17.4.
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.
Added a "Release Highlights" section to signify that we want to use this for a couple of important changes included in the release.
|
|
||
| For a full list of tickets included in this release, please see the [list of fixed issues](https://jira.mongodb.org/issues/?jql=project%3Dgodriver%20and%20fixVersion%3D{{ .ReleaseVersion }}). | ||
|
|
||
| **Full Changelog**: [v{{ .PreviousVersion }}...v{{ .ReleaseVersion }}](https://github.com/mongodb/mongo-go-driver/compare/v{{ .PreviousVersion }}...v{{ .ReleaseVersion }}) |
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.
Suggest we still include the full changelog, which is a comparison between the last release the current one. For example, 1.17.3..1.17.4. This is different than an enumerated list of changes as it provides a complete overview of all code changes for a release.
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.
Sorry, meant to explain this on the PR itself. The changelog generated by GitHub always includes this, so this line is redundant. See this laravel-mongodb release to see what this looks like.
golang/publish/notes.go
Outdated
| func generateGithubNotes(release, previous string) { | ||
| func generateGithubNotes(release, previous, changeLogFile string) { | ||
| filename := "github.md" | ||
| changeLog, err := ioutil.ReadFile(changeLogFile) |
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.
Ah, good point. Changed, thank you!
golang/publish/publish.sh
Outdated
| pushd $GITHUB_WORKSPACE || exit 1 | ||
|
|
||
| # Update release notes with generated version and upload release assets | ||
| gh release create v${VERSION} -F $NOTES_FILE |
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 tested double creates in a throw away repo and it doesn't appear to be an issue:
❯ gh release create v0.1.0-test --draft --verify-tag --title "Test v0.1.0-test" --generate-notes
https://github.com/prestonvasquez/dev/releases/tag/untagged-0390f16b8b624db14804
❯ gh release create v0.1.0-test --draft --verify-tag --title "Test v0.1.0-test" --generate-notes
https://github.com/prestonvasquez/dev/releases/tag/untagged-af4530f8c0cd95f7a56f
However, gh release also offers an edit option:
gh release edit v${VERSION} -F $NOTES_FILE
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.
That's what I wanted to use, but apparently my copy/paste skills are a little rusty. Fixed now.
prestonvasquez
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.
Looks good 👍
This PR changes the release flow for Go. It now creates a draft release using the
--generate-notesflag, which instructs GitHub to automatically generate release notes based on tags and configuration in the repository. We then extract those release notes from the tag and use them in the full notes that we then write to the release later.Due to the generated changelog being required, the dry run no longer contains forum and GitHub release notes in the job output -- although this could be worked around if we so desire.