[JIRA] (JENKINS-44849) Changeset for first run of generated job is empty

10 views
Skip to first unread message

wayne.warren.s@gmail.com (JIRA)

unread,
May 24, 2018, 4:45:02 PM5/24/18
to jenkinsc...@googlegroups.com
Wayne Warren commented on Bug JENKINS-44849
 
Re: Changeset for first run of generated job is empty

This is a pretty serious problem that significantly impairs the functionality of the `changeset` directive in declarative pipeline. I would go as far as to say that the `changeset` directive is worthless because of its counter intuitive and inconsistent behavior. It's led myself and a teammate to make several meaningless changes to our `changeset` usages to see if that would make the job run the conditional stages; of course whenever we made such changes within a PR the next build would actually run so we mistakenly thought we had fixed something.

 

Since I absolutely know some other poor fool is going to encounter this problem, this is the workaround I've come up with:

+          expression {
+            sh(returnStatus: true, script: 'git diff  origin/master --name-only | grep "^auth.*" > /dev/null') == 0
+          }

 

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

wayne.warren.s@gmail.com (JIRA)

unread,
May 24, 2018, 4:48:02 PM5/24/18
to jenkinsc...@googlegroups.com
Wayne Warren edited a comment on Bug JENKINS-44849
This is a pretty serious problem that significantly impairs the functionality of the `changeset` directive in declarative pipeline. I would go as far as to say that the `changeset` directive is worthless because of its counter intuitive and inconsistent behavior. It's led myself and a teammate to make several meaningless changes to our `changeset` usages to see if that would make the job run the conditional stages; of course whenever we made such changes within a PR the next build would actually run so we mistakenly thought we had fixed something , even though in reality all we had done was satisfy the condition under which Jenkins would actually acknowledge that changes are present in the PR as described in this ticket .


 

Since I absolutely know some other poor fool is going to encounter this problem, this is the workaround I've come up with:
{code:java}

+          expression {
+            sh(returnStatus: true, script: 'git diff  origin/master --name-only | grep "^auth.*" > /dev/null') == 0
+          }{code}
 

smazurov@gmail.com (JIRA)

unread,
Aug 23, 2018, 1:27:02 PM8/23/18
to jenkinsc...@googlegroups.com

Wayne Warren absolutely agreed - changeset is useless in any type of advanced use case. Thank you for the workaround!

This message was sent by Atlassian JIRA (v7.10.1#710002-sha1:6efc396)

benoit.guerin@gmail.com (JIRA)

unread,
Nov 16, 2018, 5:12:03 AM11/16/18
to jenkinsc...@googlegroups.com

Same on bitbucket-branch-source-plugin here : JENKINS-48687

It goes down to the git plugin itself, not computing the changelog for the first build of a new branch : JENKINS-14138

This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

nmische@gmail.com (JIRA)

unread,
Nov 19, 2018, 10:04:04 PM11/19/18
to jenkinsc...@googlegroups.com

I just ran into this today. Any update on this issue?

benoit.guerin@gmail.com (JIRA)

unread,
Nov 22, 2018, 6:03:05 PM11/22/18
to jenkinsc...@googlegroups.com
benoit guerin started work on Bug JENKINS-44849
 
Change By: benoit guerin
Status: Open In Progress

benoit.guerin@gmail.com (JIRA)

unread,
Nov 22, 2018, 6:03:06 PM11/22/18
to jenkinsc...@googlegroups.com

benoit.guerin@gmail.com (JIRA)

unread,
Nov 22, 2018, 6:03:06 PM11/22/18
to jenkinsc...@googlegroups.com

benoit.guerin@gmail.com (JIRA)

unread,
Nov 22, 2018, 6:03:07 PM11/22/18
to jenkinsc...@googlegroups.com
benoit guerin assigned an issue to Unassigned

benoit.guerin@gmail.com (JIRA)

unread,
Nov 22, 2018, 6:04:04 PM11/22/18
to jenkinsc...@googlegroups.com

benoit.guerin@gmail.com (JIRA)

unread,
Nov 22, 2018, 6:04:06 PM11/22/18
to jenkinsc...@googlegroups.com
benoit guerin stopped work on Bug JENKINS-44849
 
Change By: benoit guerin
Status: In Progress Open

jglick@cloudbees.com (JIRA)

unread,
Oct 17, 2019, 8:43:05 AM10/17/19
to jenkinsc...@googlegroups.com
Jesse Glick resolved as Duplicate
Change By: Jesse Glick
Status: Open Resolved
Resolution: Duplicate
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

chilokan@gmail.com (JIRA)

unread,
Apr 23, 2020, 6:18:04 PM4/23/20
to jenkinsc...@googlegroups.com
Nicolas Forney commented on Bug JENKINS-44849
 
Re: Changeset for first run of generated job is empty

Wayne Warren your workaround works only if you are always branching from master. In our team developers often branch from other developers branch or from a develop branch. And with Git there is no way to really know from which branch a branch as been created (they are only tags).

I really wish Jenkins will be able to tell me which commit are affected on the first build. But apparently this issue has been open for years without any progress.

This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages