aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Smith <[email protected]>2025-06-19 09:46:27 +0000
committerDaniel Smith <[email protected]>2025-06-30 09:55:48 +0000
commitcb374a899c4c0fb12e09ec9aae4218b34618dbcd (patch)
treee3959f6f9af236f1648c38f6984bb002e3b6612c
parentcdd30680b8e19a3eb616512861a98ceed186ce7f (diff)
Add Subject search functionality to cherrypick_status_db pluginHEADdev
Task-number: QTQAINFRA-7257 Change-Id: I2fb8bedcc24a9487d454364da2f76860bde3700e Reviewed-by: Daniel Smith <[email protected]>
-rw-r--r--plugin_bots/cherrypick_status_db/cherrypick_status_db.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugin_bots/cherrypick_status_db/cherrypick_status_db.js b/plugin_bots/cherrypick_status_db/cherrypick_status_db.js
index 1eda3b5..b438547 100644
--- a/plugin_bots/cherrypick_status_db/cherrypick_status_db.js
+++ b/plugin_bots/cherrypick_status_db/cherrypick_status_db.js
@@ -99,7 +99,7 @@ class cherrypick_status_db {
}
// Extract parameters, defaulting boolean flags to false if undefined
- let { repos, owner, page, branches: branchesParam, hashtags: hashtagsParam, onlyStuck = false, exclAbandon = false, onlyExternalTqtc = false, changeId } = req.body;
+ let { repos, owner, page, branches: branchesParam, hashtags: hashtagsParam, onlyStuck = false, exclAbandon = false, onlyExternalTqtc = false, changeId, subject } = req.body;
let branchesArray = [];
let hashtagsArray = [];
@@ -187,6 +187,11 @@ class cherrypick_status_db {
queryParams.push(owner);
}
+ if (subject && typeof subject === 'string' && subject.trim()) {
+ whereClauses.push(`subject ILIKE ('%' || $${queryParams.length + 1} || '%')`);
+ queryParams.push(subject.trim());
+ }
+
// Add filter for hashtags if provided
if (hashtagsArray.length > 0) {
whereClauses.push(`