[JIRA] (JENKINS-57206) Support draft pull requests from GitHub

0 views
Skip to first unread message

asgeirn@java.net (JIRA)

unread,
Apr 27, 2019, 11:37:02 AM4/27/19
to jenkinsc...@googlegroups.com
asgeirn created an issue
 
Jenkins / Improvement JENKINS-57206
Support draft pull requests from GitHub
Issue Type: Improvement Improvement
Assignee: Unassigned
Components: github-branch-source-plugin
Created: 2019-04-27 15:36
Environment: OpenJDK 1.8.0_212-8u212-b01-1~deb9u1-b01, Jenkins 2,164.2, github-branch-source 2.4.5
os.arch amd64
os.name Linux
os.version 4.15.0-1037-azure
Priority: Minor Minor
Reporter: asgeirn

We use GitHub PRs as conditions to build prerelease version of our applications using the following pipeline clause:

{{ when { changeRequest() }}}

However, if we create the pull requests as draft pull requests (a nice feature for in-progress work), Jenkins does not detect the PR or create any build for it.  We have enabled the traits below, but I cannot find any hints regarding draft PRs:

{{ <traits>}}
{{ <org.jenkinsci.plugins.github_branch_source.BranchDiscoveryTrait>}}
{{ <strategyId>1</strategyId>}}
{{ </org.jenkinsci.plugins.github_branch_source.BranchDiscoveryTrait>}}
{{ <org.jenkinsci.plugins.github_branch_source.OriginPullRequestDiscoveryTrait>}}
{{ <strategyId>1</strategyId>}}
{{ </org.jenkinsci.plugins.github_branch_source.OriginPullRequestDiscoveryTrait>}}
{{ <org.jenkinsci.plugins.github_branch_source.ForkPullRequestDiscoveryTrait>}}
{{ <strategyId>1</strategyId>}}
{{ <trust class="org.jenkinsci.plugins.github_branch_source.ForkPullRequestDiscoveryTrait$TrustContributors"/>}}
{{ </org.jenkinsci.plugins.github_branch_source.ForkPullRequestDiscoveryTrait>}}
{{ <org.jenkinsci.plugins.github_branch_source.TagDiscoveryTrait/>}}
{{ </traits>}}

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

asgeirn@java.net (JIRA)

unread,
Apr 29, 2019, 2:06:01 AM4/29/19
to jenkinsc...@googlegroups.com
asgeirn commented on Improvement JENKINS-57206
 
Re: Support draft pull requests from GitHub

It would appear the issue is related to the GitHub webhook - after the scheduled repository scan, the PR was detected.

bitwiseman@gmail.com (JIRA)

unread,
Apr 29, 2019, 4:18:02 PM4/29/19
to jenkinsc...@googlegroups.com
Liam Newman updated an issue
 
Change By: Liam Newman
We use GitHub PRs as conditions to build prerelease version of our applications using the following pipeline clause:

{{ when \{ changeRequest() }}}

However, if we create the pull requests as _draft_ pull requests (a nice feature for in-progress work), Jenkins does not detect the PR or create any build for it.  We have enabled the traits below, but I cannot find any hints regarding draft PRs:

{{ <traits>}}
{{ <org.jenkinsci.plugins.github__branch__source.BranchDiscoveryTrait>}}
{{ <strategyId>1</strategyId>}}
{{ </org.jenkinsci.plugins.github__branch__source.BranchDiscoveryTrait>}}
{{ <org.jenkinsci.plugins.github__branch__source.OriginPullRequestDiscoveryTrait>}}
{{ <strategyId>1</strategyId>}}
{{ </org.jenkinsci.plugins.github__branch__source.OriginPullRequestDiscoveryTrait>}}
{{ <org.jenkinsci.plugins.github__branch__source.ForkPullRequestDiscoveryTrait>}}

{{ <strategyId>1</strategyId>}}
{{ <trust class="org.jenkinsci.plugins.github_branch_source.ForkPullRequestDiscoveryTrait$TrustContributors"/>}}
{{ </org.jenkinsci.plugins.github__branch__source.ForkPullRequestDiscoveryTrait>}}
{{ <org.jenkinsci.plugins.github__branch__source.TagDiscoveryTrait/>}}
{{ </traits>}}

bitwiseman@gmail.com (JIRA)

unread,
Apr 29, 2019, 4:19:01 PM4/29/19
to jenkinsc...@googlegroups.com

bitwiseman@gmail.com (JIRA)

