[JIRA] (JENKINS-39496) Make PullRequestSCMRevision public

4 views
Skip to first unread message

rarabaolaza@cloudbees.com (JIRA)

unread,
Nov 4, 2016, 5:09:01 AM11/4/16
to jenkinsc...@googlegroups.com
Raul Arabaolaza started work on New Feature JENKINS-39496
 
Change By: Raul Arabaolaza
Status: Open In Progress
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

rarabaolaza@cloudbees.com (JIRA)

unread,
Nov 4, 2016, 5:09:01 AM11/4/16
to jenkinsc...@googlegroups.com
Raul Arabaolaza created an issue
 
Jenkins / New Feature JENKINS-39496
Make PullRequestSCMRevision public
Issue Type: New Feature New Feature
Assignee: Raul Arabaolaza
Components: github-branch-source-plugin
Created: 2016/Nov/04 9:08 AM
Priority: Minor Minor
Reporter: Raul Arabaolaza

In a multibranch pipeline project there is the option to build PR merged with a base branch (typically master or integration branches) to ensure that changes in the final status (merged) are valid.

In this cases the revision given by the build data refers to the merge commit, not the last PR commit in the remote

`PullRequestSCMRevision` contains info about the pull hash and the base hash that is internally used to notify GitHub. This info could be very interesting to third parties like pipeline steps, but the class visibility is default so is not possible to access it.

rarabaolaza@cloudbees.com (JIRA)

unread,
Nov 4, 2016, 5:24:01 AM11/4/16
to jenkinsc...@googlegroups.com
Raul Arabaolaza updated an issue
Change By: Raul Arabaolaza
In a multibranch pipeline project there is the option to build PR merged with a base branch (typically master or integration branches) to ensure that changes in the final status (merged) are valid.

In this cases the revision given by the build data refers to the merge commit, not the last PR commit in the remote

` {{ PullRequestSCMRevision ` }} contains info about the pull hash and the base hash that is internally used to notify GitHub. This info could be very interesting to third parties like pipeline steps, but the class visibility is default so  is not possible to access it.
Add Comment Add Comment
 

rarabaolaza@cloudbees.com (JIRA)

unread,
Nov 4, 2016, 5:24:01 AM11/4/16
to jenkinsc...@googlegroups.com
Raul Arabaolaza updated an issue
 
Jenkins / Task JENKINS-39496
Make PullRequestSCMRevision public
Change By: Raul Arabaolaza
Issue Type: New Feature Task

rarabaolaza@cloudbees.com (JIRA)

unread,
Nov 4, 2016, 5:26:02 AM11/4/16
to jenkinsc...@googlegroups.com

jglick@cloudbees.com (JIRA)

unread,
Nov 7, 2016, 1:08:02 PM11/7/16
to jenkinsc...@googlegroups.com

stephen.alan.connolly@gmail.com (JIRA)

unread,
Nov 8, 2016, 5:07:01 AM11/8/16
to jenkinsc...@googlegroups.com
Change By: Stephen Connolly
Status: In Review Resolved
Resolution: Fixed

scm_issue_link@java.net (JIRA)

unread,
Nov 8, 2016, 5:07:01 AM11/8/16
to jenkinsc...@googlegroups.com
SCM/JIRA link daemon commented on Task JENKINS-39496
 
Re: Make PullRequestSCMRevision public

Code changed in jenkins
User: Raul
Path:
src/main/java/org/jenkinsci/plugins/github_branch_source/PullRequestSCMRevision.java
http://jenkins-ci.org/commit/github-branch-source-plugin/0fab37bd4700f5b61d842448910d73c784b59bac
Log:
JENKINS-39496 Make the class public

scm_issue_link@java.net (JIRA)

unread,
Nov 8, 2016, 5:07:01 AM11/8/16
to jenkinsc...@googlegroups.com
 
Re: Make PullRequestSCMRevision public

Code changed in jenkins
User: Stephen Connolly
Path:
src/main/java/org/jenkinsci/plugins/github_branch_source/PullRequestSCMRevision.java
http://jenkins-ci.org/commit/github-branch-source-plugin/291c28d8441dcd366a78f5f68ff1a4651b25be87
Log:
Merge pull request #89 from raul-arabaolaza/JENKINS-39496

JENKINS-39496 Make PullRequestSCMRevision public

Compare: https://github.com/jenkinsci/github-branch-source-plugin/compare/a96cb1ff7635...291c28d8441d

scm_issue_link@java.net (JIRA)

unread,
Nov 28, 2016, 9:50:01 AM11/28/16
to jenkinsc...@googlegroups.com
 
Re: Make PullRequestSCMRevision public

Code changed in jenkins
User: Raul
Path:
src/main/java/org/jenkinsci/plugins/github_branch_source/PullRequestSCMRevision.java
http://jenkins-ci.org/commit/github-branch-source-plugin/ea48c2100ad4f846e848458510dce4f5e3d1950d


Log:
JENKINS-39496 Make the class public

dreich@nucleushealth.io (JIRA)

unread,
Oct 4, 2019, 11:13:02 AM10/4/19
to jenkinsc...@googlegroups.com
David Reich commented on Task JENKINS-39496
 
Re: Make PullRequestSCMRevision public

Raul Arabaolaza Hi - I would love to use this information in pipeline step, but I'm having a hard time finding examples. Would you be able to provide one (or a link) here? Something along the lines of:

def revision = scm.currentRevision as PullRequestSCMRevision
echo "Base hash: ${revision.bashHash}"
echo "PR hash: ${revision.pullHash}"
 

I have no idea which object to start from to access this information. scm? currentBuild?

Thanks

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

dreich@nucleushealth.io (JIRA)

unread,
Oct 4, 2019, 11:15:01 AM10/4/19
to jenkinsc...@googlegroups.com
David Reich edited a comment on Task JENKINS-39496
 
Re: Make PullRequestSCMRevision public
[~rarabaolaza] Hi - I would love to use this information in pipeline step, but I'm having a hard time finding examples. Would you be able to provide one (or a link) here? Something along the lines of:
{code
:groovy }

def revision = scm.currentRevision as PullRequestSCMRevision
echo "Base hash: ${revision. bashHash baseHash }"

echo "PR hash: ${revision.pullHash}"
 {code}

I have no idea which object to start from to access this information. scm? currentBuild?

Thanks
Reply all
Reply to author
Forward
0 new messages