KostyaSha / github-integration-plugin

Jenkins GitHub Integration Plugin
https://wiki.jenkins-ci.org/display/JENKINS/GitHub+Integration+Plugin
MIT License
98 stars 85 forks source link

triggers settings are ignored #235

Open adamwong246 opened 7 years ago

adamwong246 commented 7 years ago

We're attempting to configure the plugin to run PRs which are 1) without merge conflict and 2) without certain tags. We'd like the trigger to be run when a PR is created or updated.

Whenever the "GH PR trigger" is run, all PRs are put into the queue, ignoring these settings.

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<flow-definition plugin="workflow-job@2.14.1">
<actions>
<io.jenkins.blueocean.service.embedded.BlueOceanUrlAction plugin="blueocean-rest-impl@1.2.4">
<blueOceanUrlObject class="io.jenkins.blueocean.service.embedded.BlueOceanUrlObjectImpl">
<mappedUrl>blue/organizations/jenkins/voltron-pr-detect-pipe</mappedUrl>
</blueOceanUrlObject>
</io.jenkins.blueocean.service.embedded.BlueOceanUrlAction>
<org.jenkinsci.plugins.workflow.multibranch.JobPropertyTrackerAction plugin="workflow-multibranch@2.16">
<jobPropertyDescriptors>
<string>
org.jenkinsci.plugins.workflow.job.properties.DisableConcurrentBuildsJobProperty
</string>
</jobPropertyDescriptors>
</org.jenkinsci.plugins.workflow.multibranch.JobPropertyTrackerAction>
</actions>
<description/>
<keepDependencies>false</keepDependencies>
<properties>
<hudson.plugins.buildblocker.BuildBlockerProperty plugin="build-blocker-plugin@1.7.3">
<useBuildBlocker>false</useBuildBlocker>
<blockLevel>GLOBAL</blockLevel>
<scanQueueFor>DISABLED</scanQueueFor>
<blockingJobs/>
</hudson.plugins.buildblocker.BuildBlockerProperty>
<org.jenkinsci.plugins.workflow.job.properties.DisableConcurrentBuildsJobProperty/>
<com.coravy.hudson.plugins.github.GithubProjectProperty plugin="github@1.28.0">
<projectUrl>https://github.com/OpenGov/voltron/</projectUrl>
<displayName>voltron</displayName>
</com.coravy.hudson.plugins.github.GithubProjectProperty>
<hudson.plugins.throttleconcurrents.ThrottleJobProperty plugin="throttle-concurrents@2.0.1">
<maxConcurrentPerNode>0</maxConcurrentPerNode>
<maxConcurrentTotal>0</maxConcurrentTotal>
<categories class="java.util.concurrent.CopyOnWriteArrayList"/>
<throttleEnabled>false</throttleEnabled>
<throttleOption>project</throttleOption>
<limitOneJobWithMatchingParams>false</limitOneJobWithMatchingParams>
<paramsToUseForLimit/>
</hudson.plugins.throttleconcurrents.ThrottleJobProperty>
<org.jenkinsci.plugins.workflow.job.properties.PipelineTriggersJobProperty>
<triggers>
<org.jenkinsci.plugins.github.pullrequest.GitHubPRTrigger plugin="github-pullrequest@0.1.0-rc26">
<spec/>
<triggerMode>HEAVY_HOOKS</triggerMode>
<cancelQueued>true</cancelQueued>
<abortRunning>true</abortRunning>
<skipFirstRun>false</skipFirstRun>
<repoProviders>
<com.github.kostyasha.github.integration.generic.repoprovider.GitHubPluginRepoProvider>
<cacheConnection>true</cacheConnection>
<manageHooks>true</manageHooks>
<repoPermission>ADMIN</repoPermission>
</com.github.kostyasha.github.integration.generic.repoprovider.GitHubPluginRepoProvider>
</repoProviders>
<errorsAction>
<description>GitHub Pull Requests Trigger Errors</description>
<errors class="java.util.Collections$SynchronizedSet" serialization="custom">
<java.util.Collections_-SynchronizedCollection>
<default>
<c class="set"/>
<mutex class="java.util.Collections$SynchronizedSet" reference="../../.."/>
</default>
</java.util.Collections_-SynchronizedCollection>
</errors>
</errorsAction>
<events>
<org.jenkinsci.plugins.github.pullrequest.events.impl.GitHubPRNonMergeableEvent>
<skip>true</skip>
</org.jenkinsci.plugins.github.pullrequest.events.impl.GitHubPRNonMergeableEvent>
<org.jenkinsci.plugins.github.pullrequest.events.impl.GitHubPROpenEvent/>
<org.jenkinsci.plugins.github.pullrequest.events.impl.GitHubPRCommitEvent/>
<org.jenkinsci.plugins.github.pullrequest.events.impl.GitHubPRLabelExistsEvent>
<label>
<labels>
<string>Needs Peer Review</string>
<string>Do Not Merge</string>
<string>Work In Progress</string>
<string>Blocked</string>
</labels>
</label>
<skip>true</skip>
</org.jenkinsci.plugins.github.pullrequest.events.impl.GitHubPRLabelExistsEvent>
</events>
<preStatus>true</preStatus>
</org.jenkinsci.plugins.github.pullrequest.GitHubPRTrigger>
</triggers>
</org.jenkinsci.plugins.workflow.job.properties.PipelineTriggersJobProperty>
</properties>
<definition class="org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition" plugin="workflow-cps@2.40">
<scm class="hudson.plugins.git.GitSCM" plugin="git@3.5.1">
<configVersion>2</configVersion>
<userRemoteConfigs>
<hudson.plugins.git.UserRemoteConfig>
<url>https://github.com/OpenGov/cloacina.git</url>
<credentialsId>github-og-okta-jenkins</credentialsId>
</hudson.plugins.git.UserRemoteConfig>
</userRemoteConfigs>
<branches>
<hudson.plugins.git.BranchSpec>
<name>master</name>
</hudson.plugins.git.BranchSpec>
</branches>
<doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
<submoduleCfg class="list"/>
<extensions/>
</scm>
<scriptPath>src/org/opengov/pipeline.groovy</scriptPath>
<lightweight>true</lightweight>
</definition>
<triggers/>
<disabled>false</disabled>
</flow-definition>
screen shot 2017-09-25 at 2 39 56 pm
Running GitHub Pull Request trigger check for Sep 25, 2017 9:40:35 PM on GitHubRepositoryName[host=github.com,username=OpenGov,repository=voltron]
GitHub rate limit before check: GHRateLimit{remaining=4841, limit=5000, resetDate=Mon Sep 25 22:05:28 UTC 2017}
Pull Request Opened: state has changed (PR was opened)
Pull Request Opened: state has changed (PR was opened)
Pull Request Opened: state has changed (PR was opened)
Pull Request Opened: state has changed (PR was opened)
Pull Request Opened: state has changed (PR was opened)
Pull Request Opened: state has changed (PR was opened)
Pull Request Opened: state has changed (PR was opened)
Pull Request Opened: state has changed (PR was opened)
Pull Request Opened: state has changed (PR was opened)
Pull Request Opened: state has changed (PR was opened)
Pull Request Opened: state has changed (PR was opened)
Pull Request Opened: state has changed (PR was opened)
Pull Request Opened: state has changed (PR was opened)
Pull Request Opened: state has changed (PR was opened)
Finished GitHub Pull Request trigger check for GitHubRepositoryName[host=github.com,username=OpenGov,repository=voltron] at Sep 25, 2017 9:40:52 PM. Duration: 16925ms
KostyaSha commented 7 years ago

