Recorder/Notifier execution order not enforced by Jenkins

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Recorder/Notifier execution order not enforced by Jenkins

Arnaud Tamaillon
Hello,

While the Recorder, then Notifier order is documented in the documentation:
, it seems not to be enforced by Jenkins.

https://issues.jenkins-ci.org/browse/JENKINS-37299 is a reproducer of the issue. For the anecdote, kohsuke did the 33df3bc7602e46fdbedb4966302d6dae06fe5b1e change to the claim plugin to fix http://jenkins-ci.361315.n4.nabble.com/claim-plugin-text-finder-plugin-conflict-td385850.html#none (up-to-date url matching the one in the commit message) 8 years ago, which is the exact same issue reported in this ticket.

kohsuke introduced the Recorder/Notifier distinction in Jenkins core change b63f162f75964f52118755105bee676d29da8828.
IIUC, this change has some order-enforcement mechanism via the order of publishers in the job ui, through the Publisher.DescriptorExtensionListImpl, which sorts the publishers according to their types.
This behavior can still be seen in Jenkins job configuration ui, where the potential publishers list is sorted by types, and where adding one in the jobs adds in at the same position that the one it has in the list of potential publishers.
I failed to find any other mecanism taking care of this order in the rest of the code.

While this was probably enough at some point, now that we can reorder steps by drag & dropping, and that we can do declarative pipelines, I think it is void today.

Is this issue already known from core team ? Are there any plans that will make it void for the future, or is it something that needs to be fixed?

Arnaud






--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/e8e41a50-d2b7-4535-8e44-d49491184ae3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Recorder/Notifier execution order not enforced by Jenkins

Jesse Glick-4
On Fri, Jan 5, 2018 at 4:25 PM, Arnaud Tamaillon <[hidden email]> wrote:
> now that we can reorder steps
> by drag & dropping, and that we can do declarative pipelines, I think it is
> void today.

Built-in step order is ignored by Pipeline—whatever you ask to run,
Jenkins runs, in that order. I doubt any core dev is going to spend
time changing the behavior now for the benefit of freestyle projects;
there is a risk of regression and the workarounds are simple.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr1iip7FpmZLyTaHMo3hdY_quTpom8ufM3oOY9JUGUCU0A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Recorder/Notifier execution order not enforced by Jenkins

Arnaud Tamaillon
Built-in step order is ignored by Pipeline—whatever you ask to run,
Jenkins runs, in that order. I doubt any core dev is going to spend
time changing the behavior now for the benefit of freestyle projects;
there is a risk of regression and the workarounds are simple.

That's more or less what I suspected.

To me, the main issue is that this users cannot discover this issue by themselves, especially if the issue arise in specific rare conditions.
Maybe a simple textual warning at run time in the build log about inconsistent order would be helpful, and not much of an investment?
This could also be done for pipeline users, so that they have a chance to discover the issue.

What do you think about this?

Arnaud

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/9b6df942-91af-42bd-9f74-73ae04ad74cb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Recorder/Notifier execution order not enforced by Jenkins

Daniel Beck

> On 6. Jan 2018, at 10:17, Arnaud Tamaillon <[hidden email]> wrote:
>
> This could also be done for pipeline users, so that they have a chance to discover the issue.
>

"The pipeline will behave as you defined it, rather than artificial constraints designed for freestyle jobs" will not make a good warning.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/48371746-B524-4143-B346-2F2D77EADC1F%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Recorder/Notifier execution order not enforced by Jenkins

Ulli Hafner
Well this problem is not related to pipelines. Also freestyle jobs suffer from the same problem. If the user reorders post build steps then boom (see JENKINS-22394)! Maybe the ‚order‘ attribute should be marked as deprecated. 


Am 06.01.2018 um 10:31 schrieb Daniel Beck <[hidden email]>:


On 6. Jan 2018, at 10:17, Arnaud Tamaillon <[hidden email]> wrote:

This could also be done for pipeline users, so that they have a chance to discover the issue.


"The pipeline will behave as you defined it, rather than artificial constraints designed for freestyle jobs" will not make a good warning.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/48371746-B524-4143-B346-2F2D77EADC1F%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/9B75EEAD-947C-4765-B51A-A2CBF023056A%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

signature.asc (540 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Recorder/Notifier execution order not enforced by Jenkins

Arnaud Tamaillon
In reply to this post by Daniel Beck

"The pipeline will behave as you defined it, rather than artificial constraints designed for freestyle jobs" will not make a good warning.

Agreed :)
I was more thinking about something like 'Warning: Recorder xxx is configured to run after Notifier yyy, which might result in unexpected results'.

To me it is more about making sure that a Jenkins user has a direction to search when something behave abnormally, without having to go to the plugin source code to check if the plugin is marked as a Recorder or a Notifier, which is today the only way to diagnose for certainty that something is wrong with the definition used.
The fact that we have issues reported about incorrect behaviors of plugins is also a sign that it is not matching users expectations.

At the very least, it means the javadoc is incorrect, and that plugins developers are developing publishers with incorrect assumptions.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/9ce87243-6b7c-455d-8ef2-e03f0c7127af%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Recorder/Notifier execution order not enforced by Jenkins

Jesse Glick-4
On Sat, Jan 6, 2018 at 5:25 AM, Arnaud Tamaillon <[hidden email]> wrote:
> plugins
> developers are developing publishers with incorrect assumptions.

Pretty much any publishers developed for freestyle only will have all
sorts of weird assumptions. C.f.

https://jenkins.io/doc/developer/plugin-development/pipeline-integration/#run-listeners-vs-publishers

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr0EsjE2r4xUmUUzFEpfvmTwdRHM3P2FdoV7B9v1joEjcA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.