Open teojgo opened 6 years ago
Not right now. Whats your usecase? How would that look like for you?
My usecase is the following: Whenever I submit a pull request, or update the branch corresponding to the pull request, the ghprb plugin triggers the jenkins build which runs various tests. There is a possibility that some of the tests fail. In order to rerun the failed ones or at least certain ones, I want parse the comment which in ghprbCommentBody
contains the test names I would like to retry.
Thus, it would be nice to have an option to know if the ghprb was actually triggered by a pull request/branch update or by a comment and let the Jenkinsfile behave differently depending on the actual trigger cause.
@teojgo one way to handle this is by parsing the ghprbCommentBody
value, follow a standard way like "test-> testcasenames" . In execute shell split the commentBody value and get the testcase names and pass it to the test runner.
Yes, this is exactly how I do this now. Consider now the following scenario.
ghprbCommentBody
. In this case I take the default actions since the ghprbCommentBody
does not contain anything.ghprbCommentBody
in order to follow the action based on its contents.ghprbCommentBody
is not empty but it contains whatever was put in step 2.Since in step 3 the jenkins is triggered by a new commit, the comment of step 2 which is still contained in ghprbCommentBody
is not relevant anymore. Thus, it would be nice to be able to distinguish if a build was triggered by a comment or an actual new commit. Through the ghprbCommentBody
it is not possible.
Is there a way to check if the triggered build was initiated by a new commit/pull request or by a comment matching the prescribed pattern? I would like to process the comment for a given PR. The problem is that if the build is triggered by a new commit message, the last comment is used in
ghprbCommentBody
which is not valid anymore.