[JIRA] (JENKINS-60217) When condition for Changeset with comparator

16 views
Skip to first unread message

VictorMartinezRubio@gmail.com (JIRA)

unread,
Nov 19, 2019, 4:10:03 PM11/19/19
to jenkinsc...@googlegroups.com
Victor Martinez created an issue
 
Jenkins / New Feature JENKINS-60217
When condition for Changeset with comparator
Issue Type: New Feature New Feature
Assignee: Victor Martinez
Components: pipeline-model-definition-plugin
Created: 2019-11-19 21:09
Priority: Minor Minor
Reporter: Victor Martinez

https://issues.jenkins-ci.org/browse/JENKINS-48523  added support to the tag when condition with the comparator. 

At the moment, the branch when condition does support GLOB, but no REGEXP patterns. Let's standardize the branch condition format as done with the tag condition.


when {
    branch "release-*"
}
when {
    branch pattern: "release-*", comparator: "GLOB"
} 
when {
    branch pattern: "release-\\d+", comparator: "REGEXP"
} 
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

VictorMartinezRubio@gmail.com (JIRA)

unread,
Nov 19, 2019, 4:11:02 PM11/19/19
to jenkinsc...@googlegroups.com

VictorMartinezRubio@gmail.com (JIRA)

unread,
Nov 19, 2019, 4:11:02 PM11/19/19
to jenkinsc...@googlegroups.com
Victor Martinez updated an issue
https://issues.jenkins-ci.org/browse/JENKINS-48523  added support to the tag when condition with the comparator. 

At the moment, the branch changeset when condition does support GLOB, but no REGEXP patterns. Let's standardize the branch changeset condition format as done with the tag condition.
{code:java}

when {
    branch     changeset " release- * */*.java "
}
when {
    branch     changeset pattern: " release- * */*.java ", comparator: "GLOB"
}
when {
    branch     changeset pattern: " release- .* \\ d+ .java ", comparator: "REGEXP"
} {code}

jonathand131@gmail.com (JIRA)

unread,
Dec 6, 2019, 4:13:02 AM12/6/19
to jenkinsc...@googlegroups.com
Jonathan Delizy commented on New Feature JENKINS-60217
 
Re: When condition for Changeset with comparator

The v1.5.0 of pipeline-model-definition-plugin is released and include implementation of this ticket but documentation has not been updated.
This cause confusion for people like me who update the plugin, have failed builds caused by this breaking change and found contradictory information between the error message and current documentation.

I have previously seen alerts in the Update Center about possible incompatible configuration before updating some plugins. It could have been a good idea to use the same thing to alert user of this breaking change before they update.

VictorMartinezRubio@gmail.com (JIRA)

unread,
Dec 6, 2019, 5:03:03 AM12/6/19
to jenkinsc...@googlegroups.com
Victor Martinez resolved as Fixed
 
Change By: Victor Martinez
Status: Open Resolved
Resolution: Fixed

VictorMartinezRubio@gmail.com (JIRA)

unread,
Dec 6, 2019, 5:07:03 AM12/6/19
to jenkinsc...@googlegroups.com
Victor Martinez commented on New Feature JENKINS-60217
 
Re: When condition for Changeset with comparator

Jonathan Delizy, may I ask you to raise another ticket with the details of the error?

 

For the docs:
https://github.com/jenkins-infra/jenkins.io/pull/2664

VictorMartinezRubio@gmail.com (JIRA)

unread,
Dec 6, 2019, 5:08:02 AM12/6/19
to jenkinsc...@googlegroups.com

jonathand131@gmail.com (JIRA)

unread,
Dec 6, 2019, 7:19:03 AM12/6/19
to jenkinsc...@googlegroups.com
Jonathan Delizy commented on New Feature JENKINS-60217
 
Re: When condition for Changeset with comparator

Victor Martinez:
Thanks for the update of the documentation.
It is not yet visible on https://jenkins.io/doc/book/pipeline/syntax/#when but I think it is a matter of time since the PR is merged.

About the error, it is that the syntax changeset glob: "*/.java" is not supported anymore, glob must be replaced by pattern.
This syntax was in the example on the documentation page.
It is the consequence of this ticket. I suppose it is intentional so I don't think I need to open a bug for that. Should I ?

Reply all
Reply to author
Forward
0 new messages