Repository navigation
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Reviewed by Cursor Bugbot for commit e92c766. Configure here.
| shouldExtractPrLinks?: boolean; | ||
| }) { | ||
| const changelogLines = changelogContent.split(/(?:\r)?\n/u); // Split on either Windows or Unix line endings | ||
| const normalizedRepoUrl = repoUrl.replace(/\.git$/u, ''); |
There was a problem hiding this comment.
@omerbek Thanks for the suggestion.
parseChangelog does not make any assumption about what the repo URL is. So if you are calling this function on its own, or you're running auto-changelog and passing --repo, or you're calling validateChangelog or updateChangelog, then at each step you can pass whatever repo URL you want. And by default, the repo URL will be retrieved from package.json via readRepositoryUrlFromPackageJson, which already normalizes the URL.
So I'm not 100% sure why this would be necessary, but perhaps there's something I'm not seeing. Would you be willing to share how you are using this package?
|
This library has now been migrated into the release-tools monorepo. This PR has been locked and this repo will be archived shortly. Going forward, releases of this library will only include changes made in the release-tools repo.
|

Summary
.gitsuffix when deriving the repository name for changelog PR-link extractionparseChangelog({ shouldExtractPrLinks: true })with a.git-suffixedrepoUrlFixes MetaMask/release-tools#126.
Testing
./node_modules/.bin/eslint.cmd src/parse-changelog.ts src/parse-changelog.test.ts./node_modules/.bin/jest.cmd --runInBandNote: running only
parse-changelog.test.tspasses all 50 tests in that file, but exits non-zero because this repo enforces global coverage thresholds across the full suite.Note
Low Risk
Small, localized parsing fix with a dedicated test; no auth, security, or broad API surface changes.
Overview
Fixes PR link extraction and round-tripping when
parseChangelogis given a GitHubrepoUrlthat ends with.git(common for clone URLs).parseChangelognow strips an optional trailing.gitbefore building theChangelogand deriving the repo name used to match[#N](.../pull/N)links.extractRepoNamewas updated so the captured name does not include.git.A regression test asserts that with
shouldExtractPrLinks: true, PR numbers are extracted from a.git-suffixed URL andtoString()emits normal/pull/links without.gitin the path.Reviewed by Cursor Bugbot for commit 22c0509. Bugbot is set up for automated code reviews on this repo. Configure here.