Skip to content
This repository has been archived by the owner on Jun 9, 2021. It is now read-only.

Commit

Permalink
Updating changelog with BRANCH name bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasbjerre committed Apr 22, 2015
1 parent 37d498c commit c3c9c70
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Changelog of Pull Request Notifier for Stash.

## 1.13
* Bugfix
* Letting PULL_REQUEST_FROM_BRANCH, and PULL_REQUEST_TO_BRANCH, evaluate to branch display name. A branch with slashes in name, like "feature/branchmodmerge", will no longer be evaluated to "branchmodmerge" but keep the name "feature/branchmodmerge".

## 1.12
* Adding clone URL variables
* ${PULL_REQUEST_FROM_HTTP_CLONE_URL} Example: http://admin@localhost:7990/stash/scm/project_1/rep_1.git
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/se/bjurr/prnfs/listener/PrnfsRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import com.atlassian.stash.event.pull.PullRequestCommentAddedEvent;
import com.atlassian.stash.event.pull.PullRequestEvent;
import com.atlassian.stash.pull.PullRequestRef;
import com.atlassian.stash.repository.Repository;
import com.atlassian.stash.repository.RepositoryCloneLinksRequest;
import com.atlassian.stash.repository.RepositoryService;
Expand All @@ -22,6 +21,7 @@ public enum REPO_PROTOCOL {

public enum PrnfsVariable {
PULL_REQUEST_FROM_HASH(new Resolver() {
@SuppressWarnings("deprecation")
@Override
public String resolve(PullRequestEvent pullRequestEvent, RepositoryService repositoryService) {
return pullRequestEvent.getPullRequest().getFromRef().getLatestChangeset();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,13 @@ public void testThatAUrlWithVariableFromBranchCanBeInvokedWhenBranchIdContainsSl
notificationBuilder()
.withFieldValue(AdminFormValues.FIELDS.url,
"http://bjurr.se/${" + PrnfsVariable.PULL_REQUEST_FROM_BRANCH.name() + "}")
.withFieldValue(AdminFormValues.FIELDS.events, OPENED.name()).build()).store()
.trigger(pullRequestEventBuilder() //
.withFromRef(pullRequestRefBuilder().withId("refs/heads/branchmodmerge").withDisplayId("branchmodmerge")) //
.withId(10L).withPullRequestAction(OPENED).build()).invokedUrl(0, "http://bjurr.se/branchmodmerge");
.withFieldValue(AdminFormValues.FIELDS.events, OPENED.name()).build())
.store()
.trigger(
pullRequestEventBuilder() //
.withFromRef(
pullRequestRefBuilder().withId("refs/heads/feature/branchmodmerge").withDisplayId("feature/branchmodmerge")) //
.withId(10L).withPullRequestAction(OPENED).build()).invokedUrl(0, "http://bjurr.se/feature/branchmodmerge");
}

@Test
Expand Down

0 comments on commit c3c9c70

Please sign in to comment.