Skip to content

Commit

Permalink
Merge pull request #493 from timja/raw
Browse files Browse the repository at this point in the history
[JENKINS-74811] Allow reverting the pull request title change
  • Loading branch information
jtnord authored Nov 5, 2024
2 parents fad0c47 + e6d18c5 commit 20ee565
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,16 @@ public String generateName(@NonNull final String rawName, final String displayNa
return format("%s (%s)", displayName, cleanedUpBranchName);
}
},
/**
* Use the raw name.
*/
RAW(true, Messages._MultiBranchProjectDisplayNamingTrait_Raw()) {
@Override
public String generateName(@NonNull final String rawName, final String displayName) {
return rawName;
}
},

;

private final boolean needsObjectDisplayName;
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/jenkins/branch/Messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ RateLimitBranchProperty.duration.year=Year
MultiBranchProject.BranchIndexing.displayName=Scan {0}
MultiBranchProject.CopyItemVeto.reason=Copying branch projects outside of their multi-branch container is not supported.
MultiBranchProjectDisplayNamingTrait.DisplayName=Job display name with fallback to name
MultiBranchProjectDisplayNamingTrait.Raw=Name only
MultiBranchProjectDisplayNamingTrait.Raw=Simple name only
MultiBranchProjectDisplayNamingTrait.RawAndDisplayName=Name and, if available, display name
MultiBranchProjectDisplayNamingTrait.TraitDisplayName=Job display name strategy
OrganizationFolder.OrganizationScan.displayName=Scan {0}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,14 @@
Value for configuration-as-code: <code>RAW_AND_OBJECT_DISPLAY_NAME</code>
</p>
</li>
<li>
<p>
<strong>Simple name:</strong>
<br>
Just the raw name
<br>
Value for configuration-as-code: <code>RAW</code>
</p>
</li>
</ul>
</div>
6 changes: 6 additions & 0 deletions src/test/java/jenkins/branch/ProjectNamingStrategyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ public void testCompositeStrategy() throws Exception {
testNamingStrategy(MultiBranchProjectDisplayNamingStrategy.RAW_AND_OBJECT_DISPLAY_NAME);
}

@Test
@Issue("JENKINS-74811")
public void testRawStrategy() throws Exception {
testNamingStrategy(MultiBranchProjectDisplayNamingStrategy.RAW);
}

@Test
@Issue("JENKINS-55348")
public void testObjectNameStrategy() throws Exception {
Expand Down

0 comments on commit 20ee565

Please sign in to comment.