[JIRA] (JENKINS-60028) Jenkinsfile when changeset skipped if already built

0 views
Skip to first unread message

rittneje@gmail.com (JIRA)

unread,
Nov 2, 2019, 6:16:03 PM11/2/19
to jenkinsc...@googlegroups.com
Jesse Rittner created an issue
 
Jenkins / Bug JENKINS-60028
Jenkinsfile when changeset skipped if already built
Issue Type: Bug Bug
Assignee: Unassigned
Components: jenkinsfile-runner
Created: 2019-11-02 22:15
Priority: Minor Minor
Reporter: Jesse Rittner

I had a Jenkinsfile like this:

stage ('Test') {{{    when { changeset 'foo.txt' }}}
    steps { echo 'foo.txt in changeset' }}}{

If I push a commit that changes foo.txt, the stage executes, as expected. But if I retrigger a build of that same commit, the stage gets skipped. Worse, this happens even if the first build fails.

Is this the expected behavior? If so, I don't see how changeset could ever be useful. For example, imagine we wanted to run a linter on a file, but only if that file has changed. A developer makes changes, the stage executes, and the linter fails. Then that developer triggers another build, the stage gets skipped, and now the build passes. This defeats the entire point.

From what I've gathered, the changeset condition is comparing the incoming commit hash with the one from the previous build. But that leads to big problems if the previous build failed, or was for the same commit. I suggest the following rules: If the previous build failed (i.e., was not "SUCCESS"), or was for the same commit, that build's changeset(s) must be added to the the new build's list of changeset.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

o.v.nenashev@gmail.com (JIRA)

unread,
Apr 21, 2020, 5:01:04 AM4/21/20
to jenkinsc...@googlegroups.com
Oleg Nenashev updated an issue
Change By: Oleg Nenashev
Component/s: pipeline
Component/s: jenkinsfile-runner
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages