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

Conversation

Nemo157
Copy link
Contributor

@Nemo157 Nemo157 commented Feb 16, 2022

When documentation for a crate is rebuilt the builds.json can return multiple results, ordered latest first, so we must take the first element of the array rather than the last.

As an example currently https://img.shields.io/docsrs/bevy_tweening/0.3.1 is showing failing, despite the latest build in https://docs.rs/crate/bevy_tweening/0.3.1/builds.json being successful.

@shields-ci
Copy link

shields-ci commented Feb 16, 2022

Messages
📖 ✨ Thanks for your contribution to Shields, @Nemo157!

Generated by 🚫 dangerJS against 5b487e7

@shields-cd shields-cd temporarily deployed to shields-staging-pr-7613 February 17, 2022 01:28 Inactive
@calebcartwright calebcartwright added the service-badge Accepted and actionable changes, features, and bugs label Feb 17, 2022
Copy link
Member

@calebcartwright calebcartwright left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Changes look good for me, though it made me realize there's another small change worth making too if you're up for it 🙏

Comment on lines 55 to 57
const { build_status: buildStatus } = (
await this.fetch({ crate, version })
).pop()
).shift()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind changing this to just destructure the first item in the array? I realize we were already mutating it and that in practice this will typically only have one element, but there's really no need to mutate the collection the first place

When documentation for a crate is rebuilt the `builds.json` can return
multiple results, ordered latest first, so we must take the first
element of the array rather than the last.
@shields-cd shields-cd temporarily deployed to shields-staging-pr-7613 February 20, 2022 00:21 Inactive
@repo-ranger repo-ranger bot merged commit 3dc5613 into badges:master Feb 20, 2022
@Nemo157 Nemo157 deleted the fix-docsrs-multiple-builds branch June 6, 2023 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service-badge Accepted and actionable changes, features, and bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants