Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-30821

Include comment text as an environmental variable in comment-added Gerrit trigger event

    XMLWordPrintable

Details

    Description

      It would be nice if Gerrit trigger plugin included the message a comment-added event results in as an environmental variable. It looks like that "gerrit stream-events" includes comment texts as part of the data that it provides. But currently there doesn't seem to be a mechanism to get the exact comment that this event is triggered upon. Only the change reference is included and from it it's just a guess that which comments triggers this event, as those comments need to be separately fetched from Gerrit by using GERRIT_PATCHSET_REVISION environmental variable and there can be new comments added between the triggering and actually fetching the list of comments that a patch set has.

      Attachments

        Activity

          tlipcon Todd Lipcon added a comment -

          +1 for this issue, would be quite useful, especially in conjunction with the ability to rejex match on the comment text. For example, I'd like to be able to use a special gerrit comment to kick off stress test builds on particular patches while not doing it for all.

          tlipcon Todd Lipcon added a comment - +1 for this issue, would be quite useful, especially in conjunction with the ability to rejex match on the comment text. For example, I'd like to be able to use a special gerrit comment to kick off stress test builds on particular patches while not doing it for all.
          tmurtola Teemu Murtola added a comment -

          This should be easy enough to implement (in particular if it is acceptable to use the option for commit message encoding to also decide on the encoding for the comment text), although I'm not sure how to test this (easily) beyond compiling. I can create a pull request once I find the time.

          My use case for this functionality would be to have a pipeline build that does some decisions on what/how to build things, based on the comment added in Gerrit.

          tmurtola Teemu Murtola added a comment - This should be easy enough to implement (in particular if it is acceptable to use the option for commit message encoding to also decide on the encoding for the comment text), although I'm not sure how to test this (easily) beyond compiling. I can create a pull request once I find the time. My use case for this functionality would be to have a pipeline build that does some decisions on what/how to build things, based on the comment added in Gerrit.
          tmurtola Teemu Murtola added a comment - Merged in https://github.com/jenkinsci/gerrit-trigger-plugin/pull/295

          People

            tmurtola Teemu Murtola
            ejusjud Jussi Judin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: