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
d64dc70e
Unverified
Commit
d64dc70e
authored
1 year ago
by
Sergei Zharinov
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
refactor(maven): Exit early for HTML-based metadata extraction (#27752)
parent
14272f07
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/modules/datasource/maven/index.ts
+19
-21
19 additions, 21 deletions
lib/modules/datasource/maven/index.ts
with
19 additions
and
21 deletions
lib/modules/datasource/maven/index.ts
+
19
−
21
View file @
d64dc70e
...
@@ -114,6 +114,10 @@ export class MavenDatasource extends Datasource {
...
@@ -114,6 +114,10 @@ export class MavenDatasource extends Datasource {
dependency
:
MavenDependency
,
dependency
:
MavenDependency
,
repoUrl
:
string
,
repoUrl
:
string
,
):
Promise
<
ReleaseMap
>
{
):
Promise
<
ReleaseMap
>
{
if
(
!
repoUrl
.
startsWith
(
MAVEN_REPO
))
{
return
inputReleaseMap
;
}
const
cacheNs
=
'
datasource-maven:index-html-releases
'
;
const
cacheNs
=
'
datasource-maven:index-html-releases
'
;
const
cacheKey
=
`
${
repoUrl
}${
dependency
.
dependencyUrl
}
`
;
const
cacheKey
=
`
${
repoUrl
}${
dependency
.
dependencyUrl
}
`
;
let
workingReleaseMap
=
await
packageCache
.
get
<
ReleaseMap
>
(
let
workingReleaseMap
=
await
packageCache
.
get
<
ReleaseMap
>
(
...
@@ -124,7 +128,6 @@ export class MavenDatasource extends Datasource {
...
@@ -124,7 +128,6 @@ export class MavenDatasource extends Datasource {
workingReleaseMap
=
{};
workingReleaseMap
=
{};
let
retryEarlier
=
false
;
let
retryEarlier
=
false
;
try
{
try
{
if
(
repoUrl
.
startsWith
(
MAVEN_REPO
))
{
const
indexUrl
=
getMavenUrl
(
dependency
,
repoUrl
,
'
index.html
'
);
const
indexUrl
=
getMavenUrl
(
dependency
,
repoUrl
,
'
index.html
'
);
const
res
=
await
downloadHttpProtocol
(
this
.
http
,
indexUrl
);
const
res
=
await
downloadHttpProtocol
(
this
.
http
,
indexUrl
);
const
{
body
=
''
}
=
res
;
const
{
body
=
''
}
=
res
;
...
@@ -134,13 +137,9 @@ export class MavenDatasource extends Datasource {
...
@@ -134,13 +137,9 @@ export class MavenDatasource extends Datasource {
const
{
version
,
releaseTimestamp
:
timestamp
}
=
const
{
version
,
releaseTimestamp
:
timestamp
}
=
match
?.
groups
??
/* istanbul ignore next: hard to test */
{};
match
?.
groups
??
/* istanbul ignore next: hard to test */
{};
if
(
version
&&
timestamp
)
{
if
(
version
&&
timestamp
)
{
const
date
=
DateTime
.
fromFormat
(
const
date
=
DateTime
.
fromFormat
(
timestamp
,
'
yyyy-MM-dd HH:mm
'
,
{
timestamp
,
'
yyyy-MM-dd HH:mm
'
,
{
zone
:
'
UTC
'
,
zone
:
'
UTC
'
,
},
});
);
if
(
date
.
isValid
)
{
if
(
date
.
isValid
)
{
const
releaseTimestamp
=
date
.
toISO
();
const
releaseTimestamp
=
date
.
toISO
();
workingReleaseMap
[
version
]
=
{
version
,
releaseTimestamp
};
workingReleaseMap
[
version
]
=
{
version
,
releaseTimestamp
};
...
@@ -148,7 +147,6 @@ export class MavenDatasource extends Datasource {
...
@@ -148,7 +147,6 @@ export class MavenDatasource extends Datasource {
}
}
}
}
}
}
}
}
catch
(
err
)
/* istanbul ignore next */
{
}
catch
(
err
)
/* istanbul ignore next */
{
retryEarlier
=
true
;
retryEarlier
=
true
;
logger
.
debug
(
logger
.
debug
(
...
...
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