unread,
Apr 29, 2019, 4:19:01 PM4/29/19
to jenkinsc...@googlegroups.com

bitwiseman@gmail.com (JIRA)

unread,
Apr 29, 2019, 4:20:03 PM4/29/19
to jenkinsc...@googlegroups.com

bitwiseman@gmail.com (JIRA)

unread,
Apr 29, 2019, 4:20:03 PM4/29/19
to jenkinsc...@googlegroups.com

bitwiseman@gmail.com (JIRA)

unread,
Apr 29, 2019, 4:20:03 PM4/29/19
to jenkinsc...@googlegroups.com

ben@langfeld.me (JIRA)

unread,
Aug 13, 2019, 9:19:02 PM8/13/19
to jenkinsc...@googlegroups.com
Ben Langfeld commented on Improvement JENKINS-57206
 
Re: Support draft pull requests from GitHub

I'm seeing the following event log entries when a draft PR is created:

Examining powerhome/nitro-web

  Checking branches...

  Getting remote branch benlangfeld-patch-1...

    Checking branch benlangfeld-patch-1

  1 branches were processed

  Checking pull-requests...

  Getting remote pull request #12231...

    Checking pull request #12231
      ‘Jenkinsfile’ not found
    Does not meet criteria

    Checking pull request #12231
      ‘Jenkinsfile’ not found
    Does not meet criteria

  2 pull requests were processed

Finished examining powerhome/nitro-web

The branch does of course contain a Jenkinsfile. When the same diff is used to open a non-draft PR, the Jenkinsfile is found.

ben@langfeld.me (JIRA)

unread,
Aug 13, 2019, 9:23:04 PM8/13/19
to jenkinsc...@googlegroups.com
Ben Langfeld edited a comment on Improvement JENKINS-57206
I'm seeing the following event log entries when a draft PR is created:
{code:java}

Examining powerhome/nitro-web

  Checking branches...

  Getting remote branch benlangfeld-patch-1...

    Checking branch benlangfeld-patch-1

  1 branches were processed

  Checking pull-requests...

  Getting remote pull request #12231...

    Checking pull request #12231
      ‘Jenkinsfile’ not found
    Does not meet criteria

    Checking pull request #12231
      ‘Jenkinsfile’ not found
    Does not meet criteria

  2 pull requests were processed

Finished examining powerhome/nitro-web
{code}

The branch does of course contain a Jenkinsfile. When the same diff is used to open a non-draft PR, the Jenkinsfile is found.


The only difference in the webhook received is the following:

 
{code:java}
"draft": true,
"mergeable_state": "draft",
{code}
vs

 

 
{code:java}
"draft": false,
"mergeable_state": "unknown",
{code}
This difference should not cause the divergence in detection of the Jenkinsfile, but I can't figure out what does; the code is a massive jumble of dependencies. Can someone help me unravel it so I can figure out what's going on here?

 

e.moshaya@gmail.com (JIRA)

unread,
Sep 9, 2019, 9:16:03 AM9/9/19
to jenkinsc...@googlegroups.com

Still having this issue here... We don't use draft pull requests... we keep having to delete the cache and run the scan repository again which is not ideal

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

jsoref+jenkins@gmail.com (JIRA)

unread,
Jan 21, 2020, 3:44:03 PM1/21/20
to jenkinsc...@googlegroups.com

thomas@cedar.com (JIRA)

unread,
Apr 13, 2020, 12:43:02 PM4/13/20
to jenkinsc...@googlegroups.com

I'll note that draft PRs are currently building for me, so this may have been fixed and can likely be closed.

This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

jordanjennings@gmail.com (JIRA)

unread,
Apr 13, 2020, 2:37:03 PM4/13/20
to jenkinsc...@googlegroups.com

Draft PRs working here as well now. Maybe a complete coincidence, but as soon as we upgraded after the fix for JENKINS-54126 was released everything has been working as expected.

bitwiseman@gmail.com (JIRA)

unread,
May 5, 2020, 7:21:07 PM5/5/20
to jenkinsc...@googlegroups.com
Change By: Liam Newman
Status: Fixed but Unreleased Closed

bitwiseman@gmail.com (JIRA)

unread,
May 5, 2020, 7:21:08 PM5/5/20
to jenkinsc...@googlegroups.com
Change By: Liam Newman
Status: Open Fixed but Unreleased
Resolution: Fixed
Reply all
Reply to author
Forward
0 new messages