Skip to content

Remove git-url-parse dependency - #2934

Open
jorgeazevedo wants to merge 3 commits into
mainfrom
ja-remove-git-url-parse
Open

Remove git-url-parse dependency#2934
jorgeazevedo wants to merge 3 commits into
mainfrom
ja-remove-git-url-parse

Conversation

@jorgeazevedo

@jorgeazevedo jorgeazevedo commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

What does this change?

This removes git-url-parse and @types/git-url-parse from 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 (extracting owner/repo from 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?

URL Full name
https://github.com/guardian/cdk guardian/cdk
https://github.com/guardian/cdk.git guardian/cdk
[email protected]:guardian/cdk.git guardian/cdk
[email protected]:guardian/cdk guardian/cdk
ssh://[email protected]/guardian/cdk.git guardian/cdk
https://github.com/guardian/my-dotfiles.v2 guardian/my-dotfiles.v2

@changeset-bot

changeset-bot Bot commented Jul 9, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: cedf320

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@guardian/cdk Patch

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

@jorgeazevedo jorgeazevedo added the maintenance Departmental tracking: maintenance work, not a fix or a feature label Jul 9, 2026
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.
@jorgeazevedo
jorgeazevedo force-pushed the ja-remove-git-url-parse branch from 47c0c2b to 1e79c1e Compare July 9, 2026 15:55
@jorgeazevedo
jorgeazevedo marked this pull request as ready for review July 9, 2026 16:04
@jorgeazevedo
jorgeazevedo requested a review from a team as a code owner July 9, 2026 16:04

@akash1810 akash1810 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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 😅.

@github-actions

Copy link
Copy Markdown
Contributor

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

@github-actions github-actions Bot added the Stale label Aug 10, 2026
@jorgeazevedo

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

Copilot AI and others added 2 commits August 11, 2026 10:14

Copilot AI commented Aug 11, 2026

Copy link
Copy Markdown

@copilot resolve the merge conflicts in this pull request

Resolved the merge conflicts with main (package.json and package-lock.json). Also added a changeset for the patch release and a test for git:// protocol URLs as suggested by @akash1810. See commit 30494c5c (merge) and the follow-up commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Departmental tracking: maintenance work, not a fix or a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants