Remove git-url-parse dependency - #2934
Conversation
🦋 Changeset detectedLatest commit: cedf320 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Replace the single usage of git-url-parse (extracting owner/repo from a git remote URL) with a trivial regex-based implementation in src/utils/git.ts. Remove both git-url-parse and @types/git-url-parse from dependencies, and clean up the related dependabot ignore entries.
47c0c2b to
1e79c1e
Compare
akash1810
left a comment
There was a problem hiding this comment.
Nice! I think this warrants a patch release (via npx changeset add)?
I'm reminded of https://github.com/guardian/riff-raff/blob/6ae30271355ec4909f90daae04efc81315cc8d3a/riff-raff/app/utils/VCSInfo.scala#L49-L51 - do we want to test git://github.com/guardian/cdk.git type URLs too? I can't see it being an issue TBH. I also don't know how we'd get a git protocol URL 😅.
|
This PR is stale because it has been open 30 days with no activity. Unless a comment is added or the “stale” label removed, this will be closed in 3 days |
|
@copilot resolve the merge conflicts in this pull request |
# Conflicts: # package-lock.json # package.json Co-authored-by: jorgeazevedo <[email protected]>
Co-authored-by: jorgeazevedo <[email protected]>
Resolved the merge conflicts with main (package.json and package-lock.json). Also added a changeset for the patch release and a test for |
What does this change?
This removes
git-url-parseand@types/git-url-parsefrom our dependencies.Since #2784 that we've observed that this library is maintained in a way that is not aligned with our standards. Upon investigation, our use of this library is very limited and I think can be replaced with a simple regex
Replace the single usage of
git-url-parse(extractingowner/repofrom a git remote URL) with a trivial regex-based implementation.I worked on this change with Copilot/Opus 4.6
How has this change been tested?
Unit tests show all the supported git URLs. Are they enough?
https://github.com/guardian/cdkguardian/cdkhttps://github.com/guardian/cdk.gitguardian/cdk[email protected]:guardian/cdk.gitguardian/cdk[email protected]:guardian/cdkguardian/cdkssh://[email protected]/guardian/cdk.gitguardian/cdkhttps://github.com/guardian/my-dotfiles.v2guardian/my-dotfiles.v2