aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Smith <[email protected]>2025-05-19 09:53:22 +0000
committerDaniel Smith <[email protected]>2025-06-03 07:00:10 +0000
commit740e826acf19bc48c1d4b94cb1a40956f1ac17a4 (patch)
tree5e280a9c042277215c3f9e77e83959bc6cc90609
parent3b6743f53cfbe0b01d35848d23e16e11231621eb (diff)
Update the Core Benchmarks Server to handle new reposHEADdev
QtSVG has some benchmarks that are suitable to run as part of this benchmarks agent environment. The coordinator now includes repo as a parameter on Work items so that agents have the required information to clone the repo. Fixes: QTQAINFRA-7183 Change-Id: Iaa2161bdeddd7bf671656f25dbd4e95fd4de0f46 Reviewed-by: Audun Sutterud <[email protected]> Reviewed-by: Daniel Smith <[email protected]>
-rw-r--r--plugin_bots/core_benchmarks_server/core_benchmarks_server.js24
1 files changed, 17 insertions, 7 deletions
diff --git a/plugin_bots/core_benchmarks_server/core_benchmarks_server.js b/plugin_bots/core_benchmarks_server/core_benchmarks_server.js
index 3cb8b1f..cbe0665 100644
--- a/plugin_bots/core_benchmarks_server/core_benchmarks_server.js
+++ b/plugin_bots/core_benchmarks_server/core_benchmarks_server.js
@@ -77,7 +77,8 @@ postgreSQLClient.pool.query(`CREATE TABLE IF NOT EXISTS core_benchmarks
agents TEXT[],
done BOOL[],
job_done BOOL,
- timestamp TIMESTAMP WITHOUT TIME ZONE
+ timestamp TIMESTAMP WITHOUT TIME ZONE,
+ repo TEXT
)
`);
@@ -108,6 +109,7 @@ class Work {
this.integrationURL = o.integrationURL,
this.integrationData = o.integrationData;
this.branch = o.branch;
+ this.repo = o.repo;
this.sha = o.sha;
this.status = o.status || Status.Idle;
this.detailMessage = o.detailMessage;
@@ -215,13 +217,18 @@ function dbCheckIfWorkNeeded(uuid, integrationId, agents, timestamp) {
let doneVals = [];
doneVals.length = agents.length;
doneVals.fill(false);
+ // The repo will be filled later by getWorkFromIntegration, but the column needs a value.
+ // It's not available directly at this stage from the initial trigger.
+ // We'll use the project from the incoming request if available, or null.
+ // However, the primary source of truth for repo will be from COIN.
+ // For now, let's pass null and ensure getWorkFromIntegration updates it.
enqueueDBAction(uuid, integrationId, postgreSQLClient.insert,
[
"core_benchmarks",
["integration_id","work_sha","integration_timestamp","agents","done",
- "job_done", "timestamp"],
+ "job_done", "timestamp", "repo"],
[integrationId, null, timestamp, agents, doneVals, false,
- new Date(Date.now()).toISOString()],
+ new Date(Date.now()).toISOString(), null],
(success, rows) => {
if (success)
resolve() // DB insert successful.
@@ -258,7 +265,7 @@ function getWorkFromIntegration(uuid, integrationId, timestamp, isRetry) {
integrationData.push({
subject: task.tested_changes[change].subject,
sha: task.tested_changes[change].sha,
- url: `https://codereview.qt-project.org/c/qt%2Fqtbase/+/${task.tested_changes[change].change_number}`
+ url: `https://codereview.qt-project.org/c/${encodeURIComponent(task.project)}/+/${task.tested_changes[change].change_number}`
})
}
let work = new Work({
@@ -267,6 +274,7 @@ function getWorkFromIntegration(uuid, integrationId, timestamp, isRetry) {
integrationURL: task.self_url,
integrationData: integrationData,
branch: task.branch,
+ repo: task.project,
sha: task.final_sha
})
enqueueDBAction(uuid, integrationId, postgreSQLClient.update,
@@ -278,6 +286,7 @@ function getWorkFromIntegration(uuid, integrationId, timestamp, isRetry) {
integration_url: work.integrationURL,
integration_data: Buffer.from(safeJsonStringify(integrationData)).toString('base64'),
branch: work.branch,
+ repo: work.repo,
work_sha: work.sha
},
null
@@ -395,6 +404,7 @@ class core_benchmarks_server {
integrationURL: sorted[i].integration_url,
integrationData: JSON.parse(Buffer.from(sorted[i].integration_data, 'base64')),
branch: sorted[i].branch,
+ repo: sorted[i].repo,
sha: sorted[i].work_sha
})
);
@@ -468,8 +478,8 @@ class core_benchmarks_server {
req.uuid = uuidv1(); // used for tracking and database access.
req.fullChangeID = encodeURIComponent(`${req.change.project}~${req.change.branch}~${req.change.id}`);
req.change.fullChangeID = req.fullChangeID;
- if (!["qt/qtbase", "tqtc/qt-qtbase"].includes(req.change.project)) {
- return; // Only process changes from qtbase.
+ if (!["qt/qtbase", "qt/tqtc-qtbase", "qt/qtsvg", "qt/tqtc-qtsvg"].includes(req.change.project)) {
+ return; // Only process changes from qtbase or qtsvg.
}
collectIntegrationId(req.uuid, req.fullChangeID)
.then(([integrationId, timestamp]) => {
@@ -563,7 +573,7 @@ class core_benchmarks_server {
console.log("mockItem called.")
if (!agents[agentName].workQueue.length) {
- let tempWork = new Work({integrationId: "1682362890", sha: "e3fdd9715fa220d909689def10e9b72c14083e09", branch: "dev"});
+ let tempWork = new Work({integrationId: "1682362890", repo: "qt/qtbase", sha: "e3fdd9715fa220d909689def10e9b72c14083e09", branch: "dev"});
if (!integrationIdsInProcess.includes(tempWork.integrationId)) {
integrationIdsInProcess.push(tempWork.integrationId);
enqueueWork(agentName, tempWork);