Git Product home page Git Product logo

github-integration-plugin's Introduction

GitHub Integration Plugin

Minimal java version Build Status codecov.io Release

Provides GitHub Pull Request and GitHub Branch triggers

Documentation

Version history

Please refer to the changelog.

Disclaimer

  • Backward compatibility may be broken in any time. (But wasn’t in the last year and kept when it possible)

github-integration-plugin's People

Contributors

abayer avatar aleskiontherun avatar andreitroiebbc avatar atanasenko avatar basil avatar chickenkiller avatar danielepolencic avatar dependabot[bot] avatar jgangemi avatar kostyasha avatar lanwen avatar mazimkhan avatar mikz avatar pieterpaladin avatar s0undt3ch avatar sapr0 avatar zbynek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

github-integration-plugin's Issues

Stable release

Please comment in this issue when you release a stable release of the plugin. I can't roll it in my production Jenkins for fear of the following disclaimer:

Disclaimer

  • Backward compatibility may be broken in any time.

When you feel backwards compatibility may not be broken at any time and this plugin is stable I'll probably start making use of it in production.

Cancel queued jobs does not work properly

Here is a build log after two pushes about a minute apart that enqueue two jobs even though the cancel queued job is enabled. Quiet period is 10 minutes.

May 02, 2016 11:36:59 AM FINE org.jenkinsci.plugins.github.pullrequest.webhook.GHPullRequestSubscriber onEvent
Queued check for system-percy (PR #6718) after heavy hook
May 02, 2016 11:36:59 AM FINE org.jenkinsci.plugins.github.pullrequest.webhook.GHPullRequestSubscriber onEvent
Queued check for system-pipeline (PR #6718) after heavy hook
May 02, 2016 11:36:59 AM FINE org.jenkinsci.plugins.github.pullrequest.utils.LoggingTaskListenerWrapper debug
Running GitHub Pull Request trigger check for May 2, 2016 11:36:59 AM on org/repo
May 02, 2016 11:36:59 AM FINE org.jenkinsci.plugins.github.pullrequest.utils.LoggingTaskListenerWrapper debug
Running GitHub Pull Request trigger check for May 2, 2016 11:36:59 AM on org/repo
May 02, 2016 11:36:59 AM FINE org.jenkinsci.plugins.github.pullrequest.utils.LoggingTaskListenerWrapper debug
GitHub rate limit before check: GHRateLimit{remaining=4563, limit=5000, resetDate=Mon May 02 12:09:55 CEST 2016}
May 02, 2016 11:36:59 AM FINE org.jenkinsci.plugins.github.pullrequest.utils.LoggingTaskListenerWrapper debug
GitHub rate limit before check: GHRateLimit{remaining=4563, limit=5000, resetDate=Mon May 02 12:09:55 CEST 2016}
May 02, 2016 11:37:00 AM INFO org.jenkinsci.plugins.github.pullrequest.trigger.check.NotUpdatedPRFilter isUpdated
Pull request #6718 was updated at: Mon May 02 11:37:58 CEST 2016 by mikz
May 02, 2016 11:37:00 AM INFO org.jenkinsci.plugins.github.pullrequest.trigger.check.NotUpdatedPRFilter isUpdated
Pull request #6718 was updated at: Mon May 02 11:37:58 CEST 2016 by mikz
May 02, 2016 11:37:00 AM FINE org.jenkinsci.plugins.github.pullrequest.events.impl.GitHubPRCommitEvent check
New commit. Sha: 6366766cf9cd48f20791d654a66660c2660ec10e => 2bf5ef0679fa3c3573045bbebd4ef28480c2cf6c
May 02, 2016 11:37:01 AM FINE org.jenkinsci.plugins.github.pullrequest.events.impl.GitHubPRLabelNotExistsEvent check
Labels not exist:[percy] not found
May 02, 2016 11:37:01 AM FINEST org.jenkinsci.plugins.github.pullrequest.GitHubPRTrigger readyToBuildCauses
Causes count for org/repo: 1
May 02, 2016 11:37:01 AM FINEST org.jenkinsci.plugins.github.pullrequest.GitHubPRTrigger readyToBuildCauses
Causes count for org/repo: 0
May 02, 2016 11:37:02 AM INFO org.jenkinsci.plugins.github.pullrequest.GitHubPRTrigger readyToBuildCauses
GitHub rate limit after check org/repo: GHRateLimit{remaining=4539, limit=5000, resetDate=Mon May 02 12:09:55 CEST 2016}, consumed: 24, checked PRs: 1
May 02, 2016 11:37:02 AM INFO org.jenkinsci.plugins.github.pullrequest.utils.LoggingTaskListenerWrapper info
Finished GitHub Pull Request trigger check for org/repo at May 2, 2016 11:37:02 AM. Duration: 2756ms
May 02, 2016 11:37:02 AM INFO org.jenkinsci.plugins.github.pullrequest.trigger.JobRunnerForCause apply
Jenkins queued the run (Commit changed)
May 02, 2016 11:37:02 AM INFO org.jenkinsci.plugins.github.pullrequest.GitHubPRTrigger readyToBuildCauses
GitHub rate limit after check org/repo: GHRateLimit{remaining=4535, limit=5000, resetDate=Mon May 02 12:09:55 CEST 2016}, consumed: 28, checked PRs: 1
May 02, 2016 11:37:02 AM INFO org.jenkinsci.plugins.github.pullrequest.utils.LoggingTaskListenerWrapper info
Finished GitHub Pull Request trigger check for org/repo at May 2, 2016 11:37:02 AM. Duration: 3230ms
May 02, 2016 11:37:24 AM FINE org.jenkinsci.plugins.github.pullrequest.webhook.GHPullRequestSubscriber onEvent
Queued check for system-percy (PR #6718) after heavy hook
May 02, 2016 11:37:24 AM FINE org.jenkinsci.plugins.github.pullrequest.webhook.GHPullRequestSubscriber onEvent
Queued check for system-pipeline (PR #6718) after heavy hook
May 02, 2016 11:37:24 AM FINE org.jenkinsci.plugins.github.pullrequest.utils.LoggingTaskListenerWrapper debug
Running GitHub Pull Request trigger check for May 2, 2016 11:37:24 AM on org/repo
May 02, 2016 11:37:24 AM FINE org.jenkinsci.plugins.github.pullrequest.utils.LoggingTaskListenerWrapper debug
Running GitHub Pull Request trigger check for May 2, 2016 11:37:24 AM on org/repo
May 02, 2016 11:37:25 AM FINE org.jenkinsci.plugins.github.pullrequest.utils.LoggingTaskListenerWrapper debug
GitHub rate limit before check: GHRateLimit{remaining=4535, limit=5000, resetDate=Mon May 02 12:09:55 CEST 2016}
May 02, 2016 11:37:25 AM FINE org.jenkinsci.plugins.github.pullrequest.utils.LoggingTaskListenerWrapper debug
GitHub rate limit before check: GHRateLimit{remaining=4535, limit=5000, resetDate=Mon May 02 12:09:55 CEST 2016}
May 02, 2016 11:37:25 AM INFO org.jenkinsci.plugins.github.pullrequest.trigger.check.NotUpdatedPRFilter isUpdated
Pull request #6718 was updated at: Mon May 02 11:39:52 CEST 2016 by mikz
May 02, 2016 11:37:25 AM INFO org.jenkinsci.plugins.github.pullrequest.trigger.check.NotUpdatedPRFilter isUpdated
Pull request #6718 was updated at: Mon May 02 11:39:52 CEST 2016 by mikz
May 02, 2016 11:37:26 AM FINE org.jenkinsci.plugins.github.pullrequest.events.impl.GitHubPRCommitEvent check
New commit. Sha: 2bf5ef0679fa3c3573045bbebd4ef28480c2cf6c => 7dfe0a6891bd11147edc47fec18bcf14c746a573
May 02, 2016 11:37:26 AM FINE org.jenkinsci.plugins.github.pullrequest.events.impl.GitHubPRLabelNotExistsEvent check
Labels not exist:[percy] not found
May 02, 2016 11:37:26 AM FINEST org.jenkinsci.plugins.github.pullrequest.GitHubPRTrigger readyToBuildCauses
Causes count for org/repo: 1
May 02, 2016 11:37:27 AM FINEST org.jenkinsci.plugins.github.pullrequest.GitHubPRTrigger readyToBuildCauses
Causes count for org/repo: 0
May 02, 2016 11:37:27 AM INFO org.jenkinsci.plugins.github.pullrequest.GitHubPRTrigger readyToBuildCauses
GitHub rate limit after check org/repo: GHRateLimit{remaining=4517, limit=5000, resetDate=Mon May 02 12:09:55 CEST 2016}, consumed: 18, checked PRs: 1
May 02, 2016 11:37:27 AM INFO org.jenkinsci.plugins.github.pullrequest.utils.LoggingTaskListenerWrapper info
Finished GitHub Pull Request trigger check for org/repo at May 2, 2016 11:37:27 AM. Duration: 2617ms
May 02, 2016 11:37:27 AM INFO org.jenkinsci.plugins.github.pullrequest.trigger.JobRunnerForCause apply
Jenkins queued the run (Commit changed)
May 02, 2016 11:37:27 AM INFO org.jenkinsci.plugins.github.pullrequest.GitHubPRTrigger readyToBuildCauses
GitHub rate limit after check org/repo: GHRateLimit{remaining=4513, limit=5000, resetDate=Mon May 02 12:09:55 CEST 2016}, consumed: 22, checked PRs: 1
May 02, 2016 11:37:27 AM INFO org.jenkinsci.plugins.github.pullrequest.utils.LoggingTaskListenerWrapper info
Finished GitHub Pull Request trigger check for org/repo at May 2, 2016 11:37:27 AM. Duration: 3121ms

skip check seems to be not working.

I have pipeline job which is triggered by pull requests on github.

Triggers are in this order:

  • Not mergable (skip build unmergeable commits , checked)
  • Description matched pattern: ".[skip[\W-]+ci]."
  • Pull request opened
  • commit changed
  • comment matched pattern: ".test\W+(this|it)\W+please."

Now, I'm opening new pull request to this repository:

  • Request description body has line "[skip ci]"
  • I got build still triggered with description: "GitHub PR #26, PR opened"

to my understanding, "Description matched pattern" should take precedence and skip build, even some other triggers are matched, like "pull request opened".

Does not work with Pipeline script from SCM

I'm using the Pipeline Plugin. With the script directly in the configuration.
I tried to switch to "Pipeline script from SCM", configuring git as said on the wiki. But it fails:

GitHub PR #<a href="https://github.com/org/repo/pull/6504">6504</a>, Commit changed
Cloning the remote Git repository
Cloning repository [email protected]:org/repo.git
 > git init /var/lib/jenkins/jobs/system-pipeline/workspace@script # timeout=10
Fetching upstream changes from [email protected]:org/repo.git
 > git --version # timeout=10
using GIT_SSH to set credentials 
 > git -c core.askpass=true fetch --tags --progress [email protected]:org/repo.git +refs/heads/*:refs/remotes/origin/*
 > git config remote.origin.url [email protected]:org/repo.git # timeout=10
 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
 > git config remote.origin.url [email protected]:org/repo.git # timeout=10
Fetching upstream changes from [email protected]:org/repo.git
using GIT_SSH to set credentials 
 > git -c core.askpass=true fetch --tags --progress [email protected]:org/repo.git +refs/pull/${GITHUB_PR_NUMBER}/${GITHUB_PR_COND_REF}:refs/remotes/origin/pull/${GITHUB_PR_NUMBER}/${GITHUB_PR_COND_REF}
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from [email protected]:org/repo.git
    at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:766)
    at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1022)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1053)
    at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:109)
    at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:109)
    at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:58)
    at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:206)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:410)
Caused by: hudson.plugins.git.GitException: Command "git -c core.askpass=true fetch --tags --progress [email protected]:org/repo.git +refs/pull/${GITHUB_PR_NUMBER}/${GITHUB_PR_COND_REF}:refs/remotes/origin/pull/${GITHUB_PR_NUMBER}/${GITHUB_PR_COND_REF}" returned status code 128:
stdout: 
stderr: fatal: Couldn't find remote ref refs/pull/${GITHUB_PR_NUMBER}/${GITHUB_PR_COND_REF}

    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1719)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1463)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:63)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:314)
    at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:764)
    ... 8 more
ERROR: null
Finished: FAILURE

When I replace all ${GITHUB_PR_NUMBER}/${GITHUB_PR_COND_REF} with 6504/merge it checks out OK. So the problem might be that those variables are not available for the git checkout?

can't use it with pipeline jobs.

Job is simple pipeline job that mean to fetch from github repo. Pipeline is located in Jenkinsfile inside that repo, so configuration is very simple: "Pipeline script from SCM", Git as SCM.

Configured Git refs values as in manual for plugin:

  • cron trigger (due to jenkins behind proxy)
  • refs to fetch: +refs/pull//merge:refs/remotes/origin-pull/pull//merge
  • branch to build: origin-pull/pull/${GITHUB_PR_NUMBER}/merge

Results, build is triggered as expected from events on github, however pipeline can't be fetched:

GitHub PR #XXX, PR was triggered by comment
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin-pull.url https://github.com/some/repo # timeout=10
Fetching upstream changes from https://github.com/some/repo
 > git --version # timeout=10
using .gitcredentials to set credentials
 > git config --local credential.username someuser # timeout=10
 > git config --local credential.helper store --file=/tmp/git3507331315405339599.credentials # timeout=10
Setting http proxy: proxy.some.com:3128
 > git -c core.askpass=true fetch --tags --progress https://github.com/some/repo +refs/pull/*/merge:refs/remotes/origin-pull/pull/*/merge
 > git config --local --remove-section credential # timeout=10
 > git rev-parse refs/remotes/origin-pull/pull/${GITHUB_PR_NUMBER}/merge^{commit} # timeout=10
 > git rev-parse refs/remotes/origin-pull/origin-pull/pull/${GITHUB_PR_NUMBER}/merge^{commit} # timeout=10
 > git rev-parse origin-pull/pull/${GITHUB_PR_NUMBER}/merge^{commit} # timeout=10
ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.

PS. Also tried -Dhudson.model.ParametersAction.keepUndefinedParameters=true, didn't help much.

jenkins pull request does work properly

I have Jenkins setup for a scala/sbt project on github.
Everything seem to be working fine, except that the build for Pull Requests (from forks) does not seem to work compile the changes in the PR. Like it seems like it only compiles the master branch in the main repository. Even if you have syntax bug in your PR, it would still pass the jenkins test.
Anyone has faced this problem before? Any advice / suggestions?

Matrix Project plugin support

Hi! Thank you for the great plugin.

We use the Matrix project plugin to run builds against multiple versions of our dependencies, but when using the "GitHub PR: set PR status" publisher it fails with an NPE, stack trace below. Also it runs for each individual configuration build which will update the status multiple times and only report the last build's result, but instead it should support being used as a matrix build aggregator so it reports the parent job's status once.

ERROR: Build step failed with exception
java.lang.NullPointerException
    at org.jenkinsci.plugins.github.pullrequest.publishers.impl.GitHubPRBuildStatusPublisher.perform(GitHubPRBuildStatusPublisher.java:91)
    at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:76)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723)
    at hudson.model.Build$BuildExecution.post2(Build.java:185)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:668)
    at hudson.model.Run.execute(Run.java:1763)
    at hudson.matrix.MatrixRun.run(MatrixRun.java:146)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:410)

cron with persisted data is not running

I have the following cron line for my plugin

*/1 * * * *

but no entries ever show up in the Github PR Polling log. I've added triggers of "Commit Changed" and "Pull request opened/closed" but still nothing shows up in the log and no builds occur.

review trigger modes

Any trigger is already cron based. Empty input will disable cron. Hooks + cron should be one trigger with optional mix of modes.

Export few more variables about PR that triggered build please.

Please, export few more parameters that can help later on either in job scripts or in pipeline DSL:

  • github target repository name (owner/reponame)
  • github target repository url
  • github credentials ID (if known, might be required to access private github repo in pipeline)
  • Comment body (if triggered by comment). Maybe just part that matched trigger phrase would be enough.
  • label(s) that triggered build

Use setGithubPullRequestStatus as a standalone feature

I currently have my branch/PR build triggers setup through the github plugin, but would like finer granularity in setting the build statuses than that plugin allows. Github Integration Plugin's setGithubPullRequestStatus provides a nice interface. It would nice to be able to use that feature while still keeping my current setup for build triggers.

Triggers works only one time

Hello,

I noticed the triggers work only one time, why ?

I mean, I want to build my project many times by PR (because if the build is not a success, commits are coming and they should be test as well), and I guess i'm not the only one :-) .

Ant fails when there is a double quote in the PR name

Hello,

I don't really explain that but when we have a double quote inside the name of the PR, the build fails with error like:

BUILD FAILED
Target "answer bug" does not exist in the project "****". 

(with PR named Fixed the "phantom answer" bug)

I don't even know if the problem is from gh-pr but as it's pull-request related i report here.

enhance error handling/logging

Apr 08, 2016 12:23:02 AM org.jenkinsci.plugins.github.pullrequest.GitHubPRTrigger doRun
SEVERE: Can't process check (Can't get remote GH repo for test-job)
java.lang.IllegalStateException: Can't get remote GH repo for test-job
    at com.google.common.base.Preconditions.checkState(Preconditions.java:172)
    at org.jenkinsci.plugins.github.pullrequest.GitHubPRTrigger.getRemoteRepo(GitHubPRTrigger.java:281)
    at org.jenkinsci.plugins.github.pullrequest.GitHubPRTrigger.readyToBuildCauses(GitHubPRTrigger.java:364)
    at org.jenkinsci.plugins.github.pullrequest.GitHubPRTrigger.doRun(GitHubPRTrigger.java:327)
    at org.jenkinsci.plugins.github.pullrequest.GitHubPRTrigger.run(GitHubPRTrigger.java:210)

Error since Github down?

Hi @KostyaSha,

Seems that I'm experiencing some troubles since yesterday 4PM (linked to github down??).
I'm not able anymore to launch any build through Github comments/label.
I'm using 0.0.1-beta14
Here is the trace

May 24, 2016 11:07:03 AM org.jenkinsci.plugins.github.pullrequest.GitHubPRTrigger doRun
SEVERE: Can't process check (null)
java.lang.NullPointerException
    at org.jenkinsci.plugins.github.pullrequest.events.impl.GitHubPRLabelAddedEvent.check(GitHubPRLabelAddedEvent.java:55)
    at org.jenkinsci.plugins.github.pullrequest.trigger.check.PullRequestToCauseConverter$EventToCauseConverter.apply(PullRequestToCauseConverter.java:82)
    at org.jenkinsci.plugins.github.pullrequest.trigger.check.PullRequestToCauseConverter$EventToCauseConverter.apply(PullRequestToCauseConverter.java:69)
    at com.google.common.collect.Iterators$8.next(Iterators.java:812)
    at com.google.common.collect.Iterators$7.computeNext(Iterators.java:648)
...

Thanks

run job on close/reopen?

Hello,

I have a job that doesn't seem to re-run when a PR is closed and then re-opened. Is this possible? My logs are

Finished GitHub Pull Request trigger check for XXXXX at May 25, 2016 9:48:18 AM. Duration: 709ms

May 25, 2016 9:48:33 AM INFO org.jenkinsci.plugins.github.pullrequest.GitHubPRTrigger readyToBuildCauses

GitHub rate limit after check XXXXXX: GHRateLimit{remaining=4993, limit=5000, resetDate=Wed May 25 10:28:48 PDT 2016}, consumed: 0, checked PRs: 1

If I manually click the "Run GH PR Trigger", then the job fires off. I was hoping this would happen automatically though.

Thanks.

Post build comment is added to the wrong pull request

"Github PR: post comment" activated by "Post build action" is posting the comment in the wrong pull request. I opened 2 pull requests, got 2 builds running, but the post build comments (both of them) were posted in the same pull request.

Other than that this was a great plugin, thank you!

Jenkins 2.3 breaks env variables

After updating to 2.3 update because of security advisory, all our builds fail with:

groovy.lang.MissingPropertyException: No such property: GITHUB_PR_SOURCE_BRANCH for class: Script2
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:53)
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.getProperty(ScriptBytecodeAdapter.java:458)
    at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.getProperty(DefaultInvoker.java:25)
    at com.cloudbees.groovy.cps.impl.PropertyAccessBlock.rawGet(PropertyAccessBlock.java:17)
    at Script2.run(Script2.groovy:39)
    at ___cps.transform___(Native Method)
    at com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.get(PropertyishBlock.java:62)
    at com.cloudbees.groovy.cps.LValueBlock$GetAdapter.receive(LValueBlock.java:30)
    at com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.fixName(PropertyishBlock.java:54)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
    at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)
    at com.cloudbees.groovy.cps.Next.step(Next.java:58)
    at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:154)
    at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:164)
    at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:277)
    at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$000(CpsThreadGroup.java:77)
    at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:186)
    at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:184)
    at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:47)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)
    at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)

The build script uses GITHUB_PR_SOURCE_BRANCH to get the branch name to check out.

git branch: GITHUB_PR_SOURCE_BRANCH, credentialsId: 'uuid', url: '[email protected]:org/repo.git'

404 on createCommitStatus

Jan 29, 2016 12:33:01 PM SEVERE org.jenkinsci.plugins.github.pullrequest.trigger.JobRunnerForCause apply
Can't trigger build ({"message":"Not Found","documentation_url":"https://developer.github.com/v3"})
java.io.FileNotFoundException: {"message":"Not Found","documentation_url":"https://developer.github.com/v3"}
    at org.kohsuke.github.Requester.handleApiError(Requester.java:527)
    at org.kohsuke.github.Requester._to(Requester.java:257)
    at org.kohsuke.github.Requester.to(Requester.java:203)
    at org.kohsuke.github.GHRepository.createCommitStatus(GHRepository.java:854)
    at org.jenkinsci.plugins.github.pullrequest.trigger.JobRunnerForCause.apply(JobRunnerForCause.java:84)
    at org.jenkinsci.plugins.github.pullrequest.trigger.JobRunnerForCause.apply(JobRunnerForCause.java:51)
    at com.google.common.collect.Iterators$7.computeNext(Iterators.java:649)
    at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)
    at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138)
    at com.google.common.collect.Lists.newArrayList(Lists.java:138)
    at com.google.common.collect.ImmutableSet.copyOf(ImmutableSet.java:286)
    at com.google.common.collect.ImmutableSet.copyOf(ImmutableSet.java:271)
    at org.jenkinsci.plugins.github.util.FluentIterableWrapper.toSet(FluentIterableWrapper.java:145)
    at org.jenkinsci.plugins.github.pullrequest.GitHubPRTrigger.doRun(GitHubPRTrigger.java:339)
    at org.jenkinsci.plugins.github.pullrequest.GitHubPRTrigger.run(GitHubPRTrigger.java:210)
    at hudson.triggers.Trigger.checkTriggers(Trigger.java:272)
    at hudson.triggers.Trigger$Cron.doRun(Trigger.java:221)
    at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:50)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.FileNotFoundException: https://api.github.com/repos/metamorph-inc/meta-core/statuses/9d536a4e0a1cdf1a5f2bd4fee10047f8e19b4baf
    at com.squareup.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:240)
    at com.squareup.okhttp.internal.huc.DelegatingHttpsURLConnection.getInputStream(DelegatingHttpsURLConnection.java:210)
    at com.squareup.okhttp.internal.huc.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:25)
    at org.kohsuke.github.Requester.parse(Requester.java:483)
    at org.kohsuke.github.Requester._to(Requester.java:236)
    ... 23 more

