Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"BITBUCKET_PULL_REQUEST_LATEST_COMMIT_FROM_SOURCE_BRANCH";
static final String BITBUCKET_PULL_REQUEST_LATEST_COMMIT_FROM_TARGET_BRANCH =
"BITBUCKET_PULL_REQUEST_LATEST_COMMIT_FROM_TARGET_BRANCH";
static final String BITBUCKET_PULL_REQUEST_IS_DRAFT = "BITBUCKET_PULL_REQUEST_IS_DRAFT";

static final Logger logger = Logger.getLogger(BitBucketPPREnvironmentContributor.class.getName());

Expand Down Expand Up @@ -193,6 +194,9 @@
String pullRequestId = action.getPullRequestId();
putEnvVar(envVars, BITBUCKET_PULL_REQUEST_ID, pullRequestId);

Boolean isPullRequestDraft = action.getPayload().getPullRequest().getDraft();
putEnvVar(envVars, BITBUCKET_PULL_REQUEST_IS_DRAFT, isPullRequestDraft ? "true" : "false");

Check warning on line 198 in src/main/java/io/jenkins/plugins/bitbucketpushandpullrequest/environment/BitBucketPPREnvironmentContributor.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Partially covered line

Line 198 is only partially covered, one branch is missing

String actor = action.getUser();
putEnvVar(envVars, BITBUCKET_ACTOR, actor);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
private String title;
private String description;
private String state;
private Boolean draft = false;
private BitBucketPPRActor author;
private @SerializedName("created_on") Date createdOn;
private @SerializedName("updated_on") Date updatedOn;
Expand Down Expand Up @@ -75,6 +76,9 @@
this.state = state;
}

public Boolean getDraft() { return draft; }
public void setDraft(final Boolean draft) { this.draft = draft; }

Check warning on line 80 in src/main/java/io/jenkins/plugins/bitbucketpushandpullrequest/model/cloud/BitBucketPPRPullRequest.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 80 is not covered by tests

public BitBucketPPRCommit getMergeCommit() {
return mergeCommit;
}
Expand Down Expand Up @@ -165,6 +169,8 @@
+ description
+ ", state="
+ state
+ ", draft="
+ draft
+ ", author="
+ author
+ ", createdOn="
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,9 @@ THE SOFTWARE.
<t:buildEnvVar name="BITBUCKET_PULL_REQUEST_LATEST_COMMIT_FROM_TARGET_BRANCH">
<j:out value="${%blurb.BITBUCKET_PULL_REQUEST_LATEST_COMMIT_FROM_TARGET_BRANCH}"/>
</t:buildEnvVar>

<t:buildEnvVar name="BITBUCKET_PULL_REQUEST_IS_DRAFT">
<j:out value="${%blurb.BITBUCKET_PULL_REQUEST_IS_DRAFT}"/>
</t:buildEnvVar>

</j:jelly>
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ blurb.REPOSITORY_LINK= Repository link - only for BB Cloud pushs (Deprecated. It
blurb.REPOSITORY_NAME=Repository name - only for BB Server pushs (Deprecated. to be removed in v2.6) (BB Server)
blurb.BITBUCKET_PULL_REQUEST_LATEST_COMMIT_FROM_SOURCE_BRANCH=Latest commit hash on the source branch
blurb.BITBUCKET_PULL_REQUEST_LATEST_COMMIT_FROM_TARGET_BRANCH=Latest commit hash on the target branch
blurb.BITBUCKET_PULL_REQUEST_IS_DRAFT=Pull Request Is Draft - only for BB Cloud pull request.
Loading