-
Notifications
You must be signed in to change notification settings - Fork 649
Fix Wrong AppVeyor badge #1050
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
Fix Wrong AppVeyor badge #1050
Conversation
this is part of fixing issue rust-lang#693 ✅ Add an id field with type Option<String> to the Appveyor badge enum variant ✅ Add id: alias('badge.attributes.id') to the appveyor badge component ✅ Add an image-url attribute, computed from the id to the appveyor badge component that checks to see if id is defined. (I've used `imageUrl` as attribute) ✅ Change the appveyor badge template to use the image-url attribute for the img src instead ✅ Publish a crate to your local instance that has the URLs dtolnay has listed for serde and manually verify the badge is displayed correctly.
added `id` field
Hi @carols10cents @dtolnay. Kindly review this PR for issue #693 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know anything about the JS side but the rest looks good to me.
Hi @mattgathu! Sorry for the delay on reviewing this-- I'm going to be pretty busy today and this weekend prepping for the start of the impl period, but I will try to get to this next week :) Thank you for your PR!! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there's a flipped conditional, but other than that looks great!
app/components/badge-appveyor.js
Outdated
imageUrl: computed('badge.attributes.id', function() { | ||
let id = this.get('badge.attributes.id'); | ||
let branch = this.get('branch'); | ||
if (id === undefined || id === null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this condition is backwards? This says if id IS undefined or id IS null, then try to use id? This should be (id !== undefined && id !== null)
, yeah? I tried making a badge using only repository
and id
and the id
isn't appearing in the image url :(
@mattgathu I think the operator also needs to be switched from |
@carols10cents @jtgeibel thank you for the bug catch! I've fixed it. |
Thank you!!! Works great now!!! bors: r+ |
1050: Fix Wrong AppVeyor badge r=carols10cents this is part of fixing issue #693 - [x] Add an id field with type Option<String> to the Appveyor badge enum variant - [x] Add id: alias('badge.attributes.id') to the appveyor badge component - [x] Add an image-url attribute, computed from the id to the appveyor badge component that checks to see if id is defined. (I've used `imageUrl` as attribute) - [x] Change the appveyor badge template to use the image-url attribute for the img src instead - [x] Publish a crate to your local instance that has the URLs dtolnay has listed for serde and manually verify the badge is displayed correctly. - [x] Send a pull request to cargo to update the badge documentation to indicate you can specify the appveyor project id if you want to use that instead. (_https://github.com/rust-lang/cargo/pull/4489_)
Build succeeded |
this is part of fixing issue #693
Add an id field with type Option to the Appveyor badge enum variant
Add id: alias('badge.attributes.id') to the appveyor badge component
Add an image-url attribute, computed from the id to the appveyor badge component that checks to see if id is defined. (I've used
imageUrl
as attribute)Change the appveyor badge template to use the image-url attribute for the img src instead
Publish a crate to your local instance that has the URLs dtolnay has listed for serde and manually verify the badge is displayed correctly.
Send a pull request to cargo to update the badge documentation to indicate you can specify the appveyor project id if you want to use that instead. (Update Appveyor badge docs cargo#4489)