Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
renovate
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SmartDataLab
public
applications
renovate
Commits
7e7ec8cc
Commit
7e7ec8cc
authored
6 years ago
by
Rhys Arkins
Browse files
Options
Downloads
Patches
Plain Diff
refactor: remove purl namespace and name
parent
f145e886
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/datasource/maven.js
+6
-4
6 additions, 4 deletions
lib/datasource/maven.js
lib/util/purl.js
+2
-0
2 additions, 0 deletions
lib/util/purl.js
test/util/__snapshots__/purl.spec.js.snap
+0
-8
0 additions, 8 deletions
test/util/__snapshots__/purl.spec.js.snap
with
8 additions
and
12 deletions
lib/datasource/maven.js
+
6
−
4
View file @
7e7ec8cc
...
...
@@ -47,10 +47,11 @@ async function getPkgReleases(purl, config) {
}
function
getDependencyParts
(
purl
)
{
const
[
group
,
name
]
=
purl
.
lookupName
.
split
(
'
/
'
);
return
{
display
:
`
${
purl
.
namespace
}
:
${
purl
.
name
}
`
,
group
:
purl
.
namespace
,
name
:
purl
.
name
,
display
:
purl
.
lookupName
.
replace
(
'
/
'
,
'
:
'
)
,
group
,
name
,
dependencyUrl
:
generateMavenUrl
(
purl
),
};
}
...
...
@@ -132,7 +133,8 @@ async function downloadHttpProtocol(pkgUrl) {
}
function
generateMavenUrl
(
purl
)
{
return
purl
.
namespace
.
replace
(
/
\.
/g
,
'
/
'
)
+
`/
${
purl
.
name
}
`
;
const
[
group
,
name
]
=
purl
.
lookupName
.
split
(
'
/
'
);
return
group
.
replace
(
/
\.
/g
,
'
/
'
)
+
`/
${
name
}
`
;
}
function
isMavenCentral
(
pkgUrl
)
{
...
...
This diff is collapsed.
Click to expand it.
lib/util/purl.js
+
2
−
0
View file @
7e7ec8cc
...
...
@@ -44,6 +44,8 @@ function parse(input) {
}
else
{
res
.
qualifiers
=
{};
}
delete
res
.
namespace
;
delete
res
.
name
;
delete
res
.
version
;
// we don't use it
return
res
;
}
This diff is collapsed.
Click to expand it.
test/util/__snapshots__/purl.spec.js.snap
+
0
−
8
View file @
7e7ec8cc
...
...
@@ -4,8 +4,6 @@ exports[`util/purl parse() parses namespaced npm 1`] = `
Object {
"datasource": "npm",
"lookupName": "@foo/bar",
"name": "bar",
"namespace": "@foo",
"qualifiers": Object {},
}
`;
...
...
@@ -14,8 +12,6 @@ exports[`util/purl parse() parses namespaced npm with version 1`] = `
Object {
"datasource": "npm",
"lookupName": "@foo/bar",
"name": "bar",
"namespace": "@foo",
"qualifiers": Object {},
}
`;
...
...
@@ -24,7 +20,6 @@ exports[`util/purl parse() parses npm with version and 1 qualifier 1`] = `
Object {
"datasource": "npm",
"lookupName": "foo",
"name": "foo",
"qualifiers": Object {
"a": "b",
},
...
...
@@ -35,7 +30,6 @@ exports[`util/purl parse() parses npm with version and 2 qualifiers 1`] = `
Object {
"datasource": "npm",
"lookupName": "foo",
"name": "foo",
"qualifiers": Object {
"a": "b",
"c": "d",
...
...
@@ -47,7 +41,6 @@ exports[`util/purl parse() parses npm with version and 2 qualifiers and subpath
Object {
"datasource": "npm",
"lookupName": "foo",
"name": "foo",
"qualifiers": Object {
"a": "b",
"c": "d",
...
...
@@ -60,7 +53,6 @@ exports[`util/purl parse() parses simple npm 1`] = `
Object {
"datasource": "npm",
"lookupName": "foo",
"name": "foo",
"qualifiers": Object {},
}
`;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment