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 Bitbucket Cloud provider #789
Conversation
Codecov Report
@@ Coverage Diff @@
## main #789 +/- ##
==========================================
+ Coverage 81.33% 81.38% +0.04%
==========================================
Files 72 73 +1
Lines 3820 3830 +10
==========================================
+ Hits 3107 3117 +10
Misses 713 713
Continue to review full report at Codecov.
|
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.
Fantastic. Thank you.
The failure in AzP looks unrelated to your change. I've queued a fresh build of the |
public class BitbucketCloud : ICloudBuild | ||
{ | ||
/// <inheritdoc /> | ||
public bool IsApplicable => !string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("BITBUCKET_REPO_SLUG")); |
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.
There is a risk of a false positive, if BITBUCKET_REPO_SLUG is defined by a Jenkins pipeline using Bitbucket Server, for example. Because Atlassian uses the "repository slug" term in REST API documentation, a pipeline author might use that name. Some other variable from https://support.atlassian.com/bitbucket-cloud/docs/variables-and-secrets/ might have a lower risk of such a conflict. BITBUCKET_PIPELINE_UUID looks most suitable, as Bitbucket Data Center and Server don't have pipelines, and Jenkins pipelines don't have UUIDs.
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 see your point. If we really want to be on the safe side, I could test for multiple environment variables that are not commonly used:
BITBUCKET_PIPELINE_UUID
BITBUCKET_STEP_UUID
BITBUCKET_STEP_TRIGGERER_UUID
The chance of anyone defining all of these variables outside of an actual Bitbucket Pipelines environment is incredibly low.
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.
Thank you for calling out this risk, @KalleOlaviNiemitalo
I see the pipeline for |
I do think this is a transient error. It appears my request to rebuild your PR got passed the prior failing point. I see you marked this PR as ready to merge, but are you planning to address the env var risk that's in the active thread? |
@AArnott sorry, missed a failed push. But seems we have the same pipeline issue again... |
I know no one asked for it, but seemed pretty straightforward to add support for Bitbucket Cloud so I did.