Skip to content

Commit

Permalink
first updates based on feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
hboutemy committed Dec 3, 2024
1 parent 7feaff4 commit 4963eba
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
9 changes: 4 additions & 5 deletions services/reproducible-central/reproducible-central.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ export default class ReproducibleCentral extends BaseJsonService {
static category = 'dependencies'

static route = {
base: 'reproducible-central/a',
base: 'reproducible-central/artifact',
pattern: ':groupId/:artifactId/:version',
}

static openApi = {
'/reproducible-central/a/{groupId}/{artifactId}/{version}': {
get: {
summary: 'Reproducible Central',
summary: 'Reproducible Central Artifact',
parameters: pathParams(
{
name: 'groupId',
Expand All @@ -37,8 +37,7 @@ export default class ReproducibleCentral extends BaseJsonService {
}

static defaultBadgeData = {
label: 'Reproducible Builds',
labelColor: '1e5b96',
label: 'reproducible builds',
}

static render({ message, color }) {
Expand Down Expand Up @@ -68,7 +67,7 @@ export default class ReproducibleCentral extends BaseJsonService {

async handle({ groupId, artifactId, version }) {
if (version.endsWith('-SNAPSHOT')) {
return this.constructor.render({ message: 'SNAPSHOT', color: 'grey' })
return this.constructor.render({ message: 'SNAPSHOT, not evaluated', color: 'grey' })
}

try {
Expand Down
16 changes: 8 additions & 8 deletions services/reproducible-central/reproducible-central.tester.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,51 +4,51 @@ export const t = await createServiceTester()
t.create('reproducible gav')
.get('/org.apache.maven/maven-core/3.9.9')
.expectBadge({
label: 'Reproducible Builds',
label: 'reproducible builds',
message: '47/47',
color: 'green',
})

t.create('mostly reproducible gav')
.get('/org.apache.maven/maven-core/3.8.5')
.expectBadge({
label: 'Reproducible Builds',
label: 'reproducible builds',
message: '43/47',
color: 'yellow',
})

t.create('mostly non-reproducible gav')
.get('/org.apache.maven/maven-core/3.6.3')
.expectBadge({
label: 'Reproducible Builds',
label: 'reproducible builds',
message: '2/32',
color: 'red',
})

t.create('non-rebuildable gav')
.get('/org.apache.maven/maven-core/4.0.0-alpha-2')
.expectBadge({
label: 'Reproducible Builds',
label: 'reproducible builds',
message: 'X',
color: 'red',
})

t.create('unknown v for known ga')
.get('/org.apache.maven/maven-core/3.9.9.1')
.expectBadge({
label: 'Reproducible Builds',
label: 'reproducible builds',
message: '3.9.9.1',
color: 'grey',
})

t.create('unknown ga').get('/org.apache.maven/any/3.9.9').expectBadge({
label: 'Reproducible Builds',
label: 'reproducible builds',
message: 'unknown ga',
color: 'orange',
})

t.create('SNAPSHOT').get('/any/any/anything-SNAPSHOT').expectBadge({
label: 'Reproducible Builds',
message: 'SNAPSHOT',
label: 'reproducible builds',
message: 'SNAPSHOT, not evaluated',
color: 'grey',
})

0 comments on commit 4963eba

Please sign in to comment.