I don't have a good answer for you. What I would do is:
(1) Iterate over currentBuild.changeSets
(2) let prevBuild = currentBuild.previousBuild
(3) iterate over the changesets
(4) keep going back to the previousBuild, depending on if
currentBuild.resultIsWorseOrEqualTo("UNSTABLE")
(5) gather all the changesets you need, and generate an HTML report:
https://www.cloudbees.com/blog/publishing-html-reports-pipeline
If you can find a plugin to do what you want, that would be great, but I
can't think of any offhand.
--
Craig
On Thu, Sep 6, 2018 at 10:14 AM Wouter Slob <[email protected]> wrote:
> Hi Craig,
>
> thanks for your reply!
>
> It is indeed possible to retrieve changes since the last build by
> iterating currentBuild.changeSets.
>
> But I'm actually looking for a way to visualize any / the changes since
> the last build in a Job View.
>
> I would like to indicate in the job that new changes are available that
> have not been build yet, as a way to visualize that a new build is needed.
>
> Any ideas on that?
>
> Regards,
> Wouter
>
>
> On Thursday, September 6, 2018 at 5:14:55 PM UTC+2, Craig Rodrigues wrote:
>>
>> If you look at the currentBuild variable (
>> https://ci.jenkins.io/pipeline-syntax/globals#currentBuild ), it has
>> a few things you can use:
>> - previousBuild
>> - changeSets
>>
>> You can try playing around with those, and see if you can get the
>> changesets for the current build,
>> and the previous build.
>>
>> currentBuild is of type RunWrapper, and you can see the full
>> documentation for those methods here:
>>
>>
>> https://javadoc.jenkins.io/plugin/workflow-support/org/jenkinsci/plugins/workflow/support/steps/build/RunWrapper.html
>>
>> If you get something to work, please post a code snippet.
>> --
>> Craig
>>
>> On Thu, Sep 6, 2018 at 6:43 AM Wouter Slob <[email protected]> wrote:
>>
>>> Hi,
>>>
>>> I've got several pipeline and for each pipeline I would like to indicate
>>> in the view if the last not failed build was on the latest changes.
>>> In other words: I would like to indicate per pipeline if there are
>>> changes not yet build.
>>>
>>> I've did a lot of searching, but could only find references to the
>>> "Changes Since Last Success Plugin", which does not support pipeline (and
>>> is quite out-dated).
>>>
>>> Does anybody know of an alternative?
>>>
>>> Thnx!
>>> Wouter
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Jenkins Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/jenkinsci-users/eec2945c-025c-488a-8d29-22a4862dbd96%40googlegroups.com
>>> <https://groups.google.com/d/msgid/jenkinsci-users/eec2945c-025c-488a-8d29-22a4862dbd96%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/2013eec1-e95f-4447-9085-f2190809ffd7%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/2013eec1-e95f-4447-9085-f2190809ffd7%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/CAG%3DrPVdykB2pZWb5-Yw7L0_j6PHvCLaPpC%3Dqonx4So8Z5PcsLQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.