Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docsrs] Use the latest build status for multiple builds #7613

Merged
merged 2 commits into from
Feb 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions services/docsrs/docsrs.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ export default class DocsRs extends BaseJsonService {
}

async handle({ crate, version = 'latest' }) {
const { build_status: buildStatus } = (
await this.fetch({ crate, version })
).pop()
const [{ build_status: buildStatus }] = await this.fetch({ crate, version })
return this.constructor.render({ version, buildStatus })
}
}
4 changes: 4 additions & 0 deletions services/docsrs/docsrs.tester.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ t.create('Failing docs')
.get('/tensorflow/0.16.1.json')
.expectBadge({ label: '[email protected]', message: 'failing' })

t.create('Multiple builds, latest passing')
.get('/bevy_tweening/0.3.1.json')
.expectBadge({ label: '[email protected]', message: 'passing' })

t.create('Getting latest version works')
.get('/rand/latest.json')
.expectBadge({
Expand Down