github-integration-plugin icon indicating copy to clipboard operation
github-integration-plugin copied to clipboard

WorkFlow: PRs being triggered by everything(?)

Open samcayford opened this issue 7 years ago • 19 comments

I recently updated to 0.1.0-rc23.

Now PRs are getting triggered too often. They're being triggered by reviews being requested and seemingly by any comment, even ones that do not match what i have set up in the Jenkins job.

As an example this is from this morning. The jenkins log shows:

Received PULL_REQUEST for https://github.com/RusticiSoftware/ScormEngine from 192.30.252.40 ⇒ https://leeroy.rusticisoftware.com:45808/jenkins/github-webhook/
May 11, 2017 12:16:03 PM INFO org.jenkinsci.plugins.github.pullrequest.GitHubPRTrigger readyToBuildCauses
GitHub rate limit after check GitHubRepositoryName[host=github.com,username=RusticiSoftware,repository=ScormEngine]: GHRateLimit{remaining=4983, limit=5000, resetDate=Thu May 11 13:15:56 UTC 2017}, consumed: 13, checked PRs: 1
May 11, 2017 12:16:03 PM INFO org.jenkinsci.plugins.github.pullrequest.trigger.JobRunnerForCause apply
Jenkins queued the run (PR opened)

The action on the payload in the webhook says:

"action": "edited"

What i did was edited the main description/comment on the PR. The comment in no way matched any rules i have set up either. I get the same thing happen for

"action": "review_requested",

also.

samcayford avatar May 11 '17 12:05 samcayford

Please show config.xml of your job and polling log from build that was run

KostyaSha avatar May 11 '17 13:05 KostyaSha

Never mind. Can't recreate it now. If it happens again i'll remember to get those for you. Until then i'll just close this 👍 Sorry

samcayford avatar May 11 '17 14:05 samcayford

github-pullrequest-polling.log.txt config.xml.txt

Recreated....

config.xml and github-pullrequest-polling.log attached. 2 things happened on this PR, a comment was added (doesn't seem to match rules) and a review was approved. Due to updating (or lack of) the page on GH neither user can be sure whether it was the comment or the review that initiated the Jenkins build.

samcayford avatar May 11 '17 15:05 samcayford

So what exactly wrong? Comment match?

          <events>
            <org.jenkinsci.plugins.github.pullrequest.events.impl.GitHubPRCommentEvent>
              <comment>test again</comment>
            </org.jenkinsci.plugins.github.pullrequest.events.impl.GitHubPRCommentEvent>
            <org.jenkinsci.plugins.github.pullrequest.events.impl.GitHubPRCommentEvent>
              <comment>test this</comment>
            </org.jenkinsci.plugins.github.pullrequest.events.impl.GitHubPRCommentEvent>
            <org.jenkinsci.plugins.github.pullrequest.events.impl.GitHubPRCommentEvent>
              <comment>retest this please</comment>
            </org.jenkinsci.plugins.github.pullrequest.events.impl.GitHubPRCommentEvent>
            <org.jenkinsci.plugins.github.pullrequest.events.impl.GitHubPRCommentEvent>
              <comment>test this ([A-Za-z0-9 ,!]+)</comment>
            </org.jenkinsci.plugins.github.pullrequest.events.impl.GitHubPRCommentEvent>
            <org.jenkinsci.plugins.github.pullrequest.events.impl.GitHubPRCommitEvent/>
            <org.jenkinsci.plugins.github.pullrequest.events.impl.GitHubPROpenEvent/>
          </events>

KostyaSha avatar May 11 '17 15:05 KostyaSha

Am i being dumb? What is it matching? All the comment regexes have 'test' in them and i can't see that in the comment.

samcayford avatar May 11 '17 15:05 samcayford

If you navigate to "GitHub Pull Requests" page and press "Run GH PR trigger" will it schedule builds again?

KostyaSha avatar May 11 '17 15:05 KostyaSha

It scheduled a whole bunch of them, yeah.

samcayford avatar May 11 '17 15:05 samcayford

So now trigger every time see changes and trigger builds?

KostyaSha avatar May 11 '17 15:05 KostyaSha

Sorry, i don't know what that means.

Because clicking that button went through and started a bunch of tests i added a comment to the affected existing PRs that read

Ignore the yellow below. By-product of trying to work through this github-jenkins comment issue with the plugin owner

Each time i added that comment the build was triggered again.

The very first line or the output says: GitHub PR #<a href="https://github.com/REDACTED/pull/2433">2433</a>, PR opened

So something is evaluating that the PR has been opened. It was already opened, i just added a comment (that didn't match any of the regexes)

samcayford avatar May 11 '17 15:05 samcayford

When you navigate to "GitHub PR" page does it have list of all PRs? Do you have any errors in jenkins system logger?

KostyaSha avatar May 11 '17 15:05 KostyaSha

Is it private repo?

KostyaSha avatar May 11 '17 15:05 KostyaSha

No errors in the logs. Yeah, it's a private repo i'm afraid.

samcayford avatar May 11 '17 15:05 samcayford

Is it possible to make one private repo and provide admin access to it for @Kostyasha-auto? I had some complains about private repos, but i can't test them.

KostyaSha avatar May 11 '17 16:05 KostyaSha

I don't think that is really feasible i'm afraid.

samcayford avatar May 11 '17 16:05 samcayford

I think i know where i can get private repo, will try.

KostyaSha avatar May 11 '17 17:05 KostyaSha

When you navigate to "GitHub PR" page does it have list of all PRs?

KostyaSha avatar May 11 '17 17:05 KostyaSha

#203 sounds the same...

KostyaSha avatar May 11 '17 20:05 KostyaSha

Now i see that workflow job has bugs.

KostyaSha avatar May 31 '17 23:05 KostyaSha

I think i found #281 Strange that this was found only now.

KostyaSha avatar Jul 01 '18 00:07 KostyaSha