From 718feb4d1d0d536d61242a57209040fefaff8642 Mon Sep 17 00:00:00 2001 From: Md Nadim Hossain Date: Wed, 13 Nov 2024 09:46:07 +1100 Subject: [PATCH 1/7] Updated the hook dependency for landing page to the correct hook number. --- modules/tide_landing_page/tide_landing_page.install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/tide_landing_page/tide_landing_page.install b/modules/tide_landing_page/tide_landing_page.install index cc5ffe1c1..c14cd58f6 100644 --- a/modules/tide_landing_page/tide_landing_page.install +++ b/modules/tide_landing_page/tide_landing_page.install @@ -34,7 +34,7 @@ function tide_landing_page_install() { */ function tide_landing_page_update_dependencies() { $dependencies = []; - $dependencies['tide_landing_page'][10102] = ['tide_core' => 10005]; + $dependencies['tide_landing_page'][10101] = ['tide_core' => 10005]; return $dependencies; } From d0998564ed4acb50cd7977b83b374dcd59888768 Mon Sep 17 00:00:00 2001 From: Md Nadim Hossain Date: Wed, 13 Nov 2024 12:14:20 +1100 Subject: [PATCH 2/7] Added hook dependency and updated config location. (#536) --- modules/tide_site/tide_site.install | 2 +- tide_core.install | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/tide_site/tide_site.install b/modules/tide_site/tide_site.install index 329f8110f..8b1bfdfaa 100644 --- a/modules/tide_site/tide_site.install +++ b/modules/tide_site/tide_site.install @@ -25,7 +25,7 @@ function tide_site_install() { */ function tide_site_update_10001() { \Drupal::moduleHandler()->loadInclude('tide_core', 'inc', 'includes/helpers'); - $config_location = [\Drupal::service('extension.list.module')->getPath('tide_site') . '/config/install']; + $config_location = [\Drupal::service('extension.list.module')->getPath('tide_core') . '/config/install']; $configs = [ 'field.storage.taxonomy_term.field_additional_comment' => 'field_storage_config', diff --git a/tide_core.install b/tide_core.install index b249beb52..394aa131a 100644 --- a/tide_core.install +++ b/tide_core.install @@ -62,6 +62,16 @@ function tide_core_install() { $tideCoreOperation->alterParagraphsLibrary(); } +/** + * Implements hook_update_dependencies(). + */ +function tide_core_update_dependencies() { + $dependencies = []; + $dependencies['tide_core'][10007] = ['bay_platform_dependencies' => 10003]; + + return $dependencies; +} + /** * Increase character limit of URLs. */ From 4dbcef4e576c297faf76602b84484b28d392f727 Mon Sep 17 00:00:00 2001 From: Md Nadim Hossain Date: Wed, 13 Nov 2024 12:46:48 +1100 Subject: [PATCH 3/7] Added hook dependency for paragraph library updates. --- modules/tide_landing_page/tide_landing_page.install | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/tide_landing_page/tide_landing_page.install b/modules/tide_landing_page/tide_landing_page.install index c14cd58f6..243e63264 100644 --- a/modules/tide_landing_page/tide_landing_page.install +++ b/modules/tide_landing_page/tide_landing_page.install @@ -35,6 +35,7 @@ function tide_landing_page_install() { function tide_landing_page_update_dependencies() { $dependencies = []; $dependencies['tide_landing_page'][10101] = ['tide_core' => 10005]; + $dependencies['tide_landing_page'][10106] = ['tide_core' => 10009]; return $dependencies; } From 659c9e6c10f6c972c5983c728cf3ac6f5bfa8e77 Mon Sep 17 00:00:00 2001 From: Nick Santamaria Date: Thu, 14 Nov 2024 11:04:35 +1100 Subject: [PATCH 4/7] Fixed PHP warning for accessing array offset on null (#538) --- .../Plugin/jsonapi/FieldEnhancer/YamlEnhancer.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/modules/tide_api/src/Plugin/jsonapi/FieldEnhancer/YamlEnhancer.php b/modules/tide_api/src/Plugin/jsonapi/FieldEnhancer/YamlEnhancer.php index 878d6c938..6f19e0c69 100644 --- a/modules/tide_api/src/Plugin/jsonapi/FieldEnhancer/YamlEnhancer.php +++ b/modules/tide_api/src/Plugin/jsonapi/FieldEnhancer/YamlEnhancer.php @@ -23,14 +23,12 @@ class YamlEnhancer extends ResourceFieldEnhancerBase { */ protected function doUndoTransform($data, Context $context) { $data = Yaml::decode($data); - $markup_text = $data['markup']['#markup']; - $processed_text = $data['processed_text']['#text']; - - if (!empty($processed_text)) { - $data['processed_text']['#text'] = $this->processText($processed_text); + + if (!empty($data['markup']['#markup'])) { + $data['processed_text']['#text'] = $this->processText($data['markup']['#markup']); } - if (!empty($markup_text)) { - $data['markup']['#markup'] = $this->processText($markup_text); + if (!empty($data['markup']['#markup'])) { + $data['markup']['#markup'] = $this->processText($data['markup']['#markup']); } return $data; From 15dc4538dcf81c9b7a33fb71bdbe1b9ba7d7ea9a Mon Sep 17 00:00:00 2001 From: Md Nadim Hossain Date: Thu, 14 Nov 2024 11:30:57 +1100 Subject: [PATCH 5/7] Added option to ignore service if not available. (#539) * Added option to ignore service if not available. --- .circleci/merge-to-reference.sh | 21 --------------------- .github/workflows/build.yml | 24 ------------------------ src/TideSystemInfoService.php | 10 ++++++---- tide_core.services.yml | 2 +- 4 files changed, 7 insertions(+), 50 deletions(-) delete mode 100755 .circleci/merge-to-reference.sh diff --git a/.circleci/merge-to-reference.sh b/.circleci/merge-to-reference.sh deleted file mode 100755 index db8b679ef..000000000 --- a/.circleci/merge-to-reference.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash -## -# Merge develop to reference branch in CI. -# - -echo "==> Checking out reference branch" -git checkout reference -echo "==> Merging develop to reference branch" -git merge develop -git checkout develop -- composer.json -git add . -echo "==> Replacing composer require entries starting with dpc-sdp with value dev-reference" -cat composer.json | gojq '.require |= with_entries( - if (.key | test("dpc-sdp/tide")) - then .value = "dev-reference" end)' > composer.json.backup -mv -f composer.json.backup composer.json -echo "==> Add all changes" -git add . -git commit -m "Merge changes from develop." -echo "==> Push the changes to remote reference branch" -git push origin --force reference diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e1caf8d6d..9eb80315a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,16 +5,6 @@ on: workflow_dispatch: jobs: - set_status_in_progress: - name: set_status_in_progress - if: always() - uses: dpc-sdp/github-actions/.github/workflows/set_status.yml@v1.2.0 - secrets: inherit - with: - context: 'tide_build' - description: 'Tide Build running...' - state: 'pending' - target_url: ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }} tide_build: name: tide_build secrets: inherit @@ -22,17 +12,3 @@ jobs: with: module_build: true runner: biggy-tide - export_config: - name: export_config - secrets: inherit - uses: dpc-sdp/github-actions/.github/workflows/export_config.yml@v1.2.0 - set_status: - name: set_status - needs: [tide_build] - if: always() - uses: dpc-sdp/github-actions/.github/workflows/set_status.yml@v1.2.0 - secrets: inherit - with: - context: 'tide_build' - description: 'Tide Build' - target_url: ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }} diff --git a/src/TideSystemInfoService.php b/src/TideSystemInfoService.php index 13a42b944..fed2f4fa4 100644 --- a/src/TideSystemInfoService.php +++ b/src/TideSystemInfoService.php @@ -226,10 +226,12 @@ function ($entityType) { */ public function getPackageVersion($packageName) { if (empty($packageName)) { - $result = $this->sensorRunner->runSensors([SensorConfig::load('tide_times')]); - $value = $result[0]->getValue(); - $decodedValue = json_decode($value, TRUE); - return $decodedValue; + if ($this->sensorRunner) { + $result = $this->sensorRunner->runSensors([SensorConfig::load('tide_times')]); + $value = $result[0]->getValue(); + $decodedValue = json_decode($value, TRUE); + return $decodedValue; + } } if (strtolower($packageName) === 'php') { diff --git a/tide_core.services.yml b/tide_core.services.yml index c332995ba..49d7fb1d1 100644 --- a/tide_core.services.yml +++ b/tide_core.services.yml @@ -34,4 +34,4 @@ services: - '@entity_field.manager' - '@logger.factory' - '@file_system' - - '@monitoring.sensor_runner' + - '@?monitoring.sensor_runner' From fe35eb9cc0f552e78475e0f84d79c6278521b43a Mon Sep 17 00:00:00 2001 From: Nick Santamaria Date: Thu, 14 Nov 2024 11:54:41 +1100 Subject: [PATCH 6/7] Removed obsolete circleci config (#541) --- .circleci/config.yml | 102 ------------------------------------------- 1 file changed, 102 deletions(-) delete mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 32b5c1779..000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,102 +0,0 @@ -version: 2 -aliases: - - &ssh_key_fingerprint "36:03:e3:ca:b3:0b:82:18:e2:e9:ae:5d:81:17:86:b1" - # Fingerprint of the SSH deploy key of the project used to pull code. - # The value can be found in CircleCI UI -> SSH Permissions. - - - &step_configure_git - run: - name: Configure git - command: | - git config --global user.email "$DEPLOY_USER_EMAIL" && git config --global user.name "$DEPLOY_USER_NAME" - - # Re-usable job to run different types of builds. - - &job-build - working_directory: &working-directory /app - docker: - - image: &builder-image singledigital/bay-ci-builder:5.x - environment: - INSTALL_NEW_SITE: 1 - LAGOON_ENVIRONMENT_TYPE: ci - steps: - - attach_workspace: - at: /workspace - - checkout - # Init environment for development. - - run: if [ -f "./dev-tools.sh" ] && [ ! "$DEV_TOOLS" ]; then ./dev-tools.sh; fi - - setup_remote_docker: - docker_layer_caching: true - - run: .circleci/build.sh - - run: .circleci/test.sh - - run: - name: Copy artifacts - command: .circleci/test-artifacts.sh - when: always - - store_artifacts: - path: /tmp/artifacts - - # Job to perform merge to reference branch after a merge to develop. - - &merge-to-reference - working_directory: *working-directory - docker: - - image: *builder-image - auth: - username: $DOCKERHUB_USERNAME - password: $DOCKERHUB_PASSWORD - environment: - LAGOON_ENVIRONMENT_TYPE: ci - SSH_KEY_FINGERPRINT: *ssh_key_fingerprint - DEPLOY_USER_EMAIL: sdp.devs@dpc.vic.gov.au - DEPLOY_USER_NAME: sdpdeploy - steps: - - attach_workspace: - at: /workspace - - checkout - - *step_configure_git - - setup_remote_docker: - docker_layer_caching: true - - add_ssh_keys: - fingerprints: - - *ssh_key_fingerprint - - run: - name: Merge to reference branch - command: .circleci/merge-to-reference.sh - no_output_timeout: 30m - - -jobs: - build: - <<: *job-build - - build_suggest: - <<: *job-build - docker: - - image: *builder-image - environment: - INSTALL_NEW_SITE: 1 - LAGOON_ENVIRONMENT_TYPE: ci - INSTALL_SUGGEST: 1 - BEHAT_PROFILE: "--profile=suggest" - - merge_to_reference: - <<: *merge-to-reference - - -workflows: - version: 2 - main: - jobs: - - build - - build_suggest: - filters: - branches: - ignore: - - reference - - mergetoreference: - jobs: - - merge_to_reference: - filters: - branches: - only: - - develop From 6b67c712c96302aba05ca303ae4c57e7e42df8eb Mon Sep 17 00:00:00 2001 From: Nick Santamaria Date: Thu, 14 Nov 2024 13:22:42 +1100 Subject: [PATCH 7/7] Added actions workflow to clean up stale PRs (#540) * Added actions workflow to clean up stale PRs --------- Co-authored-by: Md Nadim Hossain --- .../pull-request-reviewer-reminder.yml | 21 +++++++++++++++++++ .../jsonapi/FieldEnhancer/YamlEnhancer.php | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/pull-request-reviewer-reminder.yml diff --git a/.github/workflows/pull-request-reviewer-reminder.yml b/.github/workflows/pull-request-reviewer-reminder.yml new file mode 100644 index 000000000..47188d8a2 --- /dev/null +++ b/.github/workflows/pull-request-reviewer-reminder.yml @@ -0,0 +1,21 @@ +name: 'Close stale issues and PRs' +on: + workflow_dispatch: + schedule: + - cron: '30 1 * * *' + +permissions: + contents: write # only for delete-branch option + issues: write + pull-requests: write + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v9 + with: + exempt-pr-labels: "DO NOT MERGE" + stale-issue-message: 'This issue is stale because it has been open 28 days with no activity. Remove stale label or comment or this will be closed in 14 days.' + days-before-stale: 28 + days-before-close: 14 diff --git a/modules/tide_api/src/Plugin/jsonapi/FieldEnhancer/YamlEnhancer.php b/modules/tide_api/src/Plugin/jsonapi/FieldEnhancer/YamlEnhancer.php index 6f19e0c69..c663fd204 100644 --- a/modules/tide_api/src/Plugin/jsonapi/FieldEnhancer/YamlEnhancer.php +++ b/modules/tide_api/src/Plugin/jsonapi/FieldEnhancer/YamlEnhancer.php @@ -23,7 +23,7 @@ class YamlEnhancer extends ResourceFieldEnhancerBase { */ protected function doUndoTransform($data, Context $context) { $data = Yaml::decode($data); - + if (!empty($data['markup']['#markup'])) { $data['processed_text']['#text'] = $this->processText($data['markup']['#markup']); }