Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
renovate
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
Renovate Bot
renovate
Commits
8433ad98
Unverified
Commit
8433ad98
authored
2 years ago
by
Fernando Mora
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fix(datasource/sbt-package): Fallbacks to maven when no sbt directory listing available (#18590)
Closes
https://github.com/renovatebot/renovate/issues/18589
parent
64ddabc8
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/modules/datasource/sbt-package/index.spec.ts
+15
-5
15 additions, 5 deletions
lib/modules/datasource/sbt-package/index.spec.ts
lib/modules/datasource/sbt-package/index.ts
+8
-7
8 additions, 7 deletions
lib/modules/datasource/sbt-package/index.ts
with
23 additions
and
12 deletions
lib/modules/datasource/sbt-package/index.spec.ts
+
15
−
5
View file @
8433ad98
...
@@ -32,6 +32,8 @@ describe('modules/datasource/sbt-package/index', () => {
...
@@ -32,6 +32,8 @@ describe('modules/datasource/sbt-package/index', () => {
.
get
(
'
/maven/org/scalatest/
'
)
.
get
(
'
/maven/org/scalatest/
'
)
.
reply
(
404
)
.
reply
(
404
)
.
get
(
'
/maven/org.scalatest/
'
)
.
get
(
'
/maven/org.scalatest/
'
)
.
reply
(
404
)
.
get
(
'
/maven/org/scalatest/scalatest/maven-metadata.xml
'
)
.
reply
(
404
);
.
reply
(
404
);
const
res
=
await
getPkgReleases
({
const
res
=
await
getPkgReleases
({
...
@@ -52,6 +54,10 @@ describe('modules/datasource/sbt-package/index', () => {
...
@@ -52,6 +54,10 @@ describe('modules/datasource/sbt-package/index', () => {
.
get
(
'
/maven2/com/example/empty/
'
)
.
get
(
'
/maven2/com/example/empty/
'
)
.
reply
(
200
,
''
)
.
reply
(
200
,
''
)
.
get
(
'
/maven2/com.example/
'
)
.
get
(
'
/maven2/com.example/
'
)
.
reply
(
404
)
.
get
(
'
/maven2/com/example/empty/maven-metadata.xml
'
)
.
reply
(
404
)
.
get
(
'
/maven2/com/example/empty/index.html
'
)
.
reply
(
404
);
.
reply
(
404
);
const
res
=
await
getPkgReleases
({
const
res
=
await
getPkgReleases
({
...
@@ -206,10 +212,14 @@ describe('modules/datasource/sbt-package/index', () => {
...
@@ -206,10 +212,14 @@ describe('modules/datasource/sbt-package/index', () => {
});
});
});
});
it
(
'
falls back to Maven for
GitLab-hosted packag
es
'
,
async
()
=>
{
it
(
'
falls back to Maven for
orgarization root folder non-listable repositori
es
'
,
async
()
=>
{
httpMock
httpMock
.
scope
(
'
https://gitlab.com/api/v4/projects/123/packages/maven/
'
)
.
scope
(
'
https://gitlab.com/api/v4/projects/123/packages/maven/
'
)
.
get
(
'
/org/example/example/maven-metadata.xml
'
)
.
get
(
'
/org/example/
'
)
.
reply
(
404
)
.
get
(
'
/org.example/
'
)
.
reply
(
404
)
.
get
(
'
/org/example/example_2.13/maven-metadata.xml
'
)
.
reply
(
.
reply
(
200
,
200
,
`
`
...
@@ -227,15 +237,15 @@ describe('modules/datasource/sbt-package/index', () => {
...
@@ -227,15 +237,15 @@ describe('modules/datasource/sbt-package/index', () => {
</metadata>
</metadata>
`
`
)
)
.
head
(
'
/org/example/example/1.2.3/example-1.2.3.pom
'
)
.
head
(
'
/org/example/example
_2.13
/1.2.3/example
_2.13
-1.2.3.pom
'
)
.
reply
(
200
)
.
reply
(
200
)
.
get
(
'
/org/example/example/1.2.3/example-1.2.3.pom
'
)
.
get
(
'
/org/example/example
_2.13
/1.2.3/example
_2.13
-1.2.3.pom
'
)
.
reply
(
200
);
.
reply
(
200
);
const
res
=
await
getPkgReleases
({
const
res
=
await
getPkgReleases
({
versioning
:
mavenVersioning
.
id
,
versioning
:
mavenVersioning
.
id
,
datasource
:
SbtPackageDatasource
.
id
,
datasource
:
SbtPackageDatasource
.
id
,
depName
:
'
org.example:example
'
,
depName
:
'
org.example:example
_2.13
'
,
registryUrls
:
[
registryUrls
:
[
'
https://gitlab.com/api/v4/projects/123/packages/maven/
'
,
'
https://gitlab.com/api/v4/projects/123/packages/maven/
'
,
],
],
...
...
This diff is collapsed.
Click to expand it.
lib/modules/datasource/sbt-package/index.ts
+
8
−
7
View file @
8433ad98
import
{
XmlDocument
}
from
'
xmldoc
'
;
import
{
XmlDocument
}
from
'
xmldoc
'
;
import
{
logger
}
from
'
../../../logger
'
;
import
{
logger
}
from
'
../../../logger
'
;
import
{
detectPlatform
}
from
'
../../../util/common
'
;
import
{
Http
}
from
'
../../../util/http
'
;
import
{
Http
}
from
'
../../../util/http
'
;
import
{
regEx
}
from
'
../../../util/regex
'
;
import
{
regEx
}
from
'
../../../util/regex
'
;
import
{
ensureTrailingSlash
}
from
'
../../../util/url
'
;
import
{
ensureTrailingSlash
}
from
'
../../../util/url
'
;
...
@@ -153,12 +152,6 @@ export class SbtPackageDatasource extends MavenDatasource {
...
@@ -153,12 +152,6 @@ export class SbtPackageDatasource extends MavenDatasource {
return
null
;
return
null
;
}
}
const
platform
=
detectPlatform
(
registryUrl
);
if
(
platform
===
'
gitlab
'
)
{
const
mavenReleases
=
await
super
.
getReleases
(
config
);
return
mavenReleases
;
}
const
[
groupId
,
artifactId
]
=
packageName
.
split
(
'
:
'
);
const
[
groupId
,
artifactId
]
=
packageName
.
split
(
'
:
'
);
const
groupIdSplit
=
groupId
.
split
(
'
.
'
);
const
groupIdSplit
=
groupId
.
split
(
'
.
'
);
const
artifactIdSplit
=
artifactId
.
split
(
'
_
'
);
const
artifactIdSplit
=
artifactId
.
split
(
'
_
'
);
...
@@ -200,6 +193,14 @@ export class SbtPackageDatasource extends MavenDatasource {
...
@@ -200,6 +193,14 @@ export class SbtPackageDatasource extends MavenDatasource {
}
}
}
}
logger
.
debug
(
`No versions discovered for
${
packageName
}
listing organization root package folder, fallback to maven datasource for version discovery`
);
const
mavenReleaseResult
=
await
super
.
getReleases
(
config
);
if
(
mavenReleaseResult
)
{
return
mavenReleaseResult
;
}
logger
.
debug
(
logger
.
debug
(
`No versions found for
${
packageName
}
in
${
searchRoots
.
length
}
repositories`
`No versions found for
${
packageName
}
in
${
searchRoots
.
length
}
repositories`
);
);
...
...
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