From 3a3332cc84c843a6fe8f0994aa1a485f5215ac9c Mon Sep 17 00:00:00 2001 From: Zack Galbreath Date: Thu, 25 Jan 2024 11:43:23 -0500 Subject: [PATCH 1/3] Fix authtoken generation for CDash in a subpath (#1973) Prior to this commit, when attempting to create (or delete) an auth token, CDash would erroneously strip the subpath from the URL that it is making a POST request to. ie it would POST to: https://mydomain.com/api/authtokens/create instead of: https://mydomain.com/cdash/api/authtokens/create --- app/cdash/public/js/controllers/user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/cdash/public/js/controllers/user.js b/app/cdash/public/js/controllers/user.js index dbe2d0f7a1..7cefad8d98 100644 --- a/app/cdash/public/js/controllers/user.js +++ b/app/cdash/public/js/controllers/user.js @@ -8,7 +8,7 @@ CDash.controller('UserController', ["$scope", "$http", "$timeout", "apiLoader", projectid: $scope.cdash.tokenscope === 'full_access' || $scope.cdash.tokenscope === 'submit_only' ? -1 : $scope.cdash.tokenscope }; - $http.post('/api/authtokens/create', parameters) + $http.post('api/authtokens/create', parameters) .then(function success(s) { const authtoken = s.data.token; authtoken.copied = false; @@ -39,7 +39,7 @@ CDash.controller('UserController', ["$scope", "$http", "$timeout", "apiLoader", $scope.revokeToken = function(authtoken) { $http({ - url: `/api/authtokens/delete/${authtoken.hash}`, + url: `api/authtokens/delete/${authtoken.hash}`, method: 'DELETE', }).then(function success() { // Remove this token from our list. From eb2cec01d53afdb53d69ad298e3aa08e43796b2d Mon Sep 17 00:00:00 2001 From: Zack Galbreath Date: Fri, 26 Jan 2024 12:37:20 -0500 Subject: [PATCH 2/3] Special handling for per-message delays with sqs-fifo (backport to 3.2) (#1976) --- app/Jobs/ProcessSubmission.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/Jobs/ProcessSubmission.php b/app/Jobs/ProcessSubmission.php index 8e57d59dc1..5b50b24535 100644 --- a/app/Jobs/ProcessSubmission.php +++ b/app/Jobs/ProcessSubmission.php @@ -94,7 +94,14 @@ private function requeueSubmissionFile($buildid): bool // Requeue the file with exponential backoff. PendingSubmissions::IncrementForBuildId($this->buildid); $delay = pow(config('cdash.retry_base'), $retry_handler->Retries); - self::dispatch($this->filename, $this->projectid, $buildid, md5_file(Storage::path("inbox/{$this->filename}")))->delay(now()->addSeconds($delay)); + if (config('queue.default') === 'sqs-fifo') { + // Special handling for sqs-fifo, which does not support per-message delays. + sleep(10); + self::dispatch($this->filename, $this->projectid, $buildid, md5_file(Storage::path("inbox/{$this->filename}"))); + } else { + self::dispatch($this->filename, $this->projectid, $buildid, md5_file(Storage::path("inbox/{$this->filename}")))->delay(now()->addSeconds($delay)); + } + return true; } } From 4aeeb618a88c1a20b391ac7a326e717dc6a0bcf2 Mon Sep 17 00:00:00 2001 From: Zack Galbreath Date: Fri, 26 Jan 2024 12:40:47 -0500 Subject: [PATCH 3/3] Remove hardcoded "LIMIT 10" in autoremove.php (backport to 3.2) (#1977) --- app/cdash/include/autoremove.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/cdash/include/autoremove.php b/app/cdash/include/autoremove.php index 941c800c9e..8b8666a9f2 100644 --- a/app/cdash/include/autoremove.php +++ b/app/cdash/include/autoremove.php @@ -91,7 +91,7 @@ function removeFirstBuilds($projectid, $days, $maxbuilds, $force = false, $echo add_log('about to query for builds to remove', 'removeFirstBuilds'); $db = Database::getInstance(); - $builds = $db->executePrepared(' + $builds = $db->executePrepared(" SELECT id FROM build WHERE @@ -99,8 +99,8 @@ function removeFirstBuilds($projectid, $days, $maxbuilds, $force = false, $echo AND starttime