Details
-
Improvement
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Fixed
-
None
Description
When an owner of a SCMHead, a SCMNavigator or a SCMSource only has one such instance (or where all instances agree on terminology) we need a way to allow the implementations to declare the terminology to be used.
For example:
- The GitHub terminology for the thing represented by a SCMNavigator is an "Organization". The GitHub terminology for the thing represented by a SCMSource is a "Repository". The GitHub terminology for the thing represented by a SCMHead is variously a "Branch", "Tag" or "Pull Request"
- With Bitbucket we have SCMNavigator = "Team", SCMSource = "Repository" and SCMHead = "Branch", "Tag" or "Pull Request"
- Other SCM systems may have their own completely different terminology.
Currently, the only way to expose this information is to use a hack with an AlternativeUiTextProvider, e.g. https://github.com/jenkinsci/github-organization-folder-plugin/blob/ebdc1c8e589cf0f24b542f33c08ad885ee66d553/src/main/java/org/jenkinsci/plugins/orgfolder/github/AlternativeUiTextProviderImpl.java
The hack route is prone to errors, for example if the bitbucket-branch-source plugin wanted to apply its terminology and applied the hack, depending on which AlternativeUiTextProvider ran first, a WorkflowMultiBranchProject with two navigators, one for a BitBucket Team and the other for a GitHub Organization would randomly get the pronoun of "Team" or "Organization". (The question of what should be shown in this case is outside the scope of this change, rather being an issue for the WorkflowMultiBranchProject... a simple solution would be to just sort and join them with / giving "Organization/Team" as the pronoun)
Attachments
Issue Links
- causes
-
JENKINS-54992 Terrifying message makes me think Jenkins will delete my github repo
-
- Resolved
-
- links to
Code changed in jenkins
User: Stephen Connolly
Path:
pom.xml
src/main/java/org/jenkinsci/plugins/github_branch_source/BranchSCMHead.java
src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMNavigator.java
src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java
src/main/java/org/jenkinsci/plugins/github_branch_source/PullRequestSCMHead.java
src/main/resources/org/jenkinsci/plugins/github_branch_source/Messages.properties
http://jenkins-ci.org/commit/github-branch-source-plugin/c0557dd3fa8b53e0ff52d315424cebd8fdfd61d9
Log:
[JENKINS-38987 Follow-up] Provide implementations of getPronoun() for the SCMHead/Source/Navigator