From ec92fccaa4b8fa9d0e729aa851e1050798be475b Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Wed, 22 May 2024 16:39:02 +1200 Subject: [PATCH 1/2] MNT Upaded scheduled workflows on default branch --- .github/workflows/dispatch-ci.yml | 13 +++++++++---- .github/workflows/merge-up.yml | 22 ++++++++++++++++++++++ 2 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/merge-up.yml diff --git a/.github/workflows/dispatch-ci.yml b/.github/workflows/dispatch-ci.yml index 3975a7bd..feda0a3d 100644 --- a/.github/workflows/dispatch-ci.yml +++ b/.github/workflows/dispatch-ci.yml @@ -1,16 +1,21 @@ name: Dispatch CI on: - # At 12:30 PM UTC, only on Sunday and Monday + # At 5:25 PM UTC, only on Wednesday and Thursday schedule: - - cron: '30 12 * * 0,1' + - cron: '25 17 * * 3,4' + +permissions: {} jobs: dispatch-ci: name: Dispatch CI - # Only run cron on the silverstripe account - if: (github.event_name == 'schedule' && github.repository_owner == 'silverstripe') || (github.event_name != 'schedule') + # Only run cron on the symbiote account + if: (github.event_name == 'schedule' && github.repository_owner == 'symbiote') || (github.event_name != 'schedule') runs-on: ubuntu-latest + permissions: + contents: read + actions: write steps: - name: Dispatch CI uses: silverstripe/gha-dispatch-ci@v1 diff --git a/.github/workflows/merge-up.yml b/.github/workflows/merge-up.yml new file mode 100644 index 00000000..eccaad61 --- /dev/null +++ b/.github/workflows/merge-up.yml @@ -0,0 +1,22 @@ +name: Merge-up + +on: + # At 5:25 PM UTC, only on Sunday + schedule: + - cron: '25 17 * * 0' + workflow_dispatch: + +permissions: {} + +jobs: + merge-up: + name: Merge-up + # Only run cron on the symbiote account + if: (github.event_name == 'schedule' && github.repository_owner == 'symbiote') || (github.event_name != 'schedule') + runs-on: ubuntu-latest + permissions: + contents: write + actions: write + steps: + - name: Merge-up + uses: silverstripe/gha-merge-up@v1 From 793e73da01bb91394ab4576bdc258fc6bdaf8e86 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Fri, 14 Jun 2024 21:50:38 +1200 Subject: [PATCH 2/2] ENH Use class name instead of self --- src/Controllers/QueuedJobsAdmin.php | 4 ++-- src/Services/QueuedJobService.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Controllers/QueuedJobsAdmin.php b/src/Controllers/QueuedJobsAdmin.php index 29b49517..e960719c 100644 --- a/src/Controllers/QueuedJobsAdmin.php +++ b/src/Controllers/QueuedJobsAdmin.php @@ -94,7 +94,7 @@ public function getEditForm($id = null, $fields = null) { $form = parent::getEditForm($id, $fields); - $filter = $this->jobQueue->getJobListFilter(null, self::config()->max_finished_jobs_age); + $filter = $this->jobQueue->getJobListFilter(null, static::config()->max_finished_jobs_age); $list = QueuedJobDescriptor::get()->where($filter)->sort('Created', 'DESC'); @@ -199,7 +199,7 @@ public function createjob($data, Form $form) // If the user has select the European date format as their setting then replace '/' with '-' in the // date string so PHP treats the date as this format. - if (Security::getCurrentUser()->DateFormat == self::$date_format_european) { + if (Security::getCurrentUser()->DateFormat == QueuedJobsAdmin::$date_format_european) { $time = str_replace('/', '-', $time ?? ''); } diff --git a/src/Services/QueuedJobService.php b/src/Services/QueuedJobService.php index 69edadf7..20eddc46 100644 --- a/src/Services/QueuedJobService.php +++ b/src/Services/QueuedJobService.php @@ -1321,7 +1321,7 @@ public function getJobListFilter($type = null, $includeUpUntil = 0) */ public function runQueue($queue) { - if (!self::config()->get('disable_health_check')) { + if (!static::config()->get('disable_health_check')) { $this->checkJobHealth($queue); } $this->checkdefaultJobs($queue);