-
-
Notifications
You must be signed in to change notification settings - Fork 4
Infra 2576 update changelog automatically #140
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Pavel Dvorkin <[email protected]>
Signed-off-by: Pavel Dvorkin <[email protected]>
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 the PR @XxdpavelxX
There seems to be code duplication between .github/scripts/update-release-changelog.sh
file and the create_changelog_pr
function we have in .github/scripts/create-platform-release-pr.sh
file. It would be great if both GitHub Actions were using the same code.
# ----------------------------------------------------------------- | ||
|
||
# Derive the semantic version from the branch naming convention. | ||
if [[ "${RELEASE_BRANCH}" =~ ^Version-v([0-9]+\.[0-9]+\.[0-9]+)$ ]]; then |
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.
We no longer need to support Version-v
format.
yarn --cwd install | ||
|
||
echo "Generating test plan csv.." | ||
yarn run gen:commits "${platform}" "${diff_base}" "${release_branch}" "${project_git_dir}" |
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.
Do we really need to generate commits CSV file? I may be missing something, but this seems to be something that was needed back in the days when we wanted to generate the release spreadsheet.
Is is not enough to run yarn auto-changelog update
command since all we want is generate the changelog?
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'm not sure. I kept that behavior since it was in the .github/scripts/create-platform-release-pr.sh
function for updating the changelog. But will remove it. We can always add it back in the future if we decide to. https://github.com/MetaMask/github-tools/blob/main/.github/scripts/create-platform-release-pr.sh#L397#L398
I noticed this and thought about having both workflows use one script but decided that it would be better to decouple them. Here was my reasoning. Let me know what you think. @gauthierpetetin
We could add a followup cleanup task to update the old |
We could do it as a separate task if you prefer. But at some point we'll need one single script to generate the changelog because both scripts do exactly the same 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 added 2 small comment. Otherwise, looks good to me.
VERSION="${BASH_REMATCH[1]}" | ||
else | ||
echo "Release branch '${RELEASE_BRANCH}' does not match known patterns." >&2 | ||
exit 0 |
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.
cursor bot is right, we should replace with
exit 1
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.
Unable to authenticate your request. Please make sure to connect your GitHub account to Cursor. Go to Cursor
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.
fixed
shell: bash | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.github-token }} | ||
GH_TOKEN: ${{ secrets.github-token }} |
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.
It seems GH_TOKEN is not used, right?
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.
Yes, I passed an extra viable. GITHUB_TOKEN is sufficient
Tested here: consensys-test/metamask-extension-test-workflow2#204, https://github.com/consensys-test/metamask-extension-test-workflow2/actions/runs/18538077577
Ticket: https://consensyssoftware.atlassian.net/browse/INFRA-2576
Added a new workflow to update or create the changelog when release PRs are created or receive new merges.
Update Release Changelog PR (update-release-changelog.yml)
When it runs:
Triggers on every push to release branches matching:
Version-v* (e.g., Version-v13.3.0)
release/[0-9]+.[0-9]+.[0-9]+ (e.g., release/999.98.0)
What it does:
Calls the github-tools update-release-changelog.yml workflow
This workflow runs the update-release-changelog.sh script
The script uses @metamask/auto-changelog to generate/update the changelog
When CHANGELOG.md Gets Created or Updated
Initial Creation:
Branch Creation: When you create a release/999.98.0 branch
Auto Create Release PR: Triggers and calls create-release-pr.yml
Create Release PR: Calls github-tools to create the release PR
Changelog Creation: The github-tools script:
Creates a changelog branch: release/999.98.0-Changelog
Runs yarn auto-changelog update --rc --autoCategorize --useChangelogEntry --useShortPrLink
Creates/updates CHANGELOG.md with commits since the last tag
Creates a PR: release: release/999.98.0-Changelog
Subsequent Updates:
New Commits: When you push new commits to release/999.98.0
Update Release Changelog PR: Triggers automatically
Changelog Update: The workflow:
Checks out the existing release/999.98.0-Changelog branch
Runs the auto-changelog script again
Updates the existing CHANGELOG.md with new commits
Commits and pushes the changes to the existing changelog PR
The auto-changelog looks for git tags to determine the commit range
Duplicate Filtering: It filters out commits that don't have PR numbers or are already in the changelog
Note
Introduce a reusable workflow and helper script to generate/update changelog branches and draft PRs for release branches using auto-changelog.
/.github/workflows/update-release-changelog.yml
:release-branch
,platform
,repository-url
, andprevious-version-ref
; requiresgithub-token
.MetaMask/github-tools
, sets up env, installs deps, and runs changelog update script with write permissions./.github/scripts/update-release-changelog.sh
to:release/x.y.z
branch, determinerelease/<version>-Changelog
(or fallback) branch, and checkout/create it.Written by Cursor Bugbot for commit bf1f24c. This will update automatically on new commits. Configure here.