-
-
Notifications
You must be signed in to change notification settings - Fork 151
add symbol annotations to BranchProperty and BranchPropertyStrategy subclasses #192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
6b36838
add symbol annotations to BranchProperty and BranchPropertyStrategy s…
a2b5be9
renaming symbols
d9e1755
add symbol to RateLimitBranchProperty
b713225
update symbol name for UntrustedBranchProperty
21ac3a0
add dependency management
b10a28a
Revert "add dependency management"
bbef50a
bump parent pom and jenkins version
5e44032
make classes public to let mockito mock them
23607fc
use bom and disable resuse forks for surefire
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,6 +33,7 @@ | |
| import hudson.tasks.BuildWrapper; | ||
| import hudson.tasks.Publisher; | ||
| import java.lang.reflect.Type; | ||
| import org.jenkinsci.Symbol; | ||
| import org.kohsuke.stapler.DataBoundConstructor; | ||
|
|
||
| import java.util.ArrayList; | ||
|
|
@@ -120,6 +121,7 @@ public <P extends Job<P,B>,B extends Run<P,B>> JobDecorator<P,B> jobDecorator(Cl | |
| /** | ||
| * Our {@link Descriptor}. | ||
| */ | ||
| @Symbol("untrustedBranches") | ||
|
||
| @Extension | ||
| @SuppressWarnings("unused") // instantiated by Jenkins | ||
| public static class DescriptorImpl extends BranchPropertyDescriptor { | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
DataBoundConstructorfor this class includesBuildDiscarderas an argument.BuildDiscarderis an abstract class, so I was not sure if I needed to addSymbolannotation forBuildDiscardersubclasses? The same question applies to some other classes below.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, ideally we would track down all implementations of
BuildDiscarderand make sure they have symbols as well, but the only implementation I am aware of isLogRotatorand that already has a symbol, see here.That said, I don't think that
BuildRetentionBranchPropertyis intended to be directly configured by users because it doesn't show up in the UI when configuring a property strategy for a multibranch projects (not sure why, I don't see anisApplicableoverride in the descriptor), so maybe we shouldn't add a symbol for it?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do see a jelly file for
BuildRetentionBranchPropertyhere as well asUntrustedBranchPropertyhereOr does having a jelly file not always mean there is a UI element?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@car-roll Yeah, I think they might show up in the UI in some context, I'm just not sure what those contexts are, because I don't see them as options when I configure a property strategy for a Multibranch Pipeline.
UntrustedBranchPropertyimplementsBranchPropertyDescriptor.isApplicableso that it only shows up when the items inside of theMultiBranchProjectextendhudson.model.Project, butWorkflowJobdirectly extendshudson.model.Job, so it makes sense that that one didn't show up in my testing.After some digging it looks like Multibranch Pipelines have a
DescriptorVisibilityFilterthat suppressesBuildRetentionBranchPropertyandRateLimitBranchProperty, so that explains why I didn't see them either in my testing.So as far as I can tell, adding symbols to these types doesn't matter for Multibranch Pipelines, but we could still go ahead and add them for whatever projects do support them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RateLimitBranchPropertyalready has a symbol annotation so we're good to go there.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the symbol is only for the descriptor for the job property, but I think we want one on the descriptor for the branch property.