-
Notifications
You must be signed in to change notification settings - Fork 143
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
[JENKINS-62141] Allow more than one named exception to match each individual branch #193
base: master
Are you sure you want to change the base?
Conversation
rebased |
@dwnusbaum the same test failing in my closed PR are failing also here:
|
I think the issues were CI related. I created a test PR (#195) yesterday from one of your PRs because I thought there might be some errors with the actual workspace and finally got it to pass today just by trying again. Going to bump this PR to see if things pass now. |
Good news!! |
@nfalco79 Thanks for splitting this into a separate PR! For other reviewers, here is an earlier discussion about this change: #160 (comment). |
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'm still a little worried about this causing problems for existing users.
Whether or not we make this change, the help text for NamedExceptionsBranchPropertyStrategy
should be updated (I think by adding a help.html
file here) to clarify what the behavior is if more than one exception matches a particular branch (such as what happens if more than one exception matches but those exceptions have different configurations for the same property).
Ok I will create an help file. Actually since there are no description normally I expect the sum of all matched expression.
What do you prefer? Log a warning (if possible)? Build failure? In reals depends from the property. In my case I can add more ParameterDefinitionBranchProperty because the configuration of the property allow different behavior. Obviosly the NoTriggerBranchProperty or BuildRetentionBranchProperty is not the case so we can use the order of exception in the job definition supposing that equals and hash code can help to understand when 2 branch properties are considered the same. |
…ividual branch Fix the branch named strategy where only properties defined in the first matching exception was returned. Now the strategy gather properties of all named exception that matches the current branch.
It does not work since neither jelly section neither jelly block supports help/description attribute. I had try to wrap |
Looks like general CI issues, closing and reopening to restart |
True, but you can add a help link manually using
Screenshot (the far right help button is the new one): |
Are you ok for this or not yet? Anyway please let you concentrate on #160 that is fundamental. NamedExceptionsBranchPropertyStrategy is an extension and could be implemented in a new specific plugin by us with the desiderate behavior, the #160 it is not |
…ividual branch Add documentation
@nfalco79 For example, instead of the way it is done now, we could start by applying the defaults and then override the default when branches match the a pattern. The patterns are evaluated in the order shown in the UI, overriding any previous property of the same type. The strategy would be called "Defaults with named overrides". If you really want to keep the majority of the existing behavior, I'd still suggest creating a new strategy, called "Multi-match with Named Exceptions". This new strategy could extend the existing strategy with multi-matching. Again, this would be a safe change guaranteed not to break existing users, but which still gets the new behavior that you want. As with #160, I think this is a great idea that will have huge value to a large number of users. I look forward to merging it when it is ready. If you want to chat about this, ping me on the gitter.im channel. Thanks! |
If you agree we can add a description to make clear the actual behaviour (was not clear that named exception are mutually exclusive). I would make a point on Anyway I'm ok to create a new strategy.
|
I totally agree with this.
I also agree with this. The existing behavior seems very strange to me, but Jenkins users are good figuring out what what the current behavior is and then depend on it continuing to work the same way. 😄
Hm, I don't completely understand what you're describing. I think that only allowing one of each type/class of Let me use As another example, if a Maybe we need a |
For this reason I simply propose other method like equals that say if the BranchProperty is the same and than will be overridden following the UI sequence or not. If not than both will be applied. Also a mergeWith could be usefull in case have sense for the BranchProperty (like parameters) but not for "Pipeline speed branch/duratibilit override" where I expect exception. I mean for each BranchProperty of same class it should say: Is property A the same/equals to B? If yes than take B otherwise return B.mergeWith(A) |
any news on this? |
Fix the branch named strategy where only properties defined in the first matching exception was returned. Now the strategy gather properties of all named exception that matches the current branch.