Interface PullRequestMergeConfig
cross-repository pull requests, the target
repository's configuration controls merge behavior.
The SCM backing each repository may expose one or more strategies that are available when merging pull requests.
For SCMs which support multiple strategies, administrators can configure which strategy (or strategies) should
be available. Any enabled strategy may be selected when
merging a pull request. If an explicit strategy is not requested, the
default will be used.
The strategies to use may be configured for a specific repository, all repositories in a given project which
share the same SCM, or for all repositories of a specific SCM in all projects. If configuration has not been
applied at any of those levels, defaults provided by the SCM are used. The type can be
used to determine what level configuration was applied at.
- Since:
- 4.9
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe default number ofcommit summariesto append to the user-provided (or system-generated) message when merging a pull request. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the commit message template if it exists.intRetrieves the default strategy, which will be used automatically when merging pull requests if anexplicit strategyis not requested.Retrieves the complete set of merge strategies supported by the SCM, including thedefault strategy.getType()Retrieves the configuration type, identifying the level the configuration was applied at.
-
Field Details
-
DEFAULT_COMMIT_SUMMARIES
static final int DEFAULT_COMMIT_SUMMARIESThe default number ofcommit summariesto append to the user-provided (or system-generated) message when merging a pull request.20 was the hard-coded number of summaries to append prior to the number being made configurable in 6.7, so 20 summaries are appended by default to ensure consistent behavior.
- Since:
- 6.7
- See Also:
-
-
Method Details
-
getCommitMessageTemplate
Retrieves the commit message template if it exists. Variable substitution has not been performed on the returned template.- Returns:
- The commit message template if it exists,
Optional.empty()otherwise. - Since:
- 8.12
-
getCommitSummaries
int getCommitSummaries()- Returns:
- the number of commit summaries to append to the user-provided (or system-generated) message when
merging a pull request, which may be
0to omit summaries - Since:
- 6.7
-
getDefaultStrategy
Retrieves the default strategy, which will be used automatically when merging pull requests if anexplicit strategyis not requested. The default strategy is alwaysenabled.- Returns:
- the default merge strategy
-
getStrategies
Retrieves the complete set of merge strategies supported by the SCM, including thedefault strategy. Some of the returned strategies may not beenabled. Only enabled strategies may berequestedwhen merging pull requests, so callers should check before using a strategy from the returned set. -
getType
Retrieves the configuration type, identifying the level the configuration was applied at. Since configuration is inherited, the type may be less specific than what was requested.- Returns:
- the configuration type, used to determine what level configuration was applied at
-