Skip to content
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-32823] [FIXED JENKINS-32821] Added "When no combinations to rerun" and "How to apply the regular expression to matrix" #29

Merged

Conversation

Projects
None yet
3 participants
@ikedam
Copy link
Member

ikedam commented Feb 20, 2016

JENKINS-32823

When "Rerun build only for failed parts on the matrix" is checked but no children to rerun, naginator-plugin reruns whole the matrix.
This happens following cases:

  • An aggregation process of the matrix is failed.
  • The regular expression for logs doesn't match any children.

I introduced a new configuration "When no combinations to rerun" in the "Advanced" section.

  • Rerun the matrix with all combinations
    • Behaves as before (as described above)
    • Default settings.
  • Rerun the matrix with no combinations
    • Reruns only the parent of the matrix. (amazingly, it works)
  • Don't rerun
    • Don't rerun a new build.

Though I think almost all users expect "Don't rerun" as the default configuration, I finally decided to have "Rerun the matrix with all combinations" default as:

  • For the backward compatibility.
  • I believe this feature is often used with the regular expression feature, and the field for the regular expression feature is also in "Advanced" section. Users don't miss this feature.

Screen shots:

  • For multi-configuration projects (Note that "When no combinations to rerun" in the "Advanced" section)
    newfield
  • For non multi-configuration projects: fields applicable only to multi-configuration projects are not displayed
    freestyle
@ikedam

This comment has been minimized.

Copy link
Member Author

ikedam commented Feb 20, 2016

@mjainta
This might be related to the problem in #27, and I want your review if you don't mind.
I especially want you review for whether the feature and help texts are clear and easy to understand for users.

@jenkinsadmin

This comment has been minimized.

Copy link
Member

jenkinsadmin commented Feb 20, 2016

Thank you for this pull request! Please check this document for how the Jenkins project handles pull requests.

@mjainta

This comment has been minimized.

Copy link

mjainta commented Feb 21, 2016

@ikedam
Thanks for that notification. Really thank you for letting me review the feature.

I´d have a request for it:
Me as a user wants to rerun "all failed parts of the matrix", but independent from being in the combination matrix. So for explanation...

I have three matrix jobs A, B and C.
A goes green
B matches the combination defined by in the regex
C didnt match the combination defined by in the regex
=> I want to rerun B + C only

In the configuration you describe I cant see how I can get to my needed functionality.
Was this ever an indented configuration. I would appreciate to have it working like this.

Solution: In the select I would add another option like "Rerun the matrix with all failed child-builds" with the help text "Reruns all failed child-build of the matrix, not considering whether it matches the regex or not."

@ikedam

This comment has been minimized.

Copy link
Member Author

ikedam commented Feb 22, 2016

Tthat makes sense.
I'll update the request to add a new field "How to apply regular expression to matrix" with following choices:

  • Apply to the child builds to decide to trigger the matrix.
  • Apply to the child builds to filter combinations to trigger.
  • Apply to the parent build.

Let me have some more time to work.

[FIXED JENKINS-32821] Introduced a new option "How to apply the regul…
…ar expression to matrix" which replaces "Test regular expression for the matrix parent"

@ikedam ikedam changed the title [JENKINS-32823] Added "When no combinations to rerun" [JENKINS-32823] [FIXED JENKINS-32821] Added "When no combinations to rerun" and "How to apply the regular expression to matrix" Feb 27, 2016

@ikedam

This comment has been minimized.

Copy link
Member Author

ikedam commented Feb 27, 2016

JENKINS-32821
Introduced "How to apply the regular expression to matrix".
Though this change is rather for #30, it will conflicts with this request and I decided to continue in this request.

  • Configuration page:
    regexpformatrixstrategy
  • "Test failed matrix parts, and retrigger only matched parts" depends on "Rerun build only for failed parts on the matrix" and it will be warned for inconsistent configurations:
    regexpformatrixstrategywarning
@ikedam

This comment has been minimized.

Copy link
Member Author

ikedam commented Feb 27, 2016

@mjainta
Would you review the additional change?

The changes in code have got complicated and might be difficult to review.
I want you see the screenshots and new texts in Messages.properties, and I want your comments for the new feature.

* @throws Exception
*/
@Test
public void testRegexpForMatrixChildAndRetriggerAll() throws Exception {

This comment has been minimized.

Copy link
@ikedam

ikedam Feb 27, 2016

Author Member

This is a case described by @mjainta .
axis1=value1 and axis1=value3 failed, regexp matched axis1=value1, and retriggers both axis1=value1 and axis1=value3.

This comment has been minimized.

Copy link
@mjainta

mjainta Feb 29, 2016

I like it! nice test

RegexpForMatrixStrategy.TestParent=Test the parent build
NoChildStrategy.RerunWhole.DisplayName=Rerun the matrix with all combinations
NoChildStrategy.RerunEmpty.DisplayName=Rerun the matrix with no combinations
NoChildStrategy.DontRerun.DisplayName=Don''t rerun

This comment has been minimized.

Copy link
@mjainta

mjainta Feb 29, 2016

typo? => "Don't rerun"

This comment has been minimized.

Copy link
@ikedam

ikedam Feb 29, 2016

Author Member

They are MessageFormat strings and single quotes are treated as escaping characters.
You have to write '' to represent '.

Please refer the document for MessageFormat for more details: http://docs.oracle.com/javase/6/docs/api/java/text/MessageFormat.html

@@ -1,2 +1,9 @@
NaginatorCause.Description=Started by Naginator after build {0} failure
RegexpForMatrixStrategy.TestChildrenRetriggerAll=Test failed matrix parts, and retrigger all

This comment has been minimized.

Copy link
@mjainta

mjainta Feb 29, 2016

So thats the case I described in the ticket I guess.
If so, im fine with the messages

This comment has been minimized.

Copy link
@ikedam

ikedam Feb 29, 2016

Author Member

Exactly.
That's the new feature for cases you described.

ikedam added a commit that referenced this pull request Mar 11, 2016

Merge pull request #29 from ikedam/feature/JENKINS-32823_NoTriggerFor…
…NoChild

[JENKINS-32823] [FIXED JENKINS-32821] Added "When no combinations to rerun" and "How to apply the regular expression to matrix"

@ikedam ikedam merged commit 76c78c1 into jenkinsci:master Mar 11, 2016

1 check passed

Jenkins This pull request looks good
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.