Extend [Nexus] fallback logic to cover repository version badge (#4662)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
This commit is contained in:
@@ -187,11 +187,12 @@ module.exports = class Nexus extends BaseJsonService {
|
||||
return this.fetch3({ server, repo, groupId, artifactId, queryOpt })
|
||||
}
|
||||
// Most servers still use Nexus 2. Fall back to Nexus 3 if the hitting a
|
||||
// Nexus 2 endpoint returns a Bad Request (=> InvalidResponse).
|
||||
// Nexus 2 endpoint returns a Bad Request (=> InvalidResponse, for path /service/local/artifact/maven/resolve)
|
||||
// or a Not Found (for path /service/local/artifact/maven/resolve).
|
||||
try {
|
||||
return await this.fetch2({ server, repo, groupId, artifactId, queryOpt })
|
||||
} catch (e) {
|
||||
if (e instanceof InvalidResponse) {
|
||||
if (e instanceof InvalidResponse || e instanceof NotFound) {
|
||||
return this.fetch3({ server, repo, groupId, artifactId, queryOpt })
|
||||
}
|
||||
throw e
|
||||
|
||||
@@ -271,6 +271,18 @@ t.create('Nexus 3 - repository version')
|
||||
message: isVersion,
|
||||
})
|
||||
|
||||
t.create(
|
||||
'Nexus 3 - repository version valid artifact without explicit nexusVersion parameter'
|
||||
)
|
||||
.timeout(15000)
|
||||
.get(
|
||||
'/proxy-public-3rd-party-release/com.fasterxml.jackson.core/jackson-databind.json?server=https://nexus.pentaho.org'
|
||||
)
|
||||
.expectBadge({
|
||||
label: 'nexus',
|
||||
message: isVersion,
|
||||
})
|
||||
|
||||
t.create('Nexus 3 - repository version with query')
|
||||
.get(
|
||||
`/proxy-public-3rd-party-release/org.junit.jupiter/junit-jupiter.json?server=https://nexus.pentaho.org&nexusVersion=3&queryOpt=${encodeURIComponent(
|
||||
|
||||
Reference in New Issue
Block a user