GitHub API Plugin 1.72
GitHub Pull Request Plugin 0.0.1rc3
Jenkins 1.642.1

New pull requests being triggered twice

Whenever I open a new PR, two jobs are being kicked off in my pipeline. Here is a screenshot of my Trigger config.

triggers

There are no other triggers configured.

Both jobs that kickoff state their reason as "PR opened"

Any ideas?

Custom commit status contexts

Currently the "update commit status" set of actions provided by this plugin create and modify status of a commit using the "context" of the job name the action ran from. So, in Jenkins, if my job is called "my-test", the commit status will be identified in GitHub as "my-test" as well. This is probably usually fine for simple freestyle jobs but when using the workflow/pipeline plugin, this can be a limitation. With that plugin, large pipelines can be defined which run multiple activities. If I wanted to have different portions of this pipeline update different commit status entires, that is not possible given the attachment to the job name.

For example if my pipeline performs two different validations:

    parallel {
        stage {
            // Validate checkstyle
        }
        stage {
            // run unit tests
        }
    }

I would like to be able to create two different status checks in each branch of the pipeline that have their own "context" so I can easily see in GitHub which check failed.

I am willing to try and implement this if you think it would be a useful and appropriate feature.

Comments on the PR trigger jenkins but jenkins does not trigger github

