Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR not building for comment at times #333

Open
prawen opened this issue Jul 28, 2020 · 5 comments
Open

PR not building for comment at times #333

prawen opened this issue Jul 28, 2020 · 5 comments

Comments

@prawen
Copy link

prawen commented Jul 28, 2020

Hello,

I'm new to this plugin and really appreciate your help here.

I have configured the plugin as per the instructions provided.
Client cache is set to 20.
My trigger event is "Comment matched to Pattern"
My webhook settings on gitlab.com sends below events
a. Issue Comments
b. Pull requests

Expected flow:

  1. User raises and submits PR
  2. User makes a comment as per the pattern and the build should be triggered

Actual result:
When a comment matches my pattern, build is getting triggered and the build status is being reported before and after the build. This is working as per my expectation.

Actual issue I'm facing:
The comment based trigger of build is not happening at times. Below is the flow

  1. User raises and submits PR
  2. Let us consider this PR number is 5
  3. Github PR polling log says "no comment matched for PR 5"
  4. User comments as per the pattern
  5. Github PR polling log says "PR [WIP hooks #5 User story] not changed" and it continues to say same message
  6. For debug purpose, I added a label and removed
  7. Github PR polling log says "No matching comments found for 5"
  8. For debug purpose, I changed assignee and approvers
  9. Github PR polling log says "No matching comments found for 5"
  10. User comments again with same pattern
  11. Github PR polling log says "Comment matched to pattern: state has changed (new comment found - 'TEST-MERGE')
    Comment matched to pattern: matching comment TEST-MERGE"

I'm not exactly able to explain the sequence when this issue occurs. But this has been observed frequently. I waited for atleast 10-15 minutes before retrying with the same comment.

@maxvasylets
Copy link

I have the same issue.
In my case, Jenkins just needs some delay between comments to detect the next one.

@KostyaSha
Copy link
Owner

Just disable cache. okhttp3's cache looks broken

@ryuwd
Copy link

ryuwd commented Sep 17, 2020

I have the same issue.
In my case, Jenkins just needs some delay between comments to detect the next one.

Having the same issue here, leaving some delay between trigger events (i.e. comments) works.

Just disable cache. okhttp3's cache looks broken

What do you mean by cache? Is this in the plugin options?

Edit: found it!

@ryuwd
Copy link

ryuwd commented Sep 21, 2020

I found what was causing comments to be ignored on my end. I naively used the regex .*? to trigger builds, since I wanted the build to trigger for all comments. That regex does not match newlines, so comments that had newlines at the end were ignored. I'm now using [\S\s]* instead.

@KostyaSha
Copy link
Owner

Yes, mattern matching is plain. You need add multiline setting in pattern according to java regexp docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants