Package org.jboss.set.aphrodite.domain
Class PullRequest
- java.lang.Object
-
- org.jboss.set.aphrodite.domain.PullRequest
-
public class PullRequest extends Object
-
-
Constructor Summary
Constructors Constructor Description PullRequest(String id, URL url, Repository repository, Codebase codebase, PullRequestState state, String title, String body, boolean mergeable, boolean merged, MergeableState mergeableState, Date mergedAt)Deprecated.PullRequest(String id, URL url, Repository repository, Codebase codebase, PullRequestState state, String title, String body, boolean mergeable, boolean merged, MergeableState mergeableState, Date mergedAt, List<Commit> commits)PullRequest(String id, URL url, Repository repository, Codebase codebase, PullRequestState state, String title, String body, boolean mergeable, boolean merged, MergeableState mergeableState, Date mergedAt, List<Commit> commits, PullRequestHome prHome)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanaddComment(String comment)booleanaddLabel(Label label)voidapproveOnPullRequest()booleanequals(Object o)List<URL>findDependencyPullRequestsURL()Searches PR body for links of related issues.URLfindIssueURL()Searches PR body for link to related issue.PullRequestUpgradefindPullRequestUpgrade()Deprecated.- upgrade handling in processor wasnt green lit.List<PullRequest>findReferencedPullRequests()List<URL>findRelatedIssuesURL()Searches PR body for links of related issues.URLfindUpstreamIssueURL()Searches PR body for link to upstream issue.URLfindUpstreamPullRequestURL()Searches PR body for link to upstream PR.StringgetBody()CodebasegetCodebase()List<Commit>getCommits()Return list of commits for this PR - youngest at the start, oldest( first ) at the end.CommitStatusgetCommitStatus()StringgetId()List<Label>getLabels()MergeableStategetMergableState()DategetMergedAt()RepositorygetRepository()PullRequestStategetState()StringgetTitle()URLgetURL()booleanhasDependencies()inthashCode()booleanhasUpgrade()booleanhasUpgradeMeta()Deprecated.booleanisMergeable()booleanisMerged()booleanisUpgrade()booleanisUpstreamRequired()Checks if PR body contains indication that upstream work is not required.booleanremoveLabel(Label label)voidrequestChangesOnPullRequest(String comment)voidsetBody(String body)booleansetLabels(List<Label> labels)voidsetRepository(Repository repository)voidsetState(PullRequestState state)voidsetTitle(String title)StringtoString()
-
-
-
Constructor Detail
-
PullRequest
public PullRequest(String id, URL url, Repository repository, Codebase codebase, PullRequestState state, String title, String body, boolean mergeable, boolean merged, MergeableState mergeableState, Date mergedAt)
Deprecated.- Parameters:
id-url-repository-codebase-state-title-body-mergeable-merged-mergeableState-mergedAt-
-
PullRequest
public PullRequest(String id, URL url, Repository repository, Codebase codebase, PullRequestState state, String title, String body, boolean mergeable, boolean merged, MergeableState mergeableState, Date mergedAt, List<Commit> commits)
-
PullRequest
public PullRequest(String id, URL url, Repository repository, Codebase codebase, PullRequestState state, String title, String body, boolean mergeable, boolean merged, MergeableState mergeableState, Date mergedAt, List<Commit> commits, PullRequestHome prHome)
-
-
Method Detail
-
getCommits
public List<Commit> getCommits()
Return list of commits for this PR - youngest at the start, oldest( first ) at the end.- Returns:
-
getId
public String getId()
-
getURL
public URL getURL()
-
getCodebase
public Codebase getCodebase()
-
getState
public PullRequestState getState()
-
setState
public void setState(PullRequestState state)
-
getTitle
public String getTitle()
-
setTitle
public void setTitle(String title)
-
getBody
public String getBody()
-
setBody
public void setBody(String body)
-
getRepository
public Repository getRepository()
-
setRepository
public void setRepository(Repository repository)
-
isUpstreamRequired
public boolean isUpstreamRequired()
Checks if PR body contains indication that upstream work is not required.- Returns:
- is upstream required?
-
findUpstreamPullRequestURL
public URL findUpstreamPullRequestURL() throws MalformedURLException
Searches PR body for link to upstream PR.- Returns:
- upstream PR URL or null
- Throws:
MalformedURLException- if found URL is invalid
-
findUpstreamIssueURL
public URL findUpstreamIssueURL() throws MalformedURLException
Searches PR body for link to upstream issue.- Returns:
- upstream issue URL or null
- Throws:
MalformedURLException- if found URL is invalid
-
findIssueURL
public URL findIssueURL() throws MalformedURLException
Searches PR body for link to related issue.- Returns:
- related issue URL
- Throws:
MalformedURLException- if found URL is invalid
-
findRelatedIssuesURL
public List<URL> findRelatedIssuesURL() throws MalformedURLException
Searches PR body for links of related issues. TODO: Make this return at least all valid URLs, do not fail if one is invalid.- Returns:
- related issues URLs or empty list
- Throws:
MalformedURLException- if one of found URLs is invalid
-
findDependencyPullRequestsURL
public List<URL> findDependencyPullRequestsURL() throws MalformedURLException
Searches PR body for links of related issues. TODO: Make this return at least all valid URLs, do not fail if one is invalid.- Returns:
- related issues URLs or empty list
- Throws:
MalformedURLException- if one of found URLs is invalid
-
hasUpgradeMeta
public boolean hasUpgradeMeta()
Deprecated.Check if this PR has upgrade meta present.- Returns:
- Contains upgrade meta?
-
hasUpgrade
public boolean hasUpgrade()
-
findPullRequestUpgrade
public PullRequestUpgrade findPullRequestUpgrade()
Deprecated.- upgrade handling in processor wasnt green lit. Should be safe to remove.TODO: Description - I don't know what this is.
-
findReferencedPullRequests
public List<PullRequest> findReferencedPullRequests() throws NameNotFoundException
- Throws:
NameNotFoundException
-
addComment
public boolean addComment(String comment) throws NameNotFoundException
- Throws:
NameNotFoundException
-
getLabels
public List<Label> getLabels() throws NameNotFoundException
- Throws:
NameNotFoundException
-
setLabels
public boolean setLabels(List<Label> labels) throws NameNotFoundException
- Throws:
NameNotFoundException
-
addLabel
public boolean addLabel(Label label) throws NameNotFoundException
- Throws:
NameNotFoundException
-
removeLabel
public boolean removeLabel(Label label) throws NameNotFoundException
- Throws:
NameNotFoundException
-
getCommitStatus
public CommitStatus getCommitStatus() throws NameNotFoundException
- Throws:
NameNotFoundException
-
approveOnPullRequest
public void approveOnPullRequest() throws NameNotFoundException- Throws:
NameNotFoundException
-
requestChangesOnPullRequest
public void requestChangesOnPullRequest(String comment) throws NameNotFoundException
- Throws:
NameNotFoundException
-
isMergeable
public boolean isMergeable()
-
isMerged
public boolean isMerged()
-
getMergableState
public MergeableState getMergableState()
-
getMergedAt
public Date getMergedAt()
-
isUpgrade
public boolean isUpgrade()
-
hasDependencies
public boolean hasDependencies()
-
-