Skip to content

Conversation

@HowardBraham
Copy link
Contributor

@HowardBraham HowardBraham commented Sep 1, 2025

Progresses: MetaMask/MetaMask-planning#5686

  • Looks for CHANGELOG entry: in the PR description, and looks for no-changelog label, then applies this to the generated CHANGELOG
  • Properly categorizes by Conventional Commit type, including our custom ConventionalCommitType.RELEASE

New parameters added:

  • useChangelogEntry: boolean;
  • useShortPrLink: boolean;

@HowardBraham HowardBraham self-assigned this Sep 1, 2025
@socket-security
Copy link

socket-security bot commented Sep 1, 2025

All alerts resolved. Learn more about Socket for GitHub.

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Ignoring alerts on:

View full report

@HowardBraham HowardBraham changed the title Parse changelog entry feat: parse CHANGELOG entry: and no-changelog Sep 1, 2025
@HowardBraham
Copy link
Contributor Author

@SocketSecurity ignore @octokit/[email protected]

Copy link
Contributor

@gauthierpetetin gauthierpetetin left a comment

Choose a reason for hiding this comment

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

Thanks for this PR @HowardBraham , here are a few comments:

  • Generating the changelog with auto-changelog adds an empty line after each title. However, this is not accepted by “yarn lint:changelog”.
  • We could ensure all changelog entries start with lowercase for consistency.
  • We could introduce an "undocumented" category for commits without changelog entries (different from “uncategorized” category). Currently commits without changelog entries and commits with changelog entries are all mixed together, which gives the impression that commits without changelog entries are ok and don’t need to be reviewed, while in most cases, they’re not user-facing and need to be reviewed. --> We don't need this anymore since we've made the changelog entries mandatory (see Slack message)
  • We could automatically ignore commits including the following strings:
    • “Bump main version to”
    • “changelog” or “Changelog”
    • “merge” or “Merge”
    • “cp-“
    • “cherry-pick”
    • “INFRA-”
    • “New Crowdin translations”
    • “e2e”
    • “flaky test”
    • “test” (I’m hesitant about this one but in the vast majority of cases, it can be ignored)
    • “ci:”, “release:” (I think that’s already ignored)
  • Not sure how useful that is but in our current changelog (example here), all entries start with:
    • “feat: ” if they’re in the “### Added” section
    • “update: ” if they’re in the “### Changed” section
    • “fix: ” if they’re in the “### Fixed” section
  • Maybe we should generate something similar here?
  • This also means if a commit is “feat(something): feature description”, we should only add “feat: feature description” to the changelog, and get rid of “(something)”
  • Finally, I noticed “metamask-extension” is hardcoded in the PR, which means it wouldn’t work for metamask-mobile repo. We should use a parameter to make it repo-agnostic.

@HowardBraham
Copy link
Contributor Author

  • Generating the changelog with auto-changelog adds an empty line after each title. However, this is not accepted by “yarn lint:changelog”.

I know about this, and it's why in the changelog-update branch I changed the command to "lint:changelog": "auto-changelog validate --prettier"

  • We could ensure all changelog entries start with lowercase for consistency.

Actually I think we should go in the opposite direction and start all of them with an UPPERCASE. This is what we used to do, if you look at CHANGELOG_OLDER.md.

  • We could introduce an "undocumented" category for commits without changelog entries (different from “uncategorized” category). Currently commits without changelog entries and commits with changelog entries are all mixed together, which gives the impression that commits without changelog entries are ok and don’t need to be reviewed, while in most cases, they’re not user-facing and need to be reviewed.

Is this going to resolve now that changelog entries are mandatory?

  • We could automatically ignore commits including the following strings:

This makes sense.

  • Not sure how useful that is but in our current changelog (example here), all entries start with:
    • “feat: ” if they’re in the “### Added” section
    • “update: ” if they’re in the “### Changed” section
    • “fix: ” if they’re in the “### Fixed” section

I think this is actually an unwanted temporary relic. In CHANGELOG_OLDER.md, there was none of this.

  • Finally, I noticed “metamask-extension” is hardcoded in the PR, which means it wouldn’t work for metamask-mobile repo. We should use a parameter to make it repo-agnostic.

Oh whoops, you're right, I was using that for testing.

@HowardBraham
Copy link
Contributor Author

