Open LinkMJB opened 7 years ago
For the record, unfortunately this issue seems to be still present and we are hitting it too.
I'm just here in hope to understand the intended difference between triggerPhrase
and retestPhrase
, and what the hell onlyTriggerPhrase
means.
Looking at
https://github.com/jenkinsci/ghprb-plugin/blob/57f12d0a4e4d6846833ca560c4dd3c5320ab45de/src/main/java/org/jenkinsci/plugins/ghprb/GhprbPullRequest.java#L610-L630
they seem equivalent but only triggerPhrase sets triggered = true
.
Later in tryBuild()
:
https://github.com/jenkinsci/ghprb-plugin/blob/57f12d0a4e4d6846833ca560c4dd3c5320ab45de/src/main/java/org/jenkinsci/plugins/ghprb/GhprbPullRequest.java#L521-L524
=> So my impression is that onlyTriggerPhrase
means no other phrase can run a build. Whitelist and ok to test phrases can have side effect of allowing future builds, but can't trigger it themselves. :question:
Now, for this issue: README says:
... isn't whitelisted ... One of the admins can comment ...
test this please
for one time test run ...
and later:
A new build can also be started with a comment which contains,
retest this please
so I was thinking these are 2 distinct phrases, trigger vs retest?
But the actual retestPhrase default is .*test\W+this\W+please.*
so it also matches test this please
!
And afaict, triggerPhrase is unset by default?
So yes, if same string matches both retest and trigger phrase, if (helper.isRetestPhrase(body))
will win and it will be interpreted as retest! => triggered == false
=> no effect if onlyTriggerPhrase
enabled.
This could be argued a mild bug.
I'd expect it be the other way around (it was a valid trigger phrase, thus should take effect)?
But it sounds best to configure regexps such that only one can match a given comment.
When enabling "Only use trigger phrase for build triggering" PR builds no longer work when the trigger phrase is provided. The trigger phrase does in fact work when "Only use trigger phrase for build triggering" is unchecked/disabled.
The trigger phrase works fine when
<onlyTriggerPhrase>true</onlyTriggerPhrase>
is set to false. As soon as the trigger phrase is required, the PR's are not built.Here's a logging example of the behavior with the option enabled, and without the option enabled:
=== With “Only use trigger phrase for build triggering" enabled ===
=== Without “Only use trigger phrase for build triggering" enabled ===
Some more details -- when trying to use the retest phrase it claims that the target branch is either not listed in the whitelist, even though it is -- or that it is not triggered. I haven't been able to figure out the context of the logs in regard to which job/branch the PR poll is performed for/by.
Is this plugin only supported to be used as a single Jenkins project for PR builds against an entire github repo? We have separate jobs created for each branch, in our configuration.
From the master branch PR builder job's config.xml:
=== From the org.jenkinsci.plugins.ghprb.GhprbPullRequest logger: ===
=== Another run ===