This repository has been archived by the owner on Jun 9, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
280abe7
commit 475f25d
Showing
8 changed files
with
219 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,16 @@ | |
|
||
Changelog of Pull Request Notifier for Stash. | ||
|
||
## 1.5 | ||
* Using password type on password-field in admin GUI | ||
* Some new variables added | ||
* ${PULL_REQUEST_ACTION} Example: OPENED | ||
* ${PULL_REQUEST_AUTHOR_DISPLAY_NAME} Example: Administrator | ||
* ${PULL_REQUEST_AUTHOR_EMAIL} Example: [email protected] | ||
* ${PULL_REQUEST_AUTHOR_ID} Example: 1 | ||
* ${PULL_REQUEST_AUTHOR_NAME} Example: admin | ||
* ${PULL_REQUEST_AUTHOR_SLUG} Example: admin | ||
|
||
## 1.4 | ||
* Bugfix: Avoiding multiple notifications being sent from same event. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,12 @@ The Pull Request Notifier for Stash can: | |
The filter text as well as the URL support variables. These are: | ||
|
||
* ${PULL_REQUEST_ID} Example: 1 | ||
* ${PULL_REQUEST_ACTION} Example: OPENED | ||
* ${PULL_REQUEST_AUTHOR_DISPLAY_NAME} Example: Administrator | ||
* ${PULL_REQUEST_AUTHOR_EMAIL} Example: [email protected] | ||
* ${PULL_REQUEST_AUTHOR_ID} Example: 1 | ||
* ${PULL_REQUEST_AUTHOR_NAME} Example: admin | ||
* ${PULL_REQUEST_AUTHOR_SLUG} Example: admin | ||
* ${PULL_REQUEST_FROM_HASH} Example: 6053a1eaa1c009dd11092d09a72f3c41af1b59ad | ||
* ${PULL_REQUEST_FROM_ID} Example: refs/heads/branchmodmerge | ||
* ${PULL_REQUEST_FROM_REPO_ID} Example: 1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,14 @@ | |
<div class="description"> | ||
You can use variables when invoking the URL or when forming the filter string. | ||
<ul> | ||
http://bjurr.se/?COMMENTED&Administrator&[email protected]&1&admin&admin | ||
<li><b>${PULL_REQUEST_ID}</b> Example: 1</li> | ||
<li><b>${PULL_REQUEST_ACTION}</b> Example: OPENED</li> | ||
<li><b>${PULL_REQUEST_AUTHOR_DISPLAY_NAME}</b> Example: Administrator</li> | ||
<li><b>${PULL_REQUEST_AUTHOR_EMAIL}</b> Example: [email protected]</li> | ||
<li><b>${PULL_REQUEST_AUTHOR_ID}</b> Example: 1</li> | ||
<li><b>${PULL_REQUEST_AUTHOR_NAME}</b> Example: admin</li> | ||
<li><b>${PULL_REQUEST_AUTHOR_SLUG}</b> Example: admin</li> | ||
<li><b>${PULL_REQUEST_FROM_HASH}</b> Example: 6053a1eaa1c009dd11092d09a72f3c41af1b59ad</li> | ||
<li><b>${PULL_REQUEST_FROM_ID}</b> Example: refs/heads/branch_mod_merge</li> | ||
<li><b>${PULL_REQUEST_FROM_REPO_ID}</b> Example: 1</li> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
114 changes: 114 additions & 0 deletions
114
src/test/java/se/bjurr/prnfs/admin/utils/PrnfsParticipantBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
package se.bjurr.prnfs.admin.utils; | ||
|
||
import com.atlassian.stash.pull.PullRequest; | ||
import com.atlassian.stash.pull.PullRequestParticipant; | ||
import com.atlassian.stash.pull.PullRequestRole; | ||
import com.atlassian.stash.user.StashUser; | ||
import com.atlassian.stash.user.StashUserVisitor; | ||
import com.atlassian.stash.user.UserType; | ||
|
||
public class PrnfsParticipantBuilder { | ||
|
||
private String slug; | ||
private String name; | ||
private Integer id; | ||
private String displayName; | ||
private String email; | ||
|
||
private PrnfsParticipantBuilder() { | ||
} | ||
|
||
public PrnfsParticipantBuilder withDisplayName(String string) { | ||
this.displayName = string; | ||
return this; | ||
} | ||
|
||
public PrnfsParticipantBuilder withEmail(String string) { | ||
this.email = string; | ||
return this; | ||
} | ||
|
||
public PrnfsParticipantBuilder withId(Integer id) { | ||
this.id = id; | ||
return this; | ||
} | ||
|
||
public PrnfsParticipantBuilder withName(String string) { | ||
this.name = string; | ||
return this; | ||
} | ||
|
||
public PrnfsParticipantBuilder withSlug(String string) { | ||
this.slug = string; | ||
return this; | ||
} | ||
|
||
public static PrnfsParticipantBuilder prnfsParticipantBuilder() { | ||
return new PrnfsParticipantBuilder(); | ||
} | ||
|
||
public PullRequestParticipant build() { | ||
return new PullRequestParticipant() { | ||
|
||
@Override | ||
public boolean isApproved() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public StashUser getUser() { | ||
return new StashUser() { | ||
@Override | ||
public String getName() { | ||
return name; | ||
} | ||
|
||
@Override | ||
public String getEmailAddress() { | ||
return email; | ||
} | ||
|
||
@Override | ||
public boolean isActive() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public UserType getType() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public String getSlug() { | ||
return slug; | ||
} | ||
|
||
@Override | ||
public Integer getId() { | ||
return id; | ||
} | ||
|
||
@Override | ||
public String getDisplayName() { | ||
return displayName; | ||
} | ||
|
||
@Override | ||
public <T> T accept(StashUserVisitor<T> arg0) { | ||
return null; | ||
} | ||
}; | ||
} | ||
|
||
@Override | ||
public PullRequestRole getRole() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public PullRequest getPullRequest() { | ||
return null; | ||
} | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters