github-integration-plugin
github-integration-plugin copied to clipboard
PR not building for comment at times
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:
- User raises and submits PR
- 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
- User raises and submits PR
- Let us consider this PR number is 5
- Github PR polling log says "no comment matched for PR 5"
- User comments as per the pattern
- Github PR polling log says "PR [#5 User story] not changed" and it continues to say same message
- For debug purpose, I added a label and removed
- Github PR polling log says "No matching comments found for 5"
- For debug purpose, I changed assignee and approvers
- Github PR polling log says "No matching comments found for 5"
- User comments again with same pattern
- 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.
I have the same issue. In my case, Jenkins just needs some delay between comments to detect the next one.
Just disable cache. okhttp3's cache looks broken
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!
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.
Yes, mattern matching is plain. You need add multiline setting in pattern according to java regexp docs.