[JIRA] [core] (JENKINS-26420) Specifying sha1 without branch name in the notifyCommit URL triggers builds for all jobs (potentially hundreds)

2 views
Skip to first unread message

petrikvandervelde@gmail.com (JIRA)

unread,
Dec 8, 2015, 10:01:03 PM12/8/15
to jenkinsc...@googlegroups.com
Petrik van der Velde commented on Improvement JENKINS-26420
 
Re: Specifying sha1 without branch name in the notifyCommit URL triggers builds for all jobs (potentially hundreds)

I'm not the original reporter however I just noticed the same thing in the combination of TFS2015 and Jenkins. TFS2015 provides a service hook to Jenkins which sends a GET request to the following URL:

http://myjenkinsserver/git/notifyCommit?url=http:%2F%2Ftfs:8080%2Ftfs%2FProjectCollection%2FProject%2F_git%2FRepository&sha1=32b21f5e74c51d2054ffed71ddfc46f79c08a9d0

In our case each repository may have multiple builds looking at the repository but each build is looking at a different branch, e.g. we have a build looking at the master branch (branches to build = /master), one at all the feature branches (branches to build = */feature/*), etc. etc.

The problem is that the given SHA is only on a single branch (in this case feature/testintegrationwithjenkins) so I was expecting it to ONLY trigger the build that is looking at the feature branches, not the other builds. However it's triggering all builds looking at the given repository. According to the documentation that is the correct thing to do however I don't think it is. The job definition states that it will only build code that is on a given branch but this by passes that, thereby potentially building with an incorrect job configuration.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

dbeck@cloudbees.com (JIRA)

unread,
Dec 8, 2015, 10:24:02 PM12/8/15
to jenkinsc...@googlegroups.com

Petrik van der Velde Commit notifications can send a parameter branches along, so that would probably solve your problem.

petrikvandervelde@gmail.com (JIRA)

unread,
Dec 8, 2015, 11:28:03 PM12/8/15
to jenkinsc...@googlegroups.com

Yeah it probably would. The only unfortunate thing is that I don't control the way the URL is formatted. That's done by TFS Guess I'm going to have to file a bug there as well.

petrikvandervelde@gmail.com (JIRA)

unread,
May 5, 2016, 5:24:01 PM5/5/16
to jenkinsc...@googlegroups.com

Ok so version of TFS2015.1 does indeed pass the branches parameter, however this only partially resolves the issue. I still think there is an issue with the GIT plugin.

When a tag is pushed to the repository a push notification is send to jenkins as well. Because tags aren't related to a given branch only the SHA is send, thus leading back to the problem I discussed above, being that all builds for that repository are triggered regardless of the fact that the build configuration is relevant for that tag. That then leads to many failing builds.

I think the correct solution(s) would be to either ignore notifications without a branches parameter IF the user has configured the job to look at a specific branch (or set of branches) OR to give the user a configuration option to ignore notifications without the branches parameter.

mark.earl.waite@gmail.com (JIRA)

unread,
Oct 22, 2019, 9:32:40 PM10/22/19
to jenkinsc...@googlegroups.com
Mark Waite closed an issue as Incomplete
 
Jenkins / Improvement JENKINS-26420
Change By: Mark Waite
Status: Resolved Closed
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages