fix: filter last maven repository_url erros (CM-1305) - #4338
Conversation
There was a problem hiding this comment.
Pull request overview
Extends Maven SCM URL normalization to recover SVN, OpenDaylight Gerrit, and internal-host repository links.
Changes:
- Adds canonical SVN URL handling.
- Normalizes OpenDaylight Gerrit and internal SCM URLs.
- Adds regression tests and preserves complete SVN paths.
Two URL-validation bugs remain. The PR title also misspells “errors” and lacks the required JIRA key.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
maven/normalize.ts |
Parses normalized SVN repository identities. |
maven/extract.ts |
Adds SCM host and URL normalization rules. |
maven/__tests__/normalize.test.ts |
Tests the new normalization behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
6e9cf92 to
1ae132b
Compare
PR SummaryMedium Risk Overview SVN is normalized before git-oriented logic via OpenDaylight Gerrit ( Also adds Reviewed by Cursor Bugbot for commit 3d26c6c. Bugbot is set up for automated code reviews on this repo. Configure here. |
| const name = rawName ? extractGitwebRepoName(rawName) : null | ||
| if (!name) return null | ||
|
|
||
| return `https://${OPENDALIGHT_GERRIT_HOST}/gerrit/gitweb?p=${name}.git` |
| * `svn(+ssh)://` scheme) — the bare hostname is shared with non-SVN content | ||
| * (java.net hosted forums, wikis, JIRA, etc. alongside its SVN forge). | ||
| */ | ||
| const SVN_HOSTS_REQUIRE_EXPLICIT_MARKER = new Set(['java.net']) |
| // identifier (e.g. /repos/asf/geronimo/server), so splitting it into | ||
| // parts[0]/parts[1] like a git host would produce garbage (owner='repos', | ||
| // name='asf'). Keep the whole path as `name` instead. | ||
| if (isSvnHost(h)) return { host: 'svn', owner: null, name: parts.join('/') || null } |
There was a problem hiding this comment.
java.net misclassified as SVN
Medium Severity
parseRepoUrl treats every java.net URL as SVN via isSvnHost, but normalizeSvnScmUrl only accepts that host with an explicit scm:svn: or svn(+ssh):// marker. Non-SVN java.net links get host: 'svn' and a full-path name when writeRepoLink parses repository_url, diverging from normalization rules.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit ae393e9. Configure here.
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
ae393e9 to
3d26c6c
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 3d26c6c. Configure here.
| const name = p ? p.replace(/\.git$/, '') : null | ||
| return { host: 'gerrit', owner: null, name } | ||
| } | ||
|
|
There was a problem hiding this comment.
cs.android paths truncated in parseRepoUrl
Medium Severity
normalizeScmUrl now keeps full Gitiles-style paths for cs.android.com, but parseRepoUrl still splits only the first two path segments into owner and name. Enriched packages with those URLs get truncated repo metadata in writeRepoLink while repos.url stays correct.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 3d26c6c. Configure here.


Summary
Extends Maven
declared_repository_urlnormalization to recognize Subversion (SVN) URLs and a handful of remaining edge cases that previously resolved tonull, so more repository URLs get stored as a canonical link instead of being dropped.Changes
normalizeSvnScmUrl/normalizeSvnUrlinextract.ts) coveringscm:svn:connection strings,svn(+ssh)://schemes, and barehttp(s)://URLs on known SVN hosts (Apache, ObjectWeb, Sonatype, SourceForge, etc.). Apache'sviewvc,viewcvs.cgi, andrepos/asffronts are unified to the same/repos/asf/...link, mirroring the existing git host logic.java.netonly counts as SVN when explicitly marked (scm:svn:prefix orsvn(+ssh)://scheme) — the bare host is shared with non-SVN content (forums, wikis, JIRA).isSvnHostfromextract.tsand use it inparseRepoUrl(normalize.ts): SVN has no owner/repo shape, so its path is now kept whole asnameinstead of being mis-split intoowner/repo(e.g./repos/asf/geronimo/serverno longer becomesowner=repos,name=asf).ssh://host:port/...(nogit@user) as a generic Gerrit-style clone URL.?p=<repo>.git;a=summary) and the SSH clone form (ssh://git.opendaylight.org:29418/<repo>.git) into the same canonical gitweb link.Type of change
JIRA ticket
CM-1305