From dafa0f1f4f16de12286263c08cfdcdc2fff6e8c8 Mon Sep 17 00:00:00 2001 From: Victor Alfaro Date: Wed, 11 Dec 2024 08:46:42 -0600 Subject: [PATCH 1/6] Removing color typo from workflow_call event (#30915) --- .github/workflows/issue_comp_release-labeling.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/issue_comp_release-labeling.yml b/.github/workflows/issue_comp_release-labeling.yml index f53d55db6e2a..08c889a09e51 100644 --- a/.github/workflows/issue_comp_release-labeling.yml +++ b/.github/workflows/issue_comp_release-labeling.yml @@ -19,7 +19,7 @@ on: description: 'New label color' type: string required: false - default: '#fbca04' + default: 'fbca04' workflow_dispatch: inputs: rename_label: From 8af2d78c3a39f1c655ac61b1ab9485102b24f433 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Enrique=20Colina=20Rodr=C3=ADguez?= Date: Wed, 11 Dec 2024 19:33:12 +0100 Subject: [PATCH 2/6] chore(deployment): pin ubuntu version used by github (#30871) (#30907) ### Proposed Changes * This pull request proposes updating all Ubuntu runners in our CICD pipelines to version 24.04. * A new GitHub repository variable is needed. `UBUNTU_RUNNER_VERSION` must be set to `24.04`; otherwise, workflows will default to using `22.04`. ## Details We conducted thorough testing with the following setups: *Ubuntu 22.04:* - Executed main CICD workflows (PR, Merge Queue, Trunk, and Nightly) on fork. All runs completed successfully without any unusual behavior. *Ubuntu 24.04:* - Repeated the same tests with runners updated to 24.04. Similarly, all workflows ran correctly, with no anomalies observed. ### Proposal - Given the successful results in both cases, we propose setting the runners directly to version 24.04 to streamline the update process. ### Next Steps - Merge this PR to update the Ubuntu runners. - Monitor post-deployment to ensure stability across all workflows. ### Fixes #30871 --- .../actions/core-cicd/api-limits-check/Readme.md | 2 +- .github/actions/core-cicd/cleanup-runner/Readme.md | 2 +- .../core-cicd/deployment/deploy-javadoc/README.md | 2 +- .../deployment/deploy-javascript-sdk/README.md | 2 +- .../core-cicd/deployment/deploy-jfrog/README.md | 2 +- .github/actions/core-cicd/maven-job/README.md | 2 +- .../core-cicd/notification/notify-slack/README.md | 2 +- .github/actions/core-cicd/prepare-runner/README.md | 2 +- .github/actions/core-cicd/setup-java/README.md | 2 +- .github/workflows/cicd_comp_build-phase.yml | 2 +- .../workflows/cicd_comp_cli-native-build-phase.yml | 6 +++--- .github/workflows/cicd_comp_deployment-phase.yml | 2 +- .github/workflows/cicd_comp_finalize-phase.yml | 4 ++-- .github/workflows/cicd_comp_initialize-phase.yml | 6 +++--- .github/workflows/cicd_comp_pr-notifier.yml | 4 ++-- .github/workflows/cicd_comp_semgrep-phase.yml | 4 ++-- .github/workflows/cicd_comp_sonarqube-phase.yml | 2 +- .github/workflows/cicd_comp_test-phase.yml | 14 +++++++------- .../workflows/cicd_manual_build-docker-context.yml | 2 +- .github/workflows/cicd_manual_build-java-base.yml | 2 +- .github/workflows/cicd_manual_publish-starter.yml | 4 ++-- .github/workflows/cicd_post-workflow-reporting.yml | 2 +- .github/workflows/cicd_release-cli.yml | 8 ++++---- .../workflows/cicd_scheduled_notify-seated-prs.yml | 4 ++-- .github/workflows/issue_comp_frontend-notify.yml | 4 ++-- .../issue_comp_github-member-resolver.yml | 2 +- .../issue_comp_label-conditional-labeling.yml | 2 +- .github/workflows/issue_comp_link-issue-to-pr.yml | 2 +- .github/workflows/issue_comp_link-pr-to-issue.yml | 2 +- .github/workflows/issue_comp_release-labeling.yml | 2 +- .github/workflows/issue_manual_label-issues.yml | 2 +- ...issue_on-change_assign-issues-to-qa-project.yml | 2 +- .github/workflows/issue_scheduled_stale-action.yml | 2 +- ...egacy-release_comp_maven-build-docker-image.yml | 2 +- .../legacy-release_maven-release-process.yml | 8 ++++---- ...acy-release_publish-docker-image-on-release.yml | 4 ++-- .../legacy-release_publish-dotcms-docker-image.yml | 2 +- .../workflows/legacy-release_release-candidate.yml | 4 ++-- .../workflows/legacy-release_release-trigger.yml | 2 +- .../workflows/legacy-release_sbom-generator.yaml | 2 +- .github/workflows/publish_docs.yml | 2 +- .github/workflows/utility_discover-docker-tags.yml | 2 +- .../workflows/utility_slack-channel-resolver.yml | 2 +- tools/dotcms-cli/action/.github/workflows/main.yml | 4 ++-- 44 files changed, 69 insertions(+), 69 deletions(-) diff --git a/.github/actions/core-cicd/api-limits-check/Readme.md b/.github/actions/core-cicd/api-limits-check/Readme.md index e5c7e8823e2e..5384c59432c6 100644 --- a/.github/actions/core-cicd/api-limits-check/Readme.md +++ b/.github/actions/core-cicd/api-limits-check/Readme.md @@ -24,7 +24,7 @@ on: jobs: check-rate-limits: - runs-on: ubuntu-latest + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} steps: - name: Check API Rate Limit uses: your-repo/check-rate-limit-action@v1 diff --git a/.github/actions/core-cicd/cleanup-runner/Readme.md b/.github/actions/core-cicd/cleanup-runner/Readme.md index 0b13db0e1283..6559555feeef 100644 --- a/.github/actions/core-cicd/cleanup-runner/Readme.md +++ b/.github/actions/core-cicd/cleanup-runner/Readme.md @@ -40,7 +40,7 @@ Here's an example of how to incorporate this action into your workflow: ```yaml jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} steps: - uses: actions/checkout@v2 diff --git a/.github/actions/core-cicd/deployment/deploy-javadoc/README.md b/.github/actions/core-cicd/deployment/deploy-javadoc/README.md index 8cb3cf6ff745..212d5484354b 100644 --- a/.github/actions/core-cicd/deployment/deploy-javadoc/README.md +++ b/.github/actions/core-cicd/deployment/deploy-javadoc/README.md @@ -53,7 +53,7 @@ on: jobs: deploy-javadoc: - runs-on: ubuntu-latest + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} steps: - name: Deploy Artifact Javadoc uses: ./.github/actions/deploy-artifact-javadoc diff --git a/.github/actions/core-cicd/deployment/deploy-javascript-sdk/README.md b/.github/actions/core-cicd/deployment/deploy-javascript-sdk/README.md index bc0eaff8d859..a61f1618edd2 100644 --- a/.github/actions/core-cicd/deployment/deploy-javascript-sdk/README.md +++ b/.github/actions/core-cicd/deployment/deploy-javascript-sdk/README.md @@ -71,7 +71,7 @@ on: jobs: publish-sdk: - runs-on: ubuntu-latest + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} steps: - name: Publish to NPM uses: ./.github/actions/core-cicd/deployment/deploy-javascript-sdk diff --git a/.github/actions/core-cicd/deployment/deploy-jfrog/README.md b/.github/actions/core-cicd/deployment/deploy-jfrog/README.md index 2cea03804080..a9f82ac995be 100644 --- a/.github/actions/core-cicd/deployment/deploy-jfrog/README.md +++ b/.github/actions/core-cicd/deployment/deploy-jfrog/README.md @@ -32,7 +32,7 @@ on: jobs: deploy: - runs-on: ubuntu-latest + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} steps: - uses: actions/checkout@v4 diff --git a/.github/actions/core-cicd/maven-job/README.md b/.github/actions/core-cicd/maven-job/README.md index 696fdae5d68c..b9e1284d3371 100644 --- a/.github/actions/core-cicd/maven-job/README.md +++ b/.github/actions/core-cicd/maven-job/README.md @@ -71,7 +71,7 @@ Here's an example of how to incorporate this action into your workflow: ```yaml jobs: build-and-test: - runs-on: ubuntu-latest + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} steps: - uses: actions/checkout@v2 diff --git a/.github/actions/core-cicd/notification/notify-slack/README.md b/.github/actions/core-cicd/notification/notify-slack/README.md index fcf493dd14e0..1baf0122849f 100644 --- a/.github/actions/core-cicd/notification/notify-slack/README.md +++ b/.github/actions/core-cicd/notification/notify-slack/README.md @@ -24,7 +24,7 @@ on: jobs: notify: - runs-on: ubuntu-latest + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} steps: - name: Send Slack Notification uses: ./ diff --git a/.github/actions/core-cicd/prepare-runner/README.md b/.github/actions/core-cicd/prepare-runner/README.md index bb6c4b3f5906..e033156247d1 100644 --- a/.github/actions/core-cicd/prepare-runner/README.md +++ b/.github/actions/core-cicd/prepare-runner/README.md @@ -53,7 +53,7 @@ Here's an example of how to incorporate this action into your workflow: ```yaml jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} steps: - uses: actions/checkout@v2 diff --git a/.github/actions/core-cicd/setup-java/README.md b/.github/actions/core-cicd/setup-java/README.md index 03ef334faba0..9042bc18403e 100644 --- a/.github/actions/core-cicd/setup-java/README.md +++ b/.github/actions/core-cicd/setup-java/README.md @@ -52,7 +52,7 @@ Here's an example of how to incorporate this action into your workflow: ```yaml jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/cicd_comp_build-phase.yml b/.github/workflows/cicd_comp_build-phase.yml index fd4899a36206..74e3f080ebca 100644 --- a/.github/workflows/cicd_comp_build-phase.yml +++ b/.github/workflows/cicd_comp_build-phase.yml @@ -50,7 +50,7 @@ jobs: # It provides a local Maven repo for subsequent steps. build-jdk11: name: "Initial Artifact Build" - runs-on: ubuntu-20.04 + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} if: inputs.core-build == true permissions: contents: read diff --git a/.github/workflows/cicd_comp_cli-native-build-phase.yml b/.github/workflows/cicd_comp_cli-native-build-phase.yml index 0801812ce3c2..25237b6a876a 100644 --- a/.github/workflows/cicd_comp_cli-native-build-phase.yml +++ b/.github/workflows/cicd_comp_cli-native-build-phase.yml @@ -56,7 +56,7 @@ jobs: # Job to determine the OS matrix for the build os-runners: name: 'Get OS matrix' - runs-on: ubuntu-latest + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} outputs: runners: ${{ steps.set-os.outputs.runners }} steps: @@ -64,9 +64,9 @@ jobs: id: set-os run: | if [[ "${{ inputs.buildNativeImage }}" == "true" ]]; then - RUNNERS='[{ "os": "ubuntu-22.04", "label": "Linux", "platform": "linux-x86_64" }, { "os": "macos-13", "label": "macOS-Intel", "platform": "osx-x86_64" }, { "os": "macos-14", "label": "macOS-Silicon", "platform": "osx-aarch_64" }]' + RUNNERS='[{ "os": "ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }}", "label": "Linux", "platform": "linux-x86_64" }, { "os": "macos-13", "label": "macOS-Intel", "platform": "osx-x86_64" }, { "os": "macos-14", "label": "macOS-Silicon", "platform": "osx-aarch_64" }]' else - RUNNERS='[{ "os": "ubuntu-22.04", "label": "Linux", "platform": "linux-x86_64" }]' + RUNNERS='[{ "os": "ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }}", "label": "Linux", "platform": "linux-x86_64" }]' fi echo "runners=$RUNNERS" >> $GITHUB_OUTPUT diff --git a/.github/workflows/cicd_comp_deployment-phase.yml b/.github/workflows/cicd_comp_deployment-phase.yml index 469b33058c02..96ee509b0b02 100644 --- a/.github/workflows/cicd_comp_deployment-phase.yml +++ b/.github/workflows/cicd_comp_deployment-phase.yml @@ -63,7 +63,7 @@ on: jobs: deployment: - runs-on: ubuntu-latest + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} # Use of Docker environments to enable per-deployment environment secrets # This allows for different secrets to be used based on the deployment environment environment: ${{ inputs.environment }} diff --git a/.github/workflows/cicd_comp_finalize-phase.yml b/.github/workflows/cicd_comp_finalize-phase.yml index 2ce0b9b5a24a..8e4befa5a114 100644 --- a/.github/workflows/cicd_comp_finalize-phase.yml +++ b/.github/workflows/cicd_comp_finalize-phase.yml @@ -28,7 +28,7 @@ on: jobs: prepare-report-data: name: Prepare Report Data - runs-on: ubuntu-20.04 + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} if: always() outputs: aggregate_status: ${{ steps.prepare-workflow-data.outputs.aggregate_status }} @@ -175,7 +175,7 @@ jobs: name: Final Status needs: prepare-report-data if: always() - runs-on: ubuntu-20.04 + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} steps: # Check the final status and fail the workflow if not successful - name: Check Final Status diff --git a/.github/workflows/cicd_comp_initialize-phase.yml b/.github/workflows/cicd_comp_initialize-phase.yml index ac18051761be..0ffcf4b817af 100644 --- a/.github/workflows/cicd_comp_initialize-phase.yml +++ b/.github/workflows/cicd_comp_initialize-phase.yml @@ -53,7 +53,7 @@ jobs: # This job is used as a required check to indicate that the workflow has started and is running initialize: name: Initialize - runs-on: ubuntu-20.04 + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} if: always() steps: - run: echo 'GitHub context' @@ -75,7 +75,7 @@ jobs: # This job checks for artifacts from previous builds and determines if they can be reused check-previous-build: name: Check Previous Build - runs-on: ubuntu-latest + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} outputs: artifact-run-id: ${{ steps.check.outputs.run_id }} found_artifacts: ${{ steps.check.outputs.found_artifacts }} @@ -119,7 +119,7 @@ jobs: name: Check Changed Files needs: [ check-previous-build ] if: always() && !failure() && !cancelled() - runs-on: ubuntu-latest + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} outputs: build: ${{ steps.filter-rewrite.outputs.build }} backend: ${{ steps.filter-rewrite.outputs.backend }} diff --git a/.github/workflows/cicd_comp_pr-notifier.yml b/.github/workflows/cicd_comp_pr-notifier.yml index 29c8da8709f9..1311c2545f71 100644 --- a/.github/workflows/cicd_comp_pr-notifier.yml +++ b/.github/workflows/cicd_comp_pr-notifier.yml @@ -21,7 +21,7 @@ on: jobs: message-resolver: name: Resolve Message - runs-on: ubuntu-20.04 + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} outputs: message: ${{ steps.message-resolver.outputs.message }} steps: @@ -69,7 +69,7 @@ jobs: pr-notifier: needs: [message-resolver, slack-channel-resolver] - runs-on: ubuntu-20.04 + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} strategy: fail-fast: false matrix: diff --git a/.github/workflows/cicd_comp_semgrep-phase.yml b/.github/workflows/cicd_comp_semgrep-phase.yml index 71ca1356a6ba..a4b9c4830d74 100644 --- a/.github/workflows/cicd_comp_semgrep-phase.yml +++ b/.github/workflows/cicd_comp_semgrep-phase.yml @@ -23,7 +23,7 @@ on: jobs: buildmavenDepTree: name: Semgrep Dep Tree - runs-on: ubuntu-latest + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} # Only run on main branch or pull requests in the main repository if: | (github.ref == 'refs/heads/main' || github.event_name == 'pull_request') && github.repository == 'dotCMS/core' @@ -55,7 +55,7 @@ jobs: semgrep: needs: buildmavenDepTree name: Scan - runs-on: ubuntu-20.04 + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} env: SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }} NO_FAIL: ${{ vars.SEMGREP_NO_FAIL || 'false' }} diff --git a/.github/workflows/cicd_comp_sonarqube-phase.yml b/.github/workflows/cicd_comp_sonarqube-phase.yml index 7fde9814a398..e3a7eb960a35 100644 --- a/.github/workflows/cicd_comp_sonarqube-phase.yml +++ b/.github/workflows/cicd_comp_sonarqube-phase.yml @@ -29,7 +29,7 @@ on: jobs: sonarqube: name: SonarQube Scan - runs-on: ubuntu-latest + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} # Only run on main branch or pull requests in the main repository if: | (github.ref == 'refs/heads/main' || github.event_name == 'pull_request') && github.repository == 'dotCMS/core' diff --git a/.github/workflows/cicd_comp_test-phase.yml b/.github/workflows/cicd_comp_test-phase.yml index a588be0db236..61c26bf57ede 100644 --- a/.github/workflows/cicd_comp_test-phase.yml +++ b/.github/workflows/cicd_comp_test-phase.yml @@ -60,7 +60,7 @@ jobs: # JVM Unit Tests linux-jvm-tests: name: JVM Unit Tests - JDK ${{matrix.java.name}} - runs-on: ubuntu-20.04 + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} if: inputs.jvm_unit_test || inputs.run-all-tests timeout-minutes: 240 env: @@ -82,7 +82,7 @@ jobs: # CLI Tests linux-cli-tests: name: CLI Tests - runs-on: ubuntu-20.04 + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} if: inputs.cli || inputs.run-all-tests timeout-minutes: 240 env: @@ -106,7 +106,7 @@ jobs: # Frontend Tests linux-frontend-tests: name: Frontend Unit Tests - runs-on: ubuntu-20.04 + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} if: inputs.frontend || inputs.run-all-tests timeout-minutes: 240 env: @@ -128,7 +128,7 @@ jobs: # Integration Tests linux-integration-tests: name: JVM IT Tests ${{matrix.suites.name}} - runs-on: ubuntu-20.04 + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} if: inputs.integration || inputs.run-all-tests timeout-minutes: 240 env: @@ -162,7 +162,7 @@ jobs: # Postman Tests linux-postman-tests: name: Run Postman Tests - ${{matrix.collection_group}} - runs-on: ubuntu-24.04 + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} if: inputs.postman || inputs.run-all-tests strategy: fail-fast: false @@ -187,7 +187,7 @@ jobs: # Karate Tests karate-tests: name: Karate Tests - ${{ matrix.suites.name }} - runs-on: ubuntu-24.04 + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} if: inputs.karate || inputs.run-all-tests strategy: fail-fast: false @@ -219,7 +219,7 @@ jobs: # E2E Tests linux-e2e-tests: name: E2E Tests ${{matrix.suites.name}} - runs-on: ubuntu-24.04 + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} if: inputs.e2e || inputs.run-all-tests timeout-minutes: 240 env: diff --git a/.github/workflows/cicd_manual_build-docker-context.yml b/.github/workflows/cicd_manual_build-docker-context.yml index 98266aacd26f..a4214d7819af 100644 --- a/.github/workflows/cicd_manual_build-docker-context.yml +++ b/.github/workflows/cicd_manual_build-docker-context.yml @@ -22,7 +22,7 @@ on: jobs: build_image: name: Build Docker Base Image - runs-on: ubuntu-20.04 + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} steps: - name: Checkout core uses: actions/checkout@v4 diff --git a/.github/workflows/cicd_manual_build-java-base.yml b/.github/workflows/cicd_manual_build-java-base.yml index b0cf25e45786..0fb2d749554a 100644 --- a/.github/workflows/cicd_manual_build-java-base.yml +++ b/.github/workflows/cicd_manual_build-java-base.yml @@ -19,7 +19,7 @@ on: jobs: build_image: name: Build Docker Base Image - runs-on: ubuntu-20.04 + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} steps: - name: Checkout core uses: actions/checkout@v4 diff --git a/.github/workflows/cicd_manual_publish-starter.yml b/.github/workflows/cicd_manual_publish-starter.yml index bde27271338e..4337783b6817 100644 --- a/.github/workflows/cicd_manual_publish-starter.yml +++ b/.github/workflows/cicd_manual_publish-starter.yml @@ -95,7 +95,7 @@ jobs: deploy-artifacts: needs: [ get-starter ] - runs-on: ubuntu-20.04 + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} environment: starter outputs: filename: ${{ steps.deploy-artifacts.outputs.filename }} @@ -197,7 +197,7 @@ jobs: send-notification: needs: [ deploy-artifacts ] - runs-on: ubuntu-20.04 + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} if: always() && github.event.inputs.dry-run == 'false' steps: diff --git a/.github/workflows/cicd_post-workflow-reporting.yml b/.github/workflows/cicd_post-workflow-reporting.yml index b82b23bd63a2..48f7bacb89dc 100644 --- a/.github/workflows/cicd_post-workflow-reporting.yml +++ b/.github/workflows/cicd_post-workflow-reporting.yml @@ -46,7 +46,7 @@ permissions: jobs: report: - runs-on: ubuntu-latest + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} steps: # Log GitHub context for debugging - name: Log GitHub context diff --git a/.github/workflows/cicd_release-cli.yml b/.github/workflows/cicd_release-cli.yml index 6a05633307e7..9b9b824de12c 100644 --- a/.github/workflows/cicd_release-cli.yml +++ b/.github/workflows/cicd_release-cli.yml @@ -59,7 +59,7 @@ jobs: precheck: if: ${{ ( github.event_name == 'release' && !contains(github.event.release.tag_name, 'LTS')) || github.event_name == 'workflow_dispatch' }} name: 'Pre-check' - runs-on: ubuntu-latest + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} outputs: RELEASE_VERSION: ${{ steps.version.outputs.RELEASE_VERSION }} HEAD: ${{ steps.version.outputs.HEAD }} @@ -151,7 +151,7 @@ jobs: # Perform the release release: needs: [ precheck, build-cli ] - runs-on: ubuntu-latest + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} steps: - name: 'Check out repository' uses: actions/checkout@v4 @@ -187,7 +187,7 @@ jobs: name: "Publish NPM Package" if: success() # Run only if explicitly indicated and successful needs: [ precheck, build, build-cli, release ] - runs-on: ubuntu-latest + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} steps: - name: 'Checkout code' uses: actions/checkout@v4 @@ -332,7 +332,7 @@ jobs: name: "Clean Up" if: ${{ needs.precheck.outputs.AUXILIARY_BRANCH != '' }} needs: [ precheck, build, build-cli, release, publish-npm-package ] - runs-on: ubuntu-latest + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} steps: - name: Checkout Repository uses: actions/checkout@v4 diff --git a/.github/workflows/cicd_scheduled_notify-seated-prs.yml b/.github/workflows/cicd_scheduled_notify-seated-prs.yml index 1fb43fad7136..d3cf89dd5a3d 100644 --- a/.github/workflows/cicd_scheduled_notify-seated-prs.yml +++ b/.github/workflows/cicd_scheduled_notify-seated-prs.yml @@ -16,7 +16,7 @@ env: jobs: resolve-seated-prs: - runs-on: ubuntu-22.04 + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} outputs: seated_prs: ${{ steps.fetch-seated-prs.outputs.seated_prs }} members: ${{ steps.fetch-seated-prs.outputs.members }} @@ -152,7 +152,7 @@ jobs: SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} notify-seated-prs: - runs-on: ubuntu-22.04 + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} needs: [resolve-seated-prs, slack-channel-resolver] if: success() name: Notifying team member ${{ matrix.member }} diff --git a/.github/workflows/issue_comp_frontend-notify.yml b/.github/workflows/issue_comp_frontend-notify.yml index a45f2aa5fb0c..0e87f355e686 100644 --- a/.github/workflows/issue_comp_frontend-notify.yml +++ b/.github/workflows/issue_comp_frontend-notify.yml @@ -14,7 +14,7 @@ on: required: true jobs: resolve-data: - runs-on: ubuntu-20.04 + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} outputs: issue_number: ${{ steps.evaluate-actions.outputs.issue_number }} steps: @@ -152,7 +152,7 @@ jobs: frontend-notify: name: Notify team member ${{ matrix.member }} needs: [resolve-data, slack-channel-resolver] - runs-on: ubuntu-20.04 + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} if: success() && needs.resolve-data.outputs.issue_number && needs.slack-channel-resolver.outputs.channel_ids strategy: fail-fast: false diff --git a/.github/workflows/issue_comp_github-member-resolver.yml b/.github/workflows/issue_comp_github-member-resolver.yml index 9821590adc0f..a2062fba44e6 100644 --- a/.github/workflows/issue_comp_github-member-resolver.yml +++ b/.github/workflows/issue_comp_github-member-resolver.yml @@ -23,7 +23,7 @@ on: jobs: github-member-resolver: - runs-on: ubuntu-20.04 + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} outputs: members: ${{ steps.resolve-members.outputs.members }} steps: diff --git a/.github/workflows/issue_comp_label-conditional-labeling.yml b/.github/workflows/issue_comp_label-conditional-labeling.yml index a3bb15dc6b9f..fa6dd80ef7d3 100644 --- a/.github/workflows/issue_comp_label-conditional-labeling.yml +++ b/.github/workflows/issue_comp_label-conditional-labeling.yml @@ -55,7 +55,7 @@ on: jobs: conditional-labeling: - runs-on: ubuntu-20.04 + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} env: REPO: core steps: diff --git a/.github/workflows/issue_comp_link-issue-to-pr.yml b/.github/workflows/issue_comp_link-issue-to-pr.yml index e9ba5c387ad7..538b491bcebf 100644 --- a/.github/workflows/issue_comp_link-issue-to-pr.yml +++ b/.github/workflows/issue_comp_link-issue-to-pr.yml @@ -32,7 +32,7 @@ env: jobs: add-issue-to-pr: - runs-on: ubuntu-latest + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} steps: - run: echo 'GitHub context' diff --git a/.github/workflows/issue_comp_link-pr-to-issue.yml b/.github/workflows/issue_comp_link-pr-to-issue.yml index b18666b8d25e..fad343248a84 100644 --- a/.github/workflows/issue_comp_link-pr-to-issue.yml +++ b/.github/workflows/issue_comp_link-pr-to-issue.yml @@ -20,7 +20,7 @@ env: jobs: link-pr-to-issue: - runs-on: ubuntu-20.04 + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} steps: - run: echo 'GitHub context' env: diff --git a/.github/workflows/issue_comp_release-labeling.yml b/.github/workflows/issue_comp_release-labeling.yml index 08c889a09e51..19c995c7f326 100644 --- a/.github/workflows/issue_comp_release-labeling.yml +++ b/.github/workflows/issue_comp_release-labeling.yml @@ -39,7 +39,7 @@ on: jobs: release-labeling: - runs-on: ubuntu-20.04 + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} env: REPO: core steps: diff --git a/.github/workflows/issue_manual_label-issues.yml b/.github/workflows/issue_manual_label-issues.yml index a05aba180d7f..03adb6f5581b 100644 --- a/.github/workflows/issue_manual_label-issues.yml +++ b/.github/workflows/issue_manual_label-issues.yml @@ -22,7 +22,7 @@ on: jobs: label-issues: name: Label issues - runs-on: ubuntu-latest + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} steps: - name: Checkout core uses: actions/checkout@v4 diff --git a/.github/workflows/issue_on-change_assign-issues-to-qa-project.yml b/.github/workflows/issue_on-change_assign-issues-to-qa-project.yml index 858ea6a82c0a..abbfa3a22003 100644 --- a/.github/workflows/issue_on-change_assign-issues-to-qa-project.yml +++ b/.github/workflows/issue_on-change_assign-issues-to-qa-project.yml @@ -4,7 +4,7 @@ on: types: [labeled] jobs: assign_one_project: - runs-on: ubuntu-latest + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} name: Assign to QA Project env: QA_PROJECT_ID: 6 diff --git a/.github/workflows/issue_scheduled_stale-action.yml b/.github/workflows/issue_scheduled_stale-action.yml index cf9e997ca51c..67392f80fa1d 100644 --- a/.github/workflows/issue_scheduled_stale-action.yml +++ b/.github/workflows/issue_scheduled_stale-action.yml @@ -6,7 +6,7 @@ on: jobs: stale: - runs-on: ubuntu-latest + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} permissions: issues: write pull-requests: write diff --git a/.github/workflows/legacy-release_comp_maven-build-docker-image.yml b/.github/workflows/legacy-release_comp_maven-build-docker-image.yml index d99cac0184be..d6c42ede5189 100644 --- a/.github/workflows/legacy-release_comp_maven-build-docker-image.yml +++ b/.github/workflows/legacy-release_comp_maven-build-docker-image.yml @@ -48,7 +48,7 @@ on: jobs: build-push-image: name: Build/Push Image - runs-on: ubuntu-latest + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} env: JAVA_VERSION: 11 JAVA_DISTRO: temurin diff --git a/.github/workflows/legacy-release_maven-release-process.yml b/.github/workflows/legacy-release_maven-release-process.yml index d3a1cece9366..32c38aa26e2f 100644 --- a/.github/workflows/legacy-release_maven-release-process.yml +++ b/.github/workflows/legacy-release_maven-release-process.yml @@ -39,7 +39,7 @@ env: jobs: prepare-release: name: Prepare Release - runs-on: ubuntu-20.04 + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} outputs: release_version: ${{ steps.set-common-vars.outputs.release_version }} release_tag: ${{ steps.set-common-vars.outputs.release_tag }} @@ -216,7 +216,7 @@ jobs: release-process: name: Release Process - runs-on: ubuntu-latest + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} needs: prepare-release env: AWS_REGION: us-east-1 @@ -336,7 +336,7 @@ jobs: generate-sbom: name: Generate SBOM - runs-on: ubuntu-latest + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} needs: [ prepare-release, build-push-image ] continue-on-error: true steps: @@ -386,7 +386,7 @@ jobs: finish-release: name: Finish Release - runs-on: ubuntu-latest + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} needs: [prepare-release, release-process, build-push-image] if: success() steps: diff --git a/.github/workflows/legacy-release_publish-docker-image-on-release.yml b/.github/workflows/legacy-release_publish-docker-image-on-release.yml index 2d75dc3209a7..5f2999f9a55e 100644 --- a/.github/workflows/legacy-release_publish-docker-image-on-release.yml +++ b/.github/workflows/legacy-release_publish-docker-image-on-release.yml @@ -9,7 +9,7 @@ on: jobs: prepare-build: name: Prepare build - runs-on: ubuntu-latest + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} outputs: build_id: ${{ steps.process-params.outputs.build_id }} steps: @@ -52,7 +52,7 @@ jobs: finish-build-push: name: Finish Build/Push needs: build-push-image - runs-on: ubuntu-latest + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} steps: - name: Slack Notification if: success() diff --git a/.github/workflows/legacy-release_publish-dotcms-docker-image.yml b/.github/workflows/legacy-release_publish-dotcms-docker-image.yml index a1da6f79d341..ddeea10d60f3 100644 --- a/.github/workflows/legacy-release_publish-dotcms-docker-image.yml +++ b/.github/workflows/legacy-release_publish-dotcms-docker-image.yml @@ -19,7 +19,7 @@ on: jobs: prepare-build: name: Prepare build - runs-on: ubuntu-latest + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} outputs: ref: ${{ steps.set-common-vars.outputs.ref }} docker_platforms: ${{ steps.set-common-vars.outputs.docker_platforms }} diff --git a/.github/workflows/legacy-release_release-candidate.yml b/.github/workflows/legacy-release_release-candidate.yml index 455ad17bb7aa..225c9d758187 100644 --- a/.github/workflows/legacy-release_release-candidate.yml +++ b/.github/workflows/legacy-release_release-candidate.yml @@ -29,7 +29,7 @@ on: jobs: release-candidate-process: name: Release process automation - runs-on: ubuntu-latest + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} outputs: ref: ${{ steps.set-common-vars.outputs.ref }} steps: @@ -108,7 +108,7 @@ jobs: notification: name: Release process automation - runs-on: ubuntu-latest + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} needs: [release-candidate-process, build_push_image] steps: - diff --git a/.github/workflows/legacy-release_release-trigger.yml b/.github/workflows/legacy-release_release-trigger.yml index c4b0c5ef14c1..3db78caeb76b 100644 --- a/.github/workflows/legacy-release_release-trigger.yml +++ b/.github/workflows/legacy-release_release-trigger.yml @@ -12,7 +12,7 @@ on: jobs: release-trigger: - runs-on: ubuntu-latest + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} steps: - name: Checkout Repository diff --git a/.github/workflows/legacy-release_sbom-generator.yaml b/.github/workflows/legacy-release_sbom-generator.yaml index 95c54b4627bc..3ecbc9bbe7db 100644 --- a/.github/workflows/legacy-release_sbom-generator.yaml +++ b/.github/workflows/legacy-release_sbom-generator.yaml @@ -11,7 +11,7 @@ on: jobs: scan: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 permissions: contents: write # Ensure write access to contents diff --git a/.github/workflows/publish_docs.yml b/.github/workflows/publish_docs.yml index 25d8511e62ad..1d1ec27052c0 100644 --- a/.github/workflows/publish_docs.yml +++ b/.github/workflows/publish_docs.yml @@ -7,7 +7,7 @@ on: - main jobs: publish: - runs-on: ubuntu-latest + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/utility_discover-docker-tags.yml b/.github/workflows/utility_discover-docker-tags.yml index 7f6dacab3ad9..1b392561e3cf 100644 --- a/.github/workflows/utility_discover-docker-tags.yml +++ b/.github/workflows/utility_discover-docker-tags.yml @@ -16,7 +16,7 @@ on: jobs: discover_tags: name: Discover DotCMS docker tags - runs-on: ubuntu-latest + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} steps: - name: GITHUB CONTEXT env: diff --git a/.github/workflows/utility_slack-channel-resolver.yml b/.github/workflows/utility_slack-channel-resolver.yml index 77d04abf9541..37074cead89a 100644 --- a/.github/workflows/utility_slack-channel-resolver.yml +++ b/.github/workflows/utility_slack-channel-resolver.yml @@ -44,7 +44,7 @@ on: jobs: slack-channel-resolver: - runs-on: ubuntu-20.04 + runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} outputs: channel_ids: ${{ steps.resolve-channels.outputs.channel_ids }} mappings_json: ${{ steps.resolve-channels.outputs.mappings_json }} diff --git a/tools/dotcms-cli/action/.github/workflows/main.yml b/tools/dotcms-cli/action/.github/workflows/main.yml index ddcdb4b7fd50..594ce5064c3d 100644 --- a/tools/dotcms-cli/action/.github/workflows/main.yml +++ b/tools/dotcms-cli/action/.github/workflows/main.yml @@ -5,7 +5,7 @@ on: [push] jobs: dotcli-runner: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 outputs: url: ${{ steps.dotcli-runner.outputs.url }} steps: @@ -30,7 +30,7 @@ jobs: sync-with-dotcms: needs: dotcli-runner - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 env: # Global environment expected by dotCMS CLI # This is how we instruct the cli the target server From cadf6536f96caca7907f8e9f7820475f647f7e19 Mon Sep 17 00:00:00 2001 From: Nicolas Molina Monroy Date: Wed, 11 Dec 2024 14:53:39 -0400 Subject: [PATCH 3/6] chore(edit-content): enhance dialog and table functionality (#30901) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### Parent Issue https://github.com/dotCMS/core/issues/30523 ### Proposed Changes This pull request includes changes to the `dot-select-existing-content.component.html` and `dot-select-existing-content.component.ts` files to improve the user interface and functionality of the content selection dialog. The most important changes include adding a header template to the dialog, making the dialog non-draggable, and introducing a method to check if an item is selected. Improvements to user interface: * [`dot-select-existing-content.component.html`](diffhunk://#diff-ba794904cc95635d9efca07b7e2bfeb948b5b0bb0c8e1e97c777c615398ba011R4-R22): Added a header template to the dialog with a search icon and title. * [`dot-select-existing-content.component.html`](diffhunk://#diff-ba794904cc95635d9efca07b7e2bfeb948b5b0bb0c8e1e97c777c615398ba011R4-R22): Made the dialog non-draggable and updated the style to include a height property. Functionality enhancements: * [`dot-select-existing-content.component.html`](diffhunk://#diff-ba794904cc95635d9efca07b7e2bfeb948b5b0bb0c8e1e97c777c615398ba011L79-R89): Added a conditional class to highlight selected rows in the table. * [`dot-select-existing-content.component.ts`](diffhunk://#diff-14d3d666b0a074fe26436013ebf4abe96e518e28e9799b85b393d14b82ac528bR115-R123): Introduced the `checkIfSelected` method to determine if an item is selected. ### Checklist - [x] Tests - [x] Translations - [x] Security Implications Contemplated (add notes if applicable) ### Screenshots - The title should be "Search" and not "Select existing content". Screenshot 2024-12-09 at 8 45 05 PM - If the user make a search, close the dialog and open it again the search input and the entries button are not clean, keeps the state. https://github.com/user-attachments/assets/b92a8307-c43c-4f4c-b14f-fb3210c91b6a - Following patterns, Dialog should keep the same height. when the user perform a search with a couple of rows the height change https://github.com/user-attachments/assets/286c9e15-29d3-4de4-ac7a-b9972928a973 - Form figma: The selected items will have an active state background. - Dialog should not be draggable. https://github.com/user-attachments/assets/767a049a-a713-4365-87b1-44c2c8f648ba --- .../dotcms-binary-field-builder/project.json | 2 +- ...dot-select-existing-content.component.html | 238 ++++++++++-------- ...dot-select-existing-content.component.scss | 9 +- ...-select-existing-content.component.spec.ts | 61 +++++ .../dot-select-existing-content.component.ts | 17 ++ .../store/existing-content.store.ts | 6 + ...-content-relationship-field.component.html | 2 +- ...-content-relationship-field.component.scss | 2 +- .../WEB-INF/messages/Language.properties | 1 + 9 files changed, 221 insertions(+), 117 deletions(-) diff --git a/core-web/apps/dotcms-binary-field-builder/project.json b/core-web/apps/dotcms-binary-field-builder/project.json index 0ce4f73112ef..8de29bdf6508 100644 --- a/core-web/apps/dotcms-binary-field-builder/project.json +++ b/core-web/apps/dotcms-binary-field-builder/project.json @@ -46,7 +46,7 @@ { "type": "initial", "maximumWarning": "500kb", - "maximumError": "2mb" + "maximumError": "2.5mb" }, { "type": "anyComponentStyle", diff --git a/core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/components/dot-select-existing-content/dot-select-existing-content.component.html b/core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/components/dot-select-existing-content/dot-select-existing-content.component.html index 474a86d1fc92..cf611578ffd5 100644 --- a/core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/components/dot-select-existing-content/dot-select-existing-content.component.html +++ b/core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/components/dot-select-existing-content/dot-select-existing-content.component.html @@ -1,121 +1,137 @@ @let data = store.data(); @let pagination = store.pagination(); - - - -
-
-
- +@if ($visible()) { + @defer { + + +
+ + + {{ 'dot.file.relationship.dialog.search' | dm }} + +
+
+ + +
+
+
+ +
+
+

+ {{ + 'dot.file.relationship.dialog.per.page' + | dm: [pagination.rowsPerPage.toString()] + }} +

+
+
+
-
+ + + + + + Title + + + + Step + + + + Description + + + + Last Update + + + Menu + + + + + +
+

+ {{ 'dot.file.relationship.dialog.search.empty.content' | dm }} +

+
+ + +
+ + + + + + +

{{ item.title }}

+ + {{ item.step }} + +

{{ item.description }}

+ + {{ item.lastUpdate | date }} + + + + +
+ + +
+

{{ - 'dot.file.relationship.dialog.per.page' - | dm: [pagination.rowsPerPage.toString()] + 'dot.file.relationship.dialog.selected.items' + | dm: [$selectedItems().length.toString()] }}

-
- -
-
- - - - - Title - - - - Step - - - - Description - - - - Last Update - - - Menu - - - - - -
-

Relate content by clicking on the Plus Button

+
+ +
- - - - - - - - - -

{{ item.title }}

- - {{ item.step }} - -

{{ item.description }}

- - {{ item.lastUpdate | date }} - - - - -
- - -
-
-

- {{ - 'dot.file.relationship.dialog.selected.items' - | dm: [$selectedItems().length.toString()] - }} -

-
-
- - -
-
-
- +
+
+
+ } +} diff --git a/core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/components/dot-select-existing-content/dot-select-existing-content.component.scss b/core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/components/dot-select-existing-content/dot-select-existing-content.component.scss index c34af3986231..ca07422c372f 100644 --- a/core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/components/dot-select-existing-content/dot-select-existing-content.component.scss +++ b/core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/components/dot-select-existing-content/dot-select-existing-content.component.scss @@ -2,12 +2,10 @@ ::ng-deep { p-table { - .p-datatable-sm.p-datatable-existing-content { + .p-datatable-existing-content { .p-datatable-header { background-color: $white; border: 0px; - padding-left: 0px; - padding-right: 0px; } .p-datatable-table { border: 1px solid $color-palette-gray-300; @@ -24,5 +22,10 @@ height: auto; } } + .dotTable.p-datatable { + .p-datatable-tbody > tr > td:first-child:has(p-tableCheckbox) + td { + padding: 0 $spacing-1; + } + } } } diff --git a/core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/components/dot-select-existing-content/dot-select-existing-content.component.spec.ts b/core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/components/dot-select-existing-content/dot-select-existing-content.component.spec.ts index ec2a9dc5ed84..d4988f8efa21 100644 --- a/core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/components/dot-select-existing-content/dot-select-existing-content.component.spec.ts +++ b/core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/components/dot-select-existing-content/dot-select-existing-content.component.spec.ts @@ -1,5 +1,9 @@ import { Spectator, createComponentFactory } from '@ngneat/spectator/jest'; +import { fakeAsync, tick } from '@angular/core/testing'; + +import { Dialog } from 'primeng/dialog'; + import { DotMessageService } from '@dotcms/data-access'; import { RelationshipFieldItem } from '@dotcms/edit-content/fields/dot-edit-content-relationship-field/models/relationship.models'; import { MockDotMessageService } from '@dotcms/utils-testing'; @@ -85,4 +89,61 @@ describe('DotSelectExistingContentComponent', () => { expect(label).toBe('Apply 2 entries'); }); }); + + describe('checkIfSelected', () => { + it('should return true when content is in selectedContent array', () => { + // Arrange + const testContent = mockRelationshipItem('1'); + spectator.component.$selectedItems.set([testContent]); + + // Act + const result = spectator.component.checkIfSelected(testContent); + + // Assert + expect(result).toBe(true); + }); + + it('should return false when content is not in selectedContent array', () => { + // Arrange + const testContent = mockRelationshipItem('123'); + const differentContent = mockRelationshipItem('456'); + spectator.component.$selectedItems.set([differentContent]); + + // Act + const result = spectator.component.checkIfSelected(testContent); + + // Assert + expect(result).toBe(false); + }); + + it('should return false when selectedContent is empty', () => { + // Arrange + const testContent = mockRelationshipItem('123'); + spectator.component.$selectedItems.set([]); + + // Act + const result = spectator.component.checkIfSelected(testContent); + + // Assert + expect(result).toBe(false); + }); + }); + + describe('onShowDialog', () => { + it('should call onShowDialog when dialog is shown', fakeAsync(() => { + // Arrange + spectator.component.$visible.set(true); + + spectator.detectChanges(); + + tick(100); + const spy = jest.spyOn(spectator.component, 'onShowDialog'); + + // Act + spectator.triggerEventHandler(Dialog, 'onShow', null); + + // Assert + expect(spy).toHaveBeenCalled(); + })); + }); }); diff --git a/core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/components/dot-select-existing-content/dot-select-existing-content.component.ts b/core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/components/dot-select-existing-content/dot-select-existing-content.component.ts index 0e066ed75105..8917e5db9af7 100644 --- a/core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/components/dot-select-existing-content/dot-select-existing-content.component.ts +++ b/core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/components/dot-select-existing-content/dot-select-existing-content.component.ts @@ -112,4 +112,21 @@ export class DotSelectExistingContentComponent { emitSelectedItems() { this.onSelectItems.emit(this.$selectedItems()); } + + /** + * Checks if an item is selected. + * @param item - The item to check. + * @returns True if the item is selected, false otherwise. + */ + checkIfSelected(item: RelationshipFieldItem) { + return this.$selectedItems().some((selectedItem) => selectedItem.id === item.id); + } + + /** + * Shows the existing content dialog and loads the content. + */ + onShowDialog() { + this.store.applyInitialState(); + this.store.loadContent(); + } } diff --git a/core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/components/dot-select-existing-content/store/existing-content.store.ts b/core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/components/dot-select-existing-content/store/existing-content.store.ts index c65414f675bc..1c352ef61257 100644 --- a/core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/components/dot-select-existing-content/store/existing-content.store.ts +++ b/core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/components/dot-select-existing-content/store/existing-content.store.ts @@ -70,6 +70,12 @@ export const ExistingContentStore = signalStore( ) ) ), + /** + * Applies the initial state for the existing content. + */ + applyInitialState: () => { + patchState(store, initialState); + }, /** * Advances the pagination to the next page and updates the state accordingly. */ diff --git a/core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/dot-edit-content-relationship-field.component.html b/core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/dot-edit-content-relationship-field.component.html index ccc2e97d92f6..ad9bc0c48fdc 100644 --- a/core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/dot-edit-content-relationship-field.component.html +++ b/core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/dot-edit-content-relationship-field.component.html @@ -4,7 +4,7 @@ Date: Thu, 12 Dec 2024 10:11:16 +0000 Subject: [PATCH 4/6] test(tests): Remove -Pcoverage flag in test runs until we refactor coverage (#30917) (#30918) ### Proposed Changes * Removing the -Pcoverage flag that should remove errors in logs on jsps where it is being used. We are not collecting or using the data so it should have no other inpact on the scripts * flag was used in JVM Tests, IT Tests, Postman tests and E2E tests. These tests should pass as before and no exceptions logging a stack trace with org.jacoco.agent.rt or java.lang.instrument.IllegalClassFormatException should be seen in the logs --- .github/workflows/cicd_comp_test-phase.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cicd_comp_test-phase.yml b/.github/workflows/cicd_comp_test-phase.yml index 61c26bf57ede..87b312c161b7 100644 --- a/.github/workflows/cicd_comp_test-phase.yml +++ b/.github/workflows/cicd_comp_test-phase.yml @@ -73,7 +73,7 @@ jobs: - uses: ./.github/actions/core-cicd/maven-job with: stage-name: "JVM Tests" - maven-args: "-Pcoverage -Dprod test -pl :dotcms-core" + maven-args: " -Dprod test -pl :dotcms-core" cleanup-runner: true generates-test-results: true github-token: ${{ secrets.GITHUB_TOKEN }} @@ -151,7 +151,7 @@ jobs: - uses: ./.github/actions/core-cicd/maven-job with: stage-name: "IT Tests ${{ matrix.suites.name }}" - maven-args: "-Dit.test.forkcount=1 -Pcoverage verify -pl :dotcms-integration -Dcoreit.test.skip=false ${{ matrix.suites.maven_args}}" + maven-args: "-Dit.test.forkcount=1 verify -pl :dotcms-integration -Dcoreit.test.skip=false ${{ matrix.suites.maven_args}}" generates-test-results: true cleanup-runner: true dotcms-license: ${{ secrets.DOTCMS_LICENSE }} @@ -176,7 +176,7 @@ jobs: - uses: ./.github/actions/core-cicd/maven-job with: stage-name: "Postman ${{ matrix.collection_group }}" - maven-args: "-Pcoverage verify -pl :dotcms-postman -Dpostman.test.skip=false -Dpostman.collections=${{ matrix.collection_group }}" + maven-args: " verify -pl :dotcms-postman -Dpostman.test.skip=false -Dpostman.collections=${{ matrix.collection_group }}" generates-test-results: true dotcms-license: ${{ secrets.DOTCMS_LICENSE }} requires-node: true @@ -216,7 +216,7 @@ jobs: with: name: karate-reports path: dotCMS/target/karate-reports - # E2E Tests + # E2E Testsgit linux-e2e-tests: name: E2E Tests ${{matrix.suites.name}} runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }} @@ -238,7 +238,7 @@ jobs: - uses: ./.github/actions/core-cicd/maven-job with: stage-name: "E2E ${{ matrix.suites.name }}" - maven-args: "verify -Pcoverage -De2e.test.skip=false ${{ matrix.suites.maven_args}}" + maven-args: "verify -De2e.test.skip=false ${{ matrix.suites.maven_args}}" generates-test-results: true dotcms-license: ${{ secrets.DOTCMS_LICENSE }} requires-node: true From cce9540c0ac0963f0503852466ba06ffd183563e Mon Sep 17 00:00:00 2001 From: Valentino Giardino <77643678+valentinogiardino@users.noreply.github.com> Date: Thu, 12 Dec 2024 15:06:49 -0300 Subject: [PATCH 5/6] fix(uve) variant retrieval in contentSelector #30727 (#30933) ### Proposed Changes - Added a new `variantName` property to `ContentSelector.js` to handle variant-specific content searches. - Updated `ng-contentlet-selector.jsp` to pass the `variantName` parameter to `ContentSelector`. ### Checklist - [x] Tests - [x] Translations - [x] Security Implications Contemplated (add notes if applicable) ### Additional Info **Problem Statement:** When users create content for a specific variant in dotCMS, it does not appear in the list when attempting to add a new piece of content to the same variant. This issue was introduced in [PR #30556](https://github.com/dotCMS/core/pull/30556), where `window.sessionStorage` was no longer used to store the `variantName`. The `ContentSelector.js` was still relying on this outdated sessionStorage item, causing it to always default to `'DEFAULT'` for the `variantName`. ### Video https://github.com/user-attachments/assets/f527e92c-78f5-455b-9a3f-a02b7b4fe053 --- .../webapp/html/js/dotcms/dijit/form/ContentSelector.js | 6 ++++-- dotCMS/src/main/webapp/html/ng-contentlet-selector.jsp | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dotCMS/src/main/webapp/html/js/dotcms/dijit/form/ContentSelector.js b/dotCMS/src/main/webapp/html/js/dotcms/dijit/form/ContentSelector.js index 1f285049743c..7eb034351a73 100644 --- a/dotCMS/src/main/webapp/html/js/dotcms/dijit/form/ContentSelector.js +++ b/dotCMS/src/main/webapp/html/js/dotcms/dijit/form/ContentSelector.js @@ -39,6 +39,8 @@ * * title: non-required - Title of the dialog. * + * variantName: non-required - this is used to search content of particular variant. + * * onFileSelected: non-required - JS script or JS function callback to be executed when the user selects a content from the results, * * the content object is passed to the function. @@ -104,6 +106,7 @@ dojo.declare( selectButtonLabel: 'Select', useRelateContentOnSelect: false, selectedInodesSet: new Set(), + variantName: 'DEFAULT', setSelectedInode: function (selectBtn) { if (selectBtn.checked) { @@ -1097,7 +1100,6 @@ dojo.declare( }); } - const variantName = window.sessionStorage.getItem('variantName') || 'DEFAULT'; ContentletAjax.searchContentlets( searchFor, fieldsValues, @@ -1111,7 +1113,7 @@ dojo.declare( this.currentSortBy, null, null, - variantName, + this.variantName, dojo.hitch(this, this._fillResults) ); diff --git a/dotCMS/src/main/webapp/html/ng-contentlet-selector.jsp b/dotCMS/src/main/webapp/html/ng-contentlet-selector.jsp index b9ed4d9a7f67..9a4c239ac9a0 100644 --- a/dotCMS/src/main/webapp/html/ng-contentlet-selector.jsp +++ b/dotCMS/src/main/webapp/html/ng-contentlet-selector.jsp @@ -258,6 +258,7 @@ languageId="<%=language_id%>" onContentSelected="contentSelected" selectButtonLabel='<%= LanguageUtil.get(pageContext, "content.search.select") %>' + variantName='<%=variantName%>' dojoType="dotcms.dijit.form.ContentSelector">
From b8de85e311d5642133e6edccc01d0c4126a6489d Mon Sep 17 00:00:00 2001 From: freddyDOTCMS <147462678+freddyDOTCMS@users.noreply.github.com> Date: Thu, 12 Dec 2024 15:24:23 -0600 Subject: [PATCH 6/6] Filtering by customer_id any time that execute a query in CubeJs (#30931) ### Proposed Changes * Setting the Cube.js in the Docker Container https://github.com/dotCMS/core/pull/30931/files#diff-106fd8c9a322da82fa432a4a4e9447566d08b515d01153f78854b0ffe892d2faR134 * Setting the JWK URL right https://github.com/dotCMS/core/pull/30931/files#diff-106fd8c9a322da82fa432a4a4e9447566d08b515d01153f78854b0ffe892d2faR125 * Setting the CUBEJS_JWT_ISSUER right the value in the token for the 'iss' attribute is 'http://localhost:61111/realms/dotcms' https://github.com/dotCMS/core/pull/30931/files#diff-106fd8c9a322da82fa432a4a4e9447566d08b515d01153f78854b0ffe892d2faR127 * Include filter by cluster and customer but just if the Query is using the request scope it means if it not a Experiment Query https://github.com/dotCMS/core/pull/30931/files#diff-3b5963eeaa042b27689c692068c4ae553d2ccedabb046e78543c28784c18e777R24-R36 * Include cluster_id and customer_id in the CubeJS Schema https://github.com/dotCMS/core/pull/30931/files#diff-c291c8a51311832c67ceb2e3fb2a2d4fe1d9c4e02abda400c156e10bed18200eR182-R183 --- .../analytics/docker-compose.yml | 6 ++++-- .../analytics/setup/config/dev/cube/cube.js | 16 ++++++++++++++-- .../setup/config/dev/cube/schema/Events.js | 4 ++++ 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/docker/docker-compose-examples/analytics/docker-compose.yml b/docker/docker-compose-examples/analytics/docker-compose.yml index 21449399e1ec..f99e2210a4ad 100644 --- a/docker/docker-compose-examples/analytics/docker-compose.yml +++ b/docker/docker-compose-examples/analytics/docker-compose.yml @@ -122,14 +122,16 @@ services: - CUBEJS_DB_NAME=${CH_DB:-clickhouse_test_db} - CUBEJS_DB_USER=${CH_USER:-clickhouse_test_user} - CUBEJS_DB_PASS=${CH_PWD:-clickhouse_password} - - CUBEJS_JWK_URL=${JWKS_URL:-http://keycloak:61111/realms/dotcms/protocol/openid-connect/certs} + - CUBEJS_JWK_URL=${JWKS_URL:-http://host.docker.internal:61111/realms/dotcms/protocol/openid-connect/certs} - CUBEJS_JWT_AUDIENCE=api-dotcms-analytics-audience - - CUBEJS_JWT_ISSUER=${AUTH_SERVER_URL:-http://keycloak:61111/realms/dotcms} + - CUBEJS_JWT_ISSUER=${AUTH_SERVER_URL:-http://localhost:61111/realms/dotcms} - CUBEJS_JWT_ALGS=RS256 - CUBEJS_JWT_CLAIMS_NAMESPACE=https://dotcms.com/analytics + - CUBEJS_LOG_LEVEL=debug volumes: - cube_metastore:/cube/conf/.cubestore - ./setup/config/dev/cube/schema:/cube/conf/schema + - ./setup/config/dev/cube/cube.js:/cube/conf/cube.js ch_server: container_name: ch_server diff --git a/docker/docker-compose-examples/analytics/setup/config/dev/cube/cube.js b/docker/docker-compose-examples/analytics/setup/config/dev/cube/cube.js index 3bd1b3ca920c..ab2d68f32518 100644 --- a/docker/docker-compose-examples/analytics/setup/config/dev/cube/cube.js +++ b/docker/docker-compose-examples/analytics/setup/config/dev/cube/cube.js @@ -1,3 +1,5 @@ + + // cube.js configuration file module.exports = { /* @@ -7,8 +9,8 @@ module.exports = { `pre_aggregations_${securityContext.customerId}`, */ - queryRewrite: (query, { securityContext }) => { + queryRewrite: (query, { securityContext }) => { if (!securityContext) { throw new Error('No valid token'); @@ -16,12 +18,22 @@ module.exports = { const tokenData = securityContext["https://dotcms.com/analytics"]; + const isRequestQuery = (query.measures + query.dimensions).includes("request."); + + if (isRequestQuery) { query.filters.push({ - member: 'Events.clusterId', + member: 'request.clusterId', operator: 'equals', values: [tokenData.clusterId], }); + query.filters.push({ + member: 'request.customerId', + operator: 'equals', + values: [tokenData.customerId], + }); + } + return query; }, diff --git a/docker/docker-compose-examples/analytics/setup/config/dev/cube/schema/Events.js b/docker/docker-compose-examples/analytics/setup/config/dev/cube/schema/Events.js index 280d7bc22e59..5950342bc17d 100644 --- a/docker/docker-compose-examples/analytics/setup/config/dev/cube/schema/Events.js +++ b/docker/docker-compose-examples/analytics/setup/config/dev/cube/schema/Events.js @@ -179,6 +179,8 @@ cube('request', { MAX(CASE WHEN event_type = 'URL_MAP' THEN object_content_type_var_name ELSE NULL END) as url_map_content_type_var_name, MAX(object_detail_page_url) as url_map_detail_page_url, MAX(url) AS url, + MAX(cluster_id) AS cluster_id, + MAX(customer_id) AS customer_id, CASE WHEN MAX(CASE WHEN event_type = 'FILE_REQUEST' THEN 1 ELSE 0 END) = 1 THEN 'FILE' WHEN MAX(CASE WHEN event_type = 'PAGE_REQUEST' THEN 1 ELSE 0 END) = 1 THEN 'PAGE' @@ -189,6 +191,8 @@ cube('request', { GROUP BY request_id`, dimensions: { requestId: { sql: 'request_id', type: `string` }, + clusterId: { sql: 'cluster_id', type: `string` }, + customerId: { sql: 'customer_id', type: `string` }, sessionId: { sql: 'sessionid', type: `string` }, isSessionNew: { sql: 'isSessionNew', type: `boolean` }, createdAt: { sql: 'createdAt', type: `time`, },