Skip to content

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

Merged
merged 4 commits into from
Sep 23, 2017

Conversation

mattgathu
Copy link
Contributor

@mattgathu mattgathu commented Sep 13, 2017

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)

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
@mattgathu
Copy link
Contributor Author

Hi @carols10cents @dtolnay. Kindly review this PR for issue #693

@kureuil kureuil mentioned this pull request Sep 15, 2017
3 tasks
Copy link
Member

@dtolnay dtolnay left a 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.

@carols10cents
Copy link
Member

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!!

Copy link
Member

@carols10cents carols10cents left a 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!

imageUrl: computed('badge.attributes.id', function() {
let id = this.get('badge.attributes.id');
let branch = this.get('branch');
if (id === undefined || id === null) {
Copy link
Member

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 :(

@jtgeibel
Copy link
Member

@mattgathu I think the operator also needs to be switched from || to &&.

@mattgathu
Copy link
Contributor Author

@carols10cents @jtgeibel thank you for the bug catch! I've fixed it.

@carols10cents
Copy link
Member

Thank you!!! Works great now!!!

bors: r+

bors-voyager bot added a commit that referenced this pull request Sep 23, 2017
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_)
@bors-voyager
Copy link
Contributor

bors-voyager bot commented Sep 23, 2017

Build succeeded

@bors-voyager bors-voyager bot merged commit 24762a4 into rust-lang:master Sep 23, 2017
@seanprashad seanprashad mentioned this pull request Oct 19, 2017
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants