Option to pass extra flags gerrit command in findGerritChange()
Related-To: PRODX-10059
Change-Id: I1b1329ab9829007ca23dc09472f9f036bda88184
diff --git a/src/com/mirantis/mk/Gerrit.groovy b/src/com/mirantis/mk/Gerrit.groovy
index 88da957..07c6b5d 100644
--- a/src/com/mirantis/mk/Gerrit.groovy
+++ b/src/com/mirantis/mk/Gerrit.groovy
@@ -320,11 +320,13 @@
* HOST, PORT and USER
* @param changeParams Parameters to identify Geriit change e.g.: owner, topic,
* status, branch, project
+ * @param extraFlags Additional flags for gerrit querry for example
+ * '--current-patch-set' or '--comments' as a simple string
*/
-def findGerritChange(credentialsId, LinkedHashMap gerritAuth, LinkedHashMap changeParams) {
+def findGerritChange(credentialsId, LinkedHashMap gerritAuth, LinkedHashMap changeParams, String extraFlags = '') {
scriptText = """
ssh -p ${gerritAuth['PORT']} ${gerritAuth['USER']}@${gerritAuth['HOST']} \
- gerrit query \
+ gerrit query ${extraFlags} \
--format JSON \
"""
changeParams.each {