[JIRA] (JENKINS-59980) Merge beforeOptions, beforeInput and beforeAgent into a single before attribute

11 views
Skip to first unread message

f.modler@gmx.net (JIRA)

unread,
Oct 29, 2019, 5:54:04 PM10/29/19
to jenkinsc...@googlegroups.com
Falko Modler created an issue
 
Jenkins / Improvement JENKINS-59980
Merge beforeOptions, beforeInput and beforeAgent into a single before attribute
Issue Type: Improvement Improvement
Assignee: Andrew Bayer
Components: pipeline-model-definition-plugin
Created: 2019-10-29 21:53
Priority: Minor Minor
Reporter: Falko Modler

There are now three different before attributes for when which are evaluated in this very order:

  • beforeOptions
  • beforeInput
  • beforeAgent

The documentation tries to describe this "highlander principle" but it would be much more logical and readable if there was only a single attribute before allowing only a single value of options, input or agent.
E.g.:

    when {
        before 'options'
        // ...
    }
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

f.modler@gmx.net (JIRA)

unread,
Oct 29, 2019, 6:02:03 PM10/29/19
to jenkinsc...@googlegroups.com
Falko Modler updated an issue
Change By: Falko Modler
There are now _three_ different {{before}} attributes for {{when}} which are evaluated in this very order:
- {{beforeOptions}}
- {{beforeInput}}
- {{beforeAgent}}

The documentation tries to describe this "highlander principle" but it would be much more logical and readable if there was only a single attribute {{before}} allowing only a single value of {{options}}, {{input}} or {{agent}}.
E.g.:
{noformat}

    when {
        before 'options'
        // ...
    }
{noformat}

Migration consideration: The old dedicated {{before}} attributes should not be removed right away. Instead those attributes should be marked deprecated and their usage should yield warnings in the log.

bitwiseman@gmail.com (JIRA)

unread,
Nov 4, 2019, 6:49:03 PM11/4/19
to jenkinsc...@googlegroups.com
Liam Newman updated an issue
Change By: Liam Newman
There are now _three_ different {{before}} attributes for {{when}} which are evaluated in this very order:
- {{beforeOptions}}
- {{beforeInput}}
- {{beforeAgent}}

The documentation tries to describe this "highlander principle" but it would be much more logical and readable if there was only a single attribute {{before}} allowing only a single value of {{options}}, {{input}} or {{agent}}.
E.g.:
{noformat}
    when {
        before
'options'
git
        // ...
    }
{noformat}

Migration consideration: The old dedicated {{before}} attributes should not be removed right away. Instead those attributes should be marked deprecated and their usage should yield warnings in the log.

bitwiseman@gmail.com (JIRA)

unread,
Nov 4, 2019, 6:51:02 PM11/4/19
to jenkinsc...@googlegroups.com
Liam Newman commented on Improvement JENKINS-59980
 
Re: Merge beforeOptions, beforeInput and beforeAgent into a single before attribute

This is totally doable and would likely have minimal impact.  It could even be done without changing the underlying AST representation if needed. 

bitwiseman@gmail.com (JIRA)

unread,
Nov 4, 2019, 6:52:04 PM11/4/19
to jenkinsc...@googlegroups.com
Liam Newman edited a comment on Improvement JENKINS-59980
This is totally doable and would likely have minimal impact.  It could even be done without changing the underlying AST representation if needed.


[~famod]
 

Are you interested in submitting this change? 

f.modler@gmx.net (JIRA)

unread,
Nov 4, 2019, 6:58:03 PM11/4/19
to jenkinsc...@googlegroups.com

Liam Newman While I am always glad to help improving Jenkins (plugins) I currently don't have time for this, sorry.

PS: Are you sure about changing the example from before 'options' to before git? Right now we don't have beforeGit, so do you have something new in mind?

bitwiseman@gmail.com (JIRA)

unread,
Nov 7, 2019, 2:31:03 AM11/7/19
to jenkinsc...@googlegroups.com

Ah, I was thinking we migrate to the `before '*'` style first and add other values later.  

bitwiseman@gmail.com (JIRA)

unread,
Nov 13, 2019, 8:35:02 PM11/13/19
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages