Extend PatchSetWebLink to include subject and branch name

This is useful for more complicated external links.

While at it, also extend ParentWebLink since our docs claim they should
have similar implementation in most cases.

Some tests were fixed.

Change-Id: I420161ca4cf618e45f4cec966eb4e7d45dcacab9
This commit is contained in:
Gal Paikin
2020-11-27 14:35:22 +01:00
parent fcefd46b52
commit 57c9d58f1d
10 changed files with 79 additions and 30 deletions

View File

@@ -30,10 +30,13 @@ public interface ParentWebLink extends WebLink {
*
* <p>
*
* @param projectName Name of the project
* @param commit Commit sha1 of the parent revision
* @param projectName name of the project
* @param commit commit sha1 of the parent revision
* @param subject first line of the commit message
* @param branchName target branch of the change
* @return WebLinkInfo that links to parent commit in external service, null if there should be no
* link.
*/
WebLinkInfo getParentWebLink(String projectName, String commit);
WebLinkInfo getParentWebLink(
String projectName, String commit, String subject, String branchName);
}

View File

@@ -30,10 +30,13 @@ public interface PatchSetWebLink extends WebLink {
*
* <p>
*
* @param projectName Name of the project
* @param commit Commit of the patch set
* @param projectName name of the project
* @param commit commit of the patch set
* @param subject first line of the commit message
* @param branchName target branch of the change
* @return WebLinkInfo that links to patch set in external service, null if there should be no
* link.
*/
WebLinkInfo getPatchSetWebLink(String projectName, String commit);
WebLinkInfo getPatchSetWebLink(
String projectName, String commit, String subject, String branchName);
}