Skip to content

Conversation

@alcaeus
Copy link
Collaborator

@alcaeus alcaeus commented Jul 30, 2025

This PR changes the release flow for Go. It now creates a draft release using the --generate-notes flag, 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.

@@ -1,17 +1,7 @@
The MongoDB Go Driver Team is pleased to release version {{ .ReleaseVersion }} of the official MongoDB Go Driver.

## Release Notes
Copy link
Collaborator

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.

Copy link
Collaborator Author

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 }})
Copy link
Collaborator

@prestonvasquez prestonvasquez Jul 30, 2025

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.

Copy link
Collaborator Author

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.

func generateGithubNotes(release, previous string) {
func generateGithubNotes(release, previous, changeLogFile string) {
filename := "github.md"
changeLog, err := ioutil.ReadFile(changeLogFile)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ioutil is deprecated as of Go 1.16, suggest using os:

changelog, err := os.ReadFile(changeLogFile)

Copy link
Collaborator Author

@alcaeus alcaeus Jul 31, 2025

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!

pushd $GITHUB_WORKSPACE || exit 1

# Update release notes with generated version and upload release assets
gh release create v${VERSION} -F $NOTES_FILE
Copy link
Collaborator

@prestonvasquez prestonvasquez Jul 30, 2025

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

Copy link
Collaborator Author

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.

@alcaeus alcaeus requested a review from prestonvasquez July 31, 2025 10:41
Copy link
Collaborator

@prestonvasquez prestonvasquez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

@alcaeus alcaeus merged commit 40b8ff3 into mongodb-labs:main Jul 31, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants