Interface PullRequestManager
-
- All Superinterfaces:
PullRequestSupplier
,ServerExtension
,TeamCityExtension
public interface PullRequestManager extends PullRequestSupplier
Pull request information and providers manager Please note, that due to limitations of this interface, pull request integration plugin does not support configurations that build pull requests coming from two VCS roots simultaneously.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
PullRequestManager.TargetBranchesInfo
-
Field Summary
Fields Modifier and Type Field Description static Logger
LOG
static String
LOG_CATEGORY
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
describeParameters(Map<String,String> params)
Provides a description for build feature parametersSet<String>
getBranchesOrBranchSpecs(Collection<PullRequest> pullRequests, Map<String,String> params, boolean generateBranchSpecs)
retrieve set of Rull Request bracnches or branchs specs (depends on @generateBranchSpecs)String
getBranchSpecEscapeSequence(Map<String,String> params)
Map<String,Object>
getBuildFeatureFormOptions(String vcsHostingType, SProject project, SUser user, Map<String,String> params)
List<PullRequest>
getCachedPullRequests(VcsRoot vcsRoot, SBuildType buildType, String branchRef)
Predicate<PullRequest>
getFilter(Map<String,String> parameters, BuildTypeEx buildType)
Get a composite filter that applies both the author role filter and a target branch filter if requiredList<OAuthConnectionDescriptor>
getOAuthConnections(String vcsHostingType, SProject project)
Returns OAuth available OAuth connection in a specified project for a give VCS hosting typeMap<OAuthConnectionDescriptor,Boolean>
getOAuthConnections(String vcsHostingType, SProject project, SUser user)
Returns OAuth available OAuth connection for a specified user in a specified project for a give VCS hosting typePullRequestProviderService
getProviderService(String vcsHostingType)
List<PullRequestProviderService>
getProviderServices()
Collection<PullRequest>
getPullRequests(VcsRootInstance vcsRoot, SBuildType buildType, Map<String,String> branchRevisions, boolean retrieve, boolean openOnly)
Provides open pull request information for a VCS root instanceString
getSettingsUrl(String vcsHostingType)
Returns an URL of a JSP file that renders settings corresponding the toe VCS hosting type providerPullRequestManager.TargetBranchesInfo
getTargetBranches(String providerType, SVcsRoot vcsRoot, BuildTypeTemplate template)
Return target branches information for pull requests for the given VCS root and templatePullRequestManager.TargetBranchesInfo
getTargetBranches(String providerType, VcsRootInstance vcsRootInstance, SBuildType buildType)
Return target branches information for pull requests for the given VCS root instance and build typevoid
registerProviderService(PullRequestProviderService providerService)
Register pull request providerFuture<List<PullRequest>>
schedulePullRequestsRetrieval(VcsRoot root, BuildTypeSettings buildTypeSettings, Collection<PullRequest> oldPullRequests)
Schedules extraction of information about individual pull requests from a remote system (e.g.Future<Boolean>
schedulePullRequestsRetrieval(VcsRoot root, BuildTypeSettings buildTypeSettings, Map<String,String> customParameters)
Schedules batch retrieval of the pull request information.void
testConnection(VcsRoot root, BuildTypeSettings buildTypeSettings, Map<String,String> parameters)
-
Methods inherited from interface jetbrains.buildServer.pullRequests.PullRequestSupplier
getPullRequests
-
-
-
-
Field Detail
-
LOG_CATEGORY
static final String LOG_CATEGORY
- See Also:
- Constant Field Values
-
LOG
static final Logger LOG
-
-
Method Detail
-
getSettingsUrl
@Nullable String getSettingsUrl(@NotNull String vcsHostingType)
Returns an URL of a JSP file that renders settings corresponding the toe VCS hosting type provider- Parameters:
vcsHostingType
- VCS hosting type- Returns:
- the URL if the VCS hosting type is known, null otherwise
-
getPullRequests
@NotNull Collection<PullRequest> getPullRequests(@NotNull VcsRootInstance vcsRoot, @NotNull SBuildType buildType, @NotNull Map<String,String> branchRevisions, boolean retrieve, boolean openOnly)
Provides open pull request information for a VCS root instance- Parameters:
vcsRoot
- VCS root instancebuildType
- build configurationbranchRevisions
- branch names to revisions map. This is only used to determine if the retrieval from a third party system is necessary (if allowed)retrieve
- if true, the retrieval is allowedopenOnly
-- Returns:
- pull requests information
-
getCachedPullRequests
List<PullRequest> getCachedPullRequests(@NotNull VcsRoot vcsRoot, @NotNull SBuildType buildType, @NotNull String branchRef)
- Parameters:
vcsRoot
- VCS rootbuildType
- build type for which pr feature is setbranchRef
- branch reference of a pull request branch- Returns:
- pull request information about the corresponding pull request, it is retrieved from the cache and not updated
-
getTargetBranches
PullRequestManager.TargetBranchesInfo getTargetBranches(@NotNull String providerType, @NotNull VcsRootInstance vcsRootInstance, @NotNull SBuildType buildType)
Return target branches information for pull requests for the given VCS root instance and build type- Parameters:
providerType
- pull request provider typevcsRootInstance
- VCS root instancebuildType
- Build type- Returns:
- an object that contains target branch names and last retrieval timestamp
-
getTargetBranches
PullRequestManager.TargetBranchesInfo getTargetBranches(@NotNull String providerType, @NotNull SVcsRoot vcsRoot, @NotNull BuildTypeTemplate template)
Return target branches information for pull requests for the given VCS root and template- Parameters:
providerType
- pull request provider typevcsRoot
- VCS roottemplate
- Build type or template- Returns:
- an object that contains target branch names and last retrieval timestamp
-
registerProviderService
void registerProviderService(@NotNull PullRequestProviderService providerService)
Register pull request provider- Parameters:
providerService
- pull request provider
-
getProviderServices
List<PullRequestProviderService> getProviderServices()
- Returns:
- all registered provider services
-
getProviderService
@Nullable PullRequestProviderService getProviderService(@NotNull String vcsHostingType)
- Returns:
- provider service by VCS hosting type
-
schedulePullRequestsRetrieval
@Nullable Future<List<PullRequest>> schedulePullRequestsRetrieval(@NotNull VcsRoot root, @NotNull BuildTypeSettings buildTypeSettings, @NotNull Collection<PullRequest> oldPullRequests)
Schedules extraction of information about individual pull requests from a remote system (e.g. VCS hosting provider)- Parameters:
root
- VCS root isntancebuildTypeSettings
- build type or templateoldPullRequests
- collection of pull requests to extract the information for- Returns:
- future if action is scheduled, null otherwise
-
schedulePullRequestsRetrieval
@Nullable Future<Boolean> schedulePullRequestsRetrieval(@NotNull VcsRoot root, @NotNull BuildTypeSettings buildTypeSettings, @Nullable Map<String,String> customParameters)
Schedules batch retrieval of the pull request information. The pull requests will be retrieved in an asynchronous way in a reverse order of their last updated times until one either no more pull requests to retrieve or last updated timestamp is older than maxAge (if the latter is provided)- Parameters:
root
- VCS root or VCS root instance to retrieve pull request info frombuildTypeSettings
- build configuration or template that contains relevant build featurecustomParameters
- if provided, these will be used instead of the current build feature settings- Returns:
- Completable future if the action was scheduled, null otherwise
-
testConnection
void testConnection(@NotNull VcsRoot root, @NotNull BuildTypeSettings buildTypeSettings, @NotNull Map<String,String> parameters) throws TestConnectionException, PullRequestRetrievalException
-
describeParameters
@NotNull String describeParameters(@NotNull Map<String,String> params)
Provides a description for build feature parameters- Parameters:
params
- build feature parameters- Returns:
- short textual description of the build feature parameters
-
getFilter
@Nullable Predicate<PullRequest> getFilter(@NotNull Map<String,String> parameters, BuildTypeEx buildType)
Get a composite filter that applies both the author role filter and a target branch filter if required- Parameters:
vcsHostingType
- VCS hosting typeparameters
- contributor roles filter idbuildType
-- Returns:
- see above
-
getOAuthConnections
@NotNull Map<OAuthConnectionDescriptor,Boolean> getOAuthConnections(@NotNull String vcsHostingType, @NotNull SProject project, @NotNull SUser user)
Returns OAuth available OAuth connection for a specified user in a specified project for a give VCS hosting type- Parameters:
vcsHostingType
- VCS hosting typeproject
- projectuser
- user- Returns:
- see above
-
getOAuthConnections
@NotNull List<OAuthConnectionDescriptor> getOAuthConnections(@NotNull String vcsHostingType, @NotNull SProject project)
Returns OAuth available OAuth connection in a specified project for a give VCS hosting type- Parameters:
vcsHostingType
- VCS hosting typeproject
- project- Returns:
- see above
-
getBuildFeatureFormOptions
Map<String,Object> getBuildFeatureFormOptions(String vcsHostingType, SProject project, SUser user, @NotNull Map<String,String> params)
-
getBranchesOrBranchSpecs
Set<String> getBranchesOrBranchSpecs(@NotNull Collection<PullRequest> pullRequests, @NotNull Map<String,String> params, boolean generateBranchSpecs)
retrieve set of Rull Request bracnches or branchs specs (depends on @generateBranchSpecs)- Parameters:
pullRequests
-params
- map which must contain vcs hosting typegenerateBranchSpecs
-- Returns:
- set of actual branches or branch specs
-
-