Skip to content

Compare canonical repo paths when deciding to show provider - #488

Open
Metastarx wants to merge 1 commit into
oss-compass:mainfrom
Metastarx:patch/apps-web-src-common-utils-format-tsx-19-
Open

Metastarx wants to merge 1 commit into
oss-compass:mainfrom
Metastarx:patch/apps-web-src-common-utils-format-tsx-19-

Conversation

@Metastarx

Copy link
Copy Markdown

Summary

Comparing repositories in the analyze view could label two unrelated projects as the same repository. The provider suffix in the legend and tooltips was decided by checking whether one repo path appeared as an arbitrary substring of the other URLs, so "apache/dubbo" matched "apache/dubbo-go" and got rendered as "apache on Github" twice, while the same repo compared across github and gitee stayed unlabeled because a trailing slash or a different letter case broke the comparison. I added a canonical repo-path helper that reduces a URL to its lowercased namespace/repo pair, ignoring host, trailing slash, case and .git, and rewrote the check to compare those canonical paths for equality, only reporting a duplicate when the same path really appears under two different providers.

Changes

apps/web/src/common/utils/format.test.tsx | 144 +++++++++++++++++++++++++++++-
 apps/web/src/common/utils/format.tsx      |  44 +++++++--
 apps/web/src/common/utils/url.test.ts     |  62 +++++++++++++
 apps/web/src/common/utils/url.ts          |  33 +++++++
 4 files changed, 273 insertions(+), 10 deletions(-)

Verification

(no test command was executed locally; build and static checks only, the repository CI is authoritative)

Checklist

  • No local test suite was run (the repository CI is authoritative)
  • The change is minimal and includes no unrelated files
  • The repository contribution guidelines were followed

…s repo paths by substring and mislabels providers

Signed-off-by: zhang hongyuan <100520587+Metastarx@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 8, 2026 18:12
@vercel

vercel Bot commented Oct 8, 2026

Copy link
Copy Markdown

@Metastarx is attempting to deploy a commit to the codersett's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

This branch has not been deployed

No deployments
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.

2 participants