-
Notifications
You must be signed in to change notification settings - Fork 602
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
add support for Bitbucket Pipelines badges (Shields.io) #1934
Conversation
delan
commented
Dec 4, 2019
- based on Support Cirrus CI badges #1782
- link in screenshot
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @sgrif (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
@@ -68,6 +68,10 @@ pub enum Badge { | |||
branch: Option<String>, | |||
service: Option<String>, | |||
}, | |||
BitbucketPipelines { | |||
repository: String, | |||
branch: String, |
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’ve made the branch attribute required for now, because while Shields.io allows the branch to be omitted, it assumes the default branch is “master”, but Bitbucket lets you choose any branch as the default branch
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.
(strictly speaking, this is a bug that Shields.io could fix by querying the Bitbucket API for the repository’s main branch, but that’s a job for another day)
@@ -0,0 +1,6 @@ | |||
<a href="https://bitbucket.org/delan/nonymous/addon/pipelines/home#!/results/branch/{{ branch }}/page/1"> |
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.
the /page/1 is mandatory (e.g. this link doesn’t work)
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.
This URL looks like it has your username and project in it? It should use {{ repository }}
, right?
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.
good catch!
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.
fixed in 79f15b4
classNames: ['badge'], | ||
repository: alias('badge.attributes.repository'), | ||
branch: computed('badge.attributes.branch', function() { | ||
return encodeURIComponent(this.get('badge.attributes.branch')); |
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.
the URL encoding is mandatory (e.g. this link doesn’t work)
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.
The link URL should use the repository specified in the badge configuration
@@ -0,0 +1,6 @@ | |||
<a href="https://bitbucket.org/delan/nonymous/addon/pipelines/home#!/results/branch/{{ branch }}/page/1"> |
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.
This URL looks like it has your username and project in it? It should use {{ repository }}
, right?
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.
Meant to "request changes", hit the wrong button, oops!
Looks great now!! Thank you so much!!! @bors r+ |
📌 Commit 79f15b4 has been approved by |
…s10cents add support for Bitbucket Pipelines badges (Shields.io) - based on #1782 - [link in screenshot](https://bitbucket.org/delan/nonymous/addon/pipelines/home#!/results/branch/branch%2Fname%2Fwith%2Fslashes/page/1) ![screenshot](https://user-images.githubusercontent.com/465303/70138734-0545be00-16e5-11ea-9de2-3c726843f9ed.png)
☀️ Test successful - checks-travis |
document support for Bitbucket Pipelines badges - merge after rust-lang/crates.io#1934