[JENKINS-57903]- Refactor PromotionConditionDescriptor extension Point to make it Pipeline Compatible.#137
[JENKINS-57903]- Refactor PromotionConditionDescriptor extension Point to make it Pipeline Compatible.#137dernDren161 wants to merge 25 commits into
Conversation
…r dependent files
oleg-nenashev
left a comment
There was a problem hiding this comment.
This PR is definitely on the right path. But we need test automation and some Javadoc patches before it can be merged
| * Declared outside GroovyCondition as it depends on the optional 'script-security' dependency | ||
| */ | ||
| @Extension(optional = true) | ||
| public final class GroovyConditionDescriptor extends PromotionConditionDescriptor { |
There was a problem hiding this comment.
No specific reason known for this just maybe because of the Job integrity it required multiple descriptors in pipelines(maybe) , just that the code compiled correctly this way would it break sth if final is removed?
| } | ||
| return true; | ||
| } | ||
| public boolean isApplicable(AbstractProject<?,?> item) { |
There was a problem hiding this comment.
The old APIs should be deprecated
| return true; | ||
| } | ||
|
|
||
| public boolean isApplicable(AbstractProject<?,?> item) { |
There was a problem hiding this comment.
remove? Default implementation should be doing that
There was a problem hiding this comment.
@oleg-nenashev okay so changes in the return is expected having only one?
| @@ -1,10 +1,11 @@ | |||
| package hudson.plugins.promoted_builds; | |||
| package hudson.plugins.promoted_builds.pipeline; | |||
There was a problem hiding this comment.
Javadoc needs to be added according to the acceptance criteria
| import hudson.model.Run; | ||
| import hudson.model.TaskListener; | ||
| import hudson.model.User; | ||
| import hudson.model.*; |
There was a problem hiding this comment.
Please do not squash imports in the production code.
Your IDE can be reconfigured to disable it
| public boolean isApplicable(@Nonnull Job<?,?> item, TaskListener listener){ | ||
| if(item instanceof AbstractProject){ | ||
| return isApplicable((AbstractProject)item, TaskListener.NULL); | ||
| }else{ |
There was a problem hiding this comment.
minor nitpick: formatting. Leave blank spaces for if and else statements like everywhere else.
There was a problem hiding this comment.
Your IDE could be configured to do it for you
YAGNI
Cleanup README, detach CONTRIBUTING.md and add shields
Update Jenkins Core requirement to 2.138.4, use the modern Parent POM
oleg-nenashev
left a comment
There was a problem hiding this comment.
The current code breaks APIs for AbstractProjects
| } | ||
|
|
||
| public boolean isApplicable(AbstractProject<?, ?> item) { | ||
| return false; |
There was a problem hiding this comment.
Why? it will make it unusable
| @@ -0,0 +1,7 @@ | |||
| Contributing | |||
There was a problem hiding this comment.
The history got messed up after merge by me. Should not impact the delivery
| import java.io.IOException; | ||
| import java.io.PrintStream; | ||
|
|
||
| public class AddPromotionBadge extends Recorder implements SimpleBuildStep { |
There was a problem hiding this comment.
This code is still in the production scope, needs to be moved
NOTE: This PR is being built on top of this: #128 PR:
This PR is just an uplift for the original one. Besides #128 these are the additional features:
Things included in #128 :
See JENKINS-57903.
Your checklist for this pull request
Restricted(docs)ScreenShot of change:
CC
@oleg-nenashev @MadsNielsen @bicschneider @jonbrohauge