Hello,

I notice a weird behavior when you trigger builds manually. (in my project, we don't want jenkins build automatically every PR because it takes a lot of time)

When you create a pull-request on the github, then you add the comment to trigger jenkins, everything is ok. The build start and jenkins tell github about the current status of the build. As you can see on this screenshot:

screen_jenkins_success

After added a commit, then when you try to start again a build, the build is started by jenkins but github does not receive information about the build. Checkout the following screenshot:

screen_jenkins_fail

I have no idea where comes this bug, or how to fix it. But i tried many configurations of the plugin and nothing to do, the problem is still here.

Don't hesitate to ask anything if i'm not clear enough.

Skip + commit changed still triggers a build

I have a pr that was build, even though it should not.
Using the Label not exists trigger configured to skip PRs with missing label jenkins.
That was correctly skipped as the log shows. But then I have trigger to build PR when commit changed and that triggered a build. But it should not, because the PR was skipped.

Running GitHub Pull Request trigger check for Mar 10, 2016 12:58:22 PM on 3scale/system
GitHub rate limit before check: GHRateLimit{remaining=4205, limit=5000, resetDate=Thu Mar 10 13:01:51 CET 2016}
Labels not exist: [jenkins] not found
Skipping PR #6469
GitHubPRCommitEvent: new commit found, sha 984050ce9facfd8ea772bd1acd9649ee713284f8
Prepare to trigger build for PR #6469, because Commit changed
Finished GitHub Pull Request trigger check for 3scale/system at Mar 10, 2016 12:58:26 PM. Duration: 3540ms

Any ideas?

Migrate out from jenkinsci

  • leave jenkinsci org
  • 🍺
  • wrote everything that i think about workflow and matrix jobs in #86
  • create PR builder in Travis
  • update documentation with the reason
  • Move to jucies #89 ?

TODO migrate to Jucies

  • release into jucies
  • fix jucies in jenkins INFRA (filtering, docs)
  • add jucies optional dep
  • wait for user upgrades (jucies stats)
  • exclude artifacts from main update center?

Detect when a PR is closed

Hi,

We are using this plugin, and all is excellent... But we have an use case, We need to detect when a PR is closed (merged or just closed) in an environment variable by example STATUS=closed or STATUS=merged.

Exists right now that variable?

Filter by PR number

I believe that using this plugin you setup up one(1) job to handle all pull requests, right?

Our approach to pull requests is to create a set of jobs per pull request. Each set of jobs per pull request has a main-build which should be triggerable by pull requests.
We'd like the ability to set each of those main_build's to build each own pull request, but I'm guessing that you'd need some king of filtering in order not to trigger every _ main-build_ when one PR is updated.

Please set me straight if I not seeing the plugin usage correctly.

Git Environment Variables not available after upgrade to Jenkins 2.14

Hello,

I've been using this plugin for quite some time, however, since recent upgrade from Jenkins 1.6 to 2.14 all my builds are failing because GITHUB_PR_NUMBER is no longer available as a variable or does not expand.

Example:
In version 2.14
git -c core.askpass=true fetch --no-tags --progress https://*******/repo.git +refs/pull/${GITHUB_PR_NUMBER}/merge:refs/remotes/origin-pull/pull/${GITHUB_PR_NUMBER}/merge # timeout=60

In version 1.6
git -c core.askpass=true fetch --no-tags --progress https://*********/repo.git +refs/pull/453/merge:refs/remotes/origin-pull/pull/453/merge

Can you advise if this is a known limitation with version? Do I need to rollback to use this plugin?

Thanks

Quiet Period is not respected

Given a following job:

workflowJob('project-pipeline') {
    quietPeriod(600)

    scm {
        github('3scale/system')
    }
    triggers {
        onPullRequest {
            cron('H/20 * * * *')
            mode {
                heavyHooksCron()
            }
            events {
                labelAdded("jenkins")
                skipLabelNotExists("jenkins")
                commit()
            }
        }
    }

    definition {
        cps {
            script('echo "executed"')
        }
     }
}

When the build is scheduled, it does not respect the quiet period. And it is correctly set in the job configuration.

Migration to multi-module github-integration-plugin

As soon as i plan implement more integration features (not only PRs) and integration tests:

  • rename gh repo
  • rename wiki
  • rename jira component to github-integration-plugin
  • resolve open PRs
  • migrate to multi-module maven structure, move current pullrequest-plugin as already used by some people into submodule and keep releasing it as alpha
  • experimental stuff will go to other module.
  • in future deprecate/replace plugins with relocating classes to generic plugin

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.