jenkinsci / pipeline-github-plugin

Pipeline: GitHub
https://plugins.jenkins.io/pipeline-github/
MIT License
159 stars 73 forks source link

Add `mergeableState` property to `pullRequest` variable #122

Closed l3ender closed 1 year ago

l3ender commented 1 year ago

Overview

This PR adds the value of the pull request's "mergeable state" to the global pullRequest variable so that it is available in pipeline builds. This value is helpful to determine if the PR is behind (not up to date from master).

Testing done

After making changes:

  1. Ran project locally using mvn hpi:run.

  2. Used ngrok to proxy requests to local Jenkins; configured webhook to ngrok on repository with pipeline file (l3ender/jenkins-plugin-testing).

  3. Created multibranch pipeline job referencing repo with pipeline:

    image

  4. Created PR that referenced new property mergeableState (https://github.com/l3ender/jenkins-plugin-testing/pull/2) and confirmed that desired property can be referenced and value from PR is shown as expected:

    image

### Submitter checklist
- [x] Make sure you are opening from a **topic/feature/bugfix branch** (right side) and not your main branch!
- [x] Ensure that the pull request title represents the desired changelog entry
- [x] Please describe what you did
- [x] Link to relevant issues in GitHub or Jira
- [x] Link to relevant pull requests, esp. upstream and downstream changes
- [x] Ensure you have provided tests - that demonstrates feature works or fixes the issue
l3ender commented 1 year ago

@aaronwalker I see you have recent activity for this repo. Would you mind taking a look at this PR and providing assistance/advice? Thank you!!

aaronwalker commented 1 year ago

@l3ender released in https://github.com/jenkinsci/pipeline-github-plugin/releases/tag/2.8-155.8eab375ac9f8

l3ender commented 1 year ago

@aaronwalker Thanks for the quick response and action! I appreciate it.