@gauthierpetetin

  • Descriptions coming from CHANGELOG entry: now start with an uppercase letter
  • Ignores commits containing keywordsToIndicateExcluded
  • metamask-extension no longer hardcoded

@gauthierpetetin
Copy link
Contributor

gauthierpetetin commented Sep 4, 2025

Thanks for the changes. I tried it out, here's the output I get for 13.3.0:

## [13.3.0]

### Uncategorized

- chore: Update Ocap kernel packages and patch @endo/env-options (#35526)
- chore: Bump main version to 13.4.0 (#35504)
- Improved multichain address list by filtering out test networks and refining layout (#35380)
- INFRA-2867: Skip version bump PR creation if already exists, commit in main (#35480)
- Bitcoin v1 release. (#35404)
- chore: migrate swap experience to BIP-44 selectors (#35220)
- INFRA-2867: Update inputs for workflow, update input parameter (#35399)
- chore: replace deprecated button components (#34098)
- chore: bump {`ens`,`gas-fee`,`notification-services`}-controller to {`^17`,`^24`,`^16`} (#35360)
- chore(deps): bump @metamask/message-signing-snap to v1.1.3 (#34364)
- chore: bump assets controllers to v73.3.0 (#35283)
- chore: Bump Snaps packages (#35356)
- Updated portfolio.metamask.io links to app.metamask.io (#35221)
- Bitcoin uses DIN endpoints (#35275)
- Upgraded @metamask/design-system-react to v0.3.1 for improved security and React 17 compatibility (#35271)
- chore: rm deprecated CrossChainSwaps events (#35127)
- chore: New Crowdin translations by Github Action (#34367)
- chore: update [email protected] (#35179)
- Bump bitcoin to v0.19.0 (#35230)
- chore: Bump main version to 13.3.0 (#35177)

### Added

- feat: Adding designs for amount input (#35510)
- feat: bump solana snap (#35511)
- feat: adding utility method for routing to send page (#35505)
- feat: capture amount metrics events (#35503)
- feat: Add max button to amount page (#35474)
- feat: Implementing send metrics context and hooks (#35461)
- feat: update SeedlessOnboarding controller to v3 (#35413)
- feat: send page implement navigations (#35416)
- feat: MetaMask Shield: Integrate Security Gateway (#35407)
- feat: swaps-2834 adds bitcoin multichain bridge chain (#35377)
- Added updates to wallet details page to handle multichain accounts (#35182)
- feat: add end-to-end tests for Trezor ERC20 token creation and management (#35382)
- feat: deprecating carousel slides (#35109)
- feat: Submit solana send to solana snap for review (#35361)
- feat: Adding amount fiat conversion and validation functions (#35346)
- feat: Add security alerts config option (#35396)
- feat: Adding header component on send page (#35326)
- feat: Display balance on amount page (#35246)
- Added a new page to display multichain account details (#35298)
- feat: Action to handle submit for EVM send (#35188)
- feat: pass asset over to send page in url parameters (#35115)
- feat: Add send context and page navigation (#35106)
- Improve dapp connection UX when the wallet is locked (#35122)
- feat: address scan internal transaction (#34978)
- Update documentation for point to the `stable` branch instead of `master`. (#34898)
- feat: Add `useSnapNameResolution` hook (#35113)
- feat(base branch): make it possible to define name of release PR base branch (#35194)
- feat: Adding a basic send page behind an env variable (#35104)
- Added new multichain account popup menu (#35064)

### Fixed

- Fixed source for multichain account names in account picker (#35478)
- fix: plan 966 enhance ledger not supported error (#35291)
- fix: wallet lock race-condition (#35022)
- fix: insufficient number of locale subs in account-exists/not-found pages (#35414)
- Fix long account name rendering (#35343)
- fix: Clear button does not clear all textboxes with 24 words (#33364)
- fix: transactions from multiple different networks not correctly displayed in activity tab (#35231)
- fix: Fixing issue in permit signature metrics (#35203)
- fix: Remove use of networkClientId for global network to get next nonce. (#35204)
- fix: Fix mapping simulation total value for bridge and swap transaction (#35196)
- fix(action): github-tools version was not properly updated (#35197)
- Fix ui not loading in old browsers due to use `Promise.withResolvers` (#35175)
- fix: Allow Snap confirmations during chain switching (#35107)
- fix: Apply DOMPurify patch to all instances (#35169)
- fix: Unified Swaps QuotesReceived and tx event properties (#35048)
- fix: fetch swap/bridge src balances after setting quote params (#35008)

It looks good, but I think we can make some things even cleaner.

  • Some lines start with a feat/fix prefix, some don't. I think we should either have it for every line, or remove it from every line.
  • We should have a "### Changed" category, gathering all PRs with "chore:" prefix. It seems they currently fall under "### Uncategorized"
  • PRs with "INFRA-" or "New Crowdin translations" prefixes have not been ignored. It seems the strings included in keywordsToIndicateExcluded need to be set to lowercase.

XxdpavelxX added a commit to MetaMask/github-tools that referenced this pull request Sep 10, 2025
XxdpavelxX added a commit to MetaMask/github-tools that referenced this pull request Sep 10, 2025
XxdpavelxX added a commit to MetaMask/github-tools that referenced this pull request Sep 10, 2025
XxdpavelxX added a commit to MetaMask/github-tools that referenced this pull request Sep 10, 2025
XxdpavelxX added a commit to MetaMask/github-tools that referenced this pull request Sep 10, 2025
XxdpavelxX added a commit to MetaMask/github-tools that referenced this pull request Sep 10, 2025
XxdpavelxX added a commit to MetaMask/github-tools that referenced this pull request Sep 10, 2025
XxdpavelxX added a commit to MetaMask/github-tools that referenced this pull request Sep 10, 2025
XxdpavelxX added a commit to MetaMask/github-tools that referenced this pull request Sep 11, 2025
XxdpavelxX added a commit to MetaMask/github-tools that referenced this pull request Sep 11, 2025
Comment on lines 273 to 279
const keywordsToIndicateExcludedLowerCase = keywordsToIndicateExcluded.map(
(word) => word.toLowerCase(),
);

return keywordsToIndicateExcludedLowerCase.some((word) =>
_description.includes(word),
);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: might shave off a bit of time complexity?

Suggested change
const keywordsToIndicateExcludedLowerCase = keywordsToIndicateExcluded.map(
(word) => word.toLowerCase(),
);
return keywordsToIndicateExcludedLowerCase.some((word) =>
_description.includes(word),
);
return keywordsToIndicateExcluded.some((word) => {
const pattern = new RegExp(word, 'u');
return Boolean(_description.match(pattern));
});

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You were on to something here, but actually there was an even better time complexity solution, implemented in 3ea27a8

// Create a regex pattern that matches any of the ConventionalCommitTypes
const typesWithPipe = conventionalCommitTypes.join('|');
const conventionalCommitPattern = new RegExp(
`^(${typesWithPipe})\\s*(\\([^)]*\\))?:.*$`,
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice to see that parentheses e.g. build(deps): are supported.👍

MajorLift
MajorLift previously approved these changes Sep 17, 2025
Copy link
Contributor

@MajorLift MajorLift left a comment

Choose a reason for hiding this comment

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

This should be a great qol improvement for all contributors! LGTM

@HowardBraham HowardBraham reopened this Sep 17, 2025
@HowardBraham HowardBraham marked this pull request as draft September 17, 2025 17:46
MajorLift
MajorLift previously approved these changes Sep 18, 2025
@gauthierpetetin
Copy link
Contributor

gauthierpetetin commented Sep 18, 2025

Hi @howard.braham,
I did some testing again before merging the PR and identified edge cases that needed to be fixed:

I also re-tested everything locally and it looks good to me, I guess we can merge now.

cursor[bot]

This comment was marked as outdated.

@HowardBraham HowardBraham enabled auto-merge (squash) September 18, 2025 17:14
Copy link
Contributor

@MajorLift MajorLift left a comment

Choose a reason for hiding this comment

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

LGTM!

* @param repoUrl - The URL for the GitHub repository.
* @returns The repository name, or null if it could not be determined.
*/
function extractRepoName(repoUrl: string): string {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
function extractRepoName(repoUrl: string): string {
function extractRepoName(repoUrl: string | undefined): string {

@HowardBraham HowardBraham merged commit f8c5f7d into main Sep 18, 2025
26 checks passed
@HowardBraham HowardBraham deleted the parse-changelog-entry branch September 18, 2025 17:31
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.

5 participants