according to log it doesn't see the previous state and trigger all PRs. I remember some users reporte d the same problem. Something wrong with workflow? What versions do you use?

KostyaSha commented 7 years ago

https://github.com/KostyaSha/github-integration-plugin/issues/203#issuecomment-300902314 Looks the same. Could you read comments?

KostyaSha commented 7 years ago

@abayer I looked at workflow-job trigger issues an PRs and i have no idea how it works at all :)

studavekar commented 7 years ago

i am seeing a similar issue where trigger are ignored, I have kept bare minimum settings.

The comment is exact the same as in PR, poll log does get the github event however it doesn't trigger with message

PR [#5413 Collect build artifacts, disable cleanup] not changed
Finished GitHub Pull Request trigger check for GitHubRepositoryName

job-config-screenshot

Logs:

jenkins-logs.txt polling-log.txt

There is an exception in logs :

Nov 01, 2017 4:27:04 AM SEVERE org.jenkinsci.plugins.github.pullrequest.utils.LoggingTaskListenerWrapper error
Can't end trigger check
java.lang.NullPointerException
    at com.github.kostyasha.github.integration.branch.events.impl.GitHubBranchCommitEvent.check(GitHubBranchCommitEvent.java:118)
    at com.github.kostyasha.github.integration.branch.events.impl.GitHubBranchCommitEvent.check(GitHubBranchCommitEvent.java:85)
    at com.github.kostyasha.github.integration.branch.trigger.check.BranchToCauseConverter.toCause(BranchToCauseConverter.java:90)
    at com.github.kostyasha.github.integration.branch.trigger.check.BranchToCauseConverter.lambda$apply$0(BranchToCauseConverter.java:46)
    at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
    at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1374)
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
    at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
adamwong246 commented 7 years ago

this is resolved for me