[JIRA] (JENKINS-60534) Git Status Notification Fails With Folders

0 views
Skip to first unread message

TimothyOrme@gmail.com (JIRA)

unread,
Dec 18, 2019, 6:05:02 PM12/18/19
to jenkinsc...@googlegroups.com
Tim Orme created an issue
 
Jenkins / Bug JENKINS-60534
Git Status Notification Fails With Folders
Issue Type: Bug Bug
Assignee: Kirill Merkushev
Components: github-plugin
Created: 2019-12-18 23:04
Environment: Jenkins 2.190.3
Github 1.29.5
Folders 6.10.1
Priority: Minor Minor
Reporter: Tim Orme

When using the GitHubCommitStatusSetter  class in a pipeline like so:

 

void setBuildStatus(String repo, String message, String state) {
 step([
 $class: "GitHubCommitStatusSetter",
 reposSource: [$class: "ManuallyEnteredRepositorySource", url: repo],
 contextSource: [$class: "ManuallyEnteredCommitContextSource", context: "ci/jenkins/build-status"],
 errorHandlers: [[$class: "ChangingBuildStatusErrorHandler", result: "UNSTABLE"]],
 statusResultSource: [ $class: "ConditionalStatusResultSource", results: [[$class: "AnyBuildResult", message: message, state: state]] ]
 ]);
}

The plugin will report:
ERROR: [GitHub Commit Status Setter] - Cannot retrieve Git metadata for the build, setting build result to UNSTABLE
When used in conjunction with the Folders plugin, and the parent folder has a different name than the git repo has.

So for instance, a folder structure like this correctly sets the status:

 

my-project

--- build (checks out my-project)

--- release (checks out my-project)

But one like this will fail:

 

My Project Builds

--- build (checks out my-project)

--- release (checks out my-project)

I believe this is due to the logic here: https://github.com/jenkinsci/github-plugin/blob/1f5b40a8169516b58f4c715373836dba6ff96216/src/main/java/org/jenkinsci/plugins/github/util/BuildDataHelper.java#L55

The logic is checking the parent "build" to see that it matches the checked out project URL.  There are perhaps other cases where this logic works, but when using the Folder plugin, it presumably is using the folder as the parent build, so naming your folder something different than what is contained in the git url causes it to find nothing valid.

 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages