Skip to content

Commit

Permalink
Fixed JENKINS-63374
Browse files Browse the repository at this point in the history
  • Loading branch information
tzachs committed Aug 28, 2020
1 parent 4d7547d commit 4f45c11
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ freeStyleJob('test-job') {

**Changelog**

#### 1.1.21 (28. August 2020)

- Fixed [JENKINS-63374 - Bitbucket plugin changed API for the bitbucketPush trigger in an incompatible way](https://issues.jenkins-ci.org/browse/JENKINS-63374)

#### 1.1.20 (12. August 2020)

- Show what project is triggered, not just the branch name. #69
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import org.apache.commons.jelly.XMLOutput;
import org.jenkinsci.Symbol;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.DataBoundSetter;
import org.kohsuke.stapler.QueryParameter;

import javax.servlet.ServletException;
Expand All @@ -34,18 +35,21 @@
*/
public class BitBucketTrigger extends Trigger<Job<?, ?>> {

private final String overrideUrl;
private String overrideUrl;

@DataBoundConstructor
public BitBucketTrigger(String overrideUrl) {
this.overrideUrl = overrideUrl;
}
public BitBucketTrigger() { }

// notice that the name of the getter must exactly like the parameter
public String getOverrideUrl() {
return overrideUrl;
}

@DataBoundSetter
public void setOverrideUrl(String overrideUrl){
this.overrideUrl = overrideUrl;
}

/**
* Called when a POST is made.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
public class BitbucketHookJobDslExtension extends ContextExtensionPoint {
@DslExtensionMethod(context = TriggerContext.class)
public Object bitbucketPush(Runnable closure) {
return new BitBucketTrigger("");
return new BitBucketTrigger();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ public void symbolAnnotationBitbucketTrigger() throws Exception {
@SuppressWarnings("rawtypes")
@Test public void configRoundTripBitbucketTrigger() throws Exception {
PipelineTriggersJobProperty triggersProperty = new PipelineTriggersJobProperty(null);
triggersProperty.addTrigger(new BitBucketTrigger(""));
triggersProperty.addTrigger(new BitBucketTrigger());
List<JobProperty> properties = Collections.<JobProperty>singletonList(triggersProperty);
new SnippetizerTester(j).assertRoundTrip(new JobPropertyStep(properties), "properties([pipelineTriggers([bitbucketPush('')])])");
new SnippetizerTester(j).assertRoundTrip(new JobPropertyStep(properties), "properties([pipelineTriggers([bitbucketPush()])])");
}
}

0 comments on commit 4f45c11

Please sign in to comment.