From 063c5e93b11499f1ea195f64c813797572a27590 Mon Sep 17 00:00:00 2001 From: Steve Freudenthaler <31257998+sfreudenthaler@users.noreply.github.com> Date: Mon, 3 Feb 2025 11:36:29 -0500 Subject: [PATCH 01/12] Create CODEOWNERS (#187) codeowners with workflow devs ### Proposed Changes * change 1 * change 2 ### Checklist - [ ] Tests - [ ] Translations - [ ] Security Implications Contemplated (add notes if applicable) ### Additional Info ** any additional useful context or info ** ### Screenshots Original | Updated :-------------------------:|:-------------------------: ** original screenshot ** | ** updated screenshot ** --- CODEOWNERS | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 CODEOWNERS diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 000000000000..f8d4b4e8e87a --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1,2 @@ +# require review from someone with some addtional experience +* @dotCMS/core-workflow-developers From 0e288b1514591e4c12bd60a9c1bb0cbe4b751f10 Mon Sep 17 00:00:00 2001 From: Jalinson Diaz Date: Mon, 3 Feb 2025 15:16:02 -0300 Subject: [PATCH 02/12] test(action): SDK Publish Workflow (#188) This pull request includes several changes to the deployment process for the JavaScript SDK in the `.github/actions/core-cicd/deployment/deploy-javascript-sdk/action.yml` file. The primary focus is on updating the versioning and tagging system from "alpha" to "beta". Changes to versioning and tagging: * Updated the example projects to point to the 'next' tag instead of 'latest' to prevent version inconsistency. * Changed the default `npm-package-tag` from 'alpha' to 'beta'. * Modified the script to fetch the current version using the 'beta' tag instead of 'alpha', and set the initial version to "0.0.1-beta.0" if no current version is found. * Adjusted the version calculation logic to increment the beta version number instead of the alpha number. * Changed the npm dist-tag addition command to use the 'next' tag instead of 'latest'. --- .../deploy-javascript-sdk/action.yml | 91 ++++++++++--------- 1 file changed, 49 insertions(+), 42 deletions(-) diff --git a/.github/actions/core-cicd/deployment/deploy-javascript-sdk/action.yml b/.github/actions/core-cicd/deployment/deploy-javascript-sdk/action.yml index 8ba4c2798535..9fe75724b391 100644 --- a/.github/actions/core-cicd/deployment/deploy-javascript-sdk/action.yml +++ b/.github/actions/core-cicd/deployment/deploy-javascript-sdk/action.yml @@ -1,14 +1,14 @@ -# Note: The versions of the SDK libraries will be incremented in the NPM registry, -# but they will not be updated in the codebase itself through this process. -# This simplification avoids automatic pull requests and all the considerations -# necessary due to protections on the main branch, as well as the lengthy execution +# Note: The versions of the SDK libraries will be incremented in the NPM registry, +# but they will not be updated in the codebase itself through this process. +# This simplification avoids automatic pull requests and all the considerations +# necessary due to protections on the main branch, as well as the lengthy execution # process that would be required to ultimately publish the libraries. -# -# This is a temporary solution until we determine the most appropriate pattern -# to handle the lifecycle of each module that needs to be released individually +# +# This is a temporary solution until we determine the most appropriate pattern +# to handle the lifecycle of each module that needs to be released individually # (e.g., dotCLI and the SDKs). # -# Additionally, the example projects should point to the 'latest' tag to ensure +# Additionally, the example projects should point to the 'next' tag to ensure # that version updates do not impact their functionality due to version inconsistency. name: 'SDK Publish NPM Packages' description: 'Publish the dotCMS SDK libs on NPM registry.' @@ -23,10 +23,10 @@ inputs: npm-package-tag: description: 'Package tag' required: false - default: 'alpha' + default: 'beta' github-token: description: 'GitHub Token' - required: true + required: true outputs: npm-package-version: description: 'SDK libs - NPM package version' @@ -62,16 +62,22 @@ runs: ls -R $BASE_PATH echo "PATH=$PATH:${BASE_PATH}/node/:${BASE_PATH}/node/yarn/dist/bin" >> $GITHUB_ENV echo "::endgroup::" - shell: bash + shell: bash - name: 'Get current version from NPM' id: current_version run: | - echo "::group::Get current version" - CURRENT_VERSION=$(npm view @dotcms/client dist-tags --json | jq -r '.alpha') - echo "Current version: $CURRENT_VERSION" - echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT - echo "::endgroup::" + echo "::group::Get current version" + # This should be empty on the first run. Setting the NEXT_VERSION to 0.0.1-beta.1 + CURRENT_VERSION=$(npm view @dotcms/client dist-tags --json | jq -r '.beta') + + if [ -z "$CURRENT_VERSION" ]; then + CURRENT_VERSION="0.0.1-beta.0" + fi + + echo "Current version: $CURRENT_VERSION" + echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT + echo "::endgroup::" shell: bash - name: 'Calculate next version' @@ -79,16 +85,17 @@ runs: env: CURRENT_VERSION: ${{ steps.current_version.outputs.current_version }} run: | - echo "::group::Calculate next version" - VERSION_PARTS=(${CURRENT_VERSION//./ }) - BASE_VERSION="${VERSION_PARTS[0]}.${VERSION_PARTS[1]}.${VERSION_PARTS[2]}" - ALPHA_PART=${VERSION_PARTS[3]#*-} - ALPHA_NUMBER=${ALPHA_PART#*.} - NEW_ALPHA_NUMBER=$((ALPHA_NUMBER + 1)) - NEXT_VERSION="${BASE_VERSION}.${NEW_ALPHA_NUMBER}" - echo "Next version: $NEXT_VERSION" - echo "next_version=$NEXT_VERSION" >> $GITHUB_OUTPUT - echo "::endgroup::" + echo "::group::Calculate next version" + VERSION_PARTS=(${CURRENT_VERSION//./ }) + BASE_VERSION="${VERSION_PARTS[0]}.${VERSION_PARTS[1]}.${VERSION_PARTS[2]}" + BETA_PART=${VERSION_PARTS[3]#*-} + BETA_NUMBER=${BETA_PART#*.} + NEW_BETA_NUMBER=$((BETA_NUMBER + 1)) + NEXT_VERSION="${BASE_VERSION}.${NEW_BETA_NUMBER}" + echo "Next version: $NEXT_VERSION" + echo "next_version=$NEXT_VERSION" >> $GITHUB_OUTPUT + echo "::endgroup::" + shell: bash - name: 'Printing versions' @@ -110,13 +117,13 @@ runs: EXAMPLES_PATH: ${{ github.workspace }}/examples run: | echo "Updating version to $NEXT_VERSION" - + # Function to update the version in package.json using jq update_version() { local pkg_dir="$1" local new_version="$2" local package_json_path="$pkg_dir/package.json" - + if [ -f "$package_json_path" ]; then jq --arg new_version "$new_version" '.version = $new_version' "$package_json_path" > tmp.$$.json && mv tmp.$$.json "$package_json_path" echo "Updated version in $package_json_path to $new_version" @@ -124,13 +131,13 @@ runs: echo "::warn::Warning: No package.json found in $pkg_dir" fi } - + # Function to update peerDependencies in package.json update_peer_dependencies() { local pkg_dir="$1" local new_version="$2" local package_json_path="$pkg_dir/package.json" - + if [ -f "$package_json_path" ]; then for dep in "${sdk_packages[@]}"; do if jq -e ".peerDependencies[\"@dotcms/$dep\"]" "$package_json_path" >/dev/null; then @@ -144,13 +151,13 @@ runs: echo "::warn::Warning: No package.json found in $pkg_dir" fi } - + # Function to update dependencies in examples package.json update_dependencies_in_examples() { local example_dir="$1" local new_version="$2" local package_json_path="$example_dir/package.json" - + if [ -f "$package_json_path" ]; then for dep in "${sdk_packages[@]}"; do if jq -e ".dependencies[\"@dotcms/$dep\"]" "$package_json_path" >/dev/null; then @@ -166,20 +173,20 @@ runs: echo "::warn::Warning: No package.json found in $example_dir" fi } - + # Detect all SDK packages dynamically in the libs/sdk directory sdk_packages=($(find . -maxdepth 1 -type d -exec basename {} \; | grep -v "^\.$")) - + # Step 1: Update the version in each SDK package for sdk in "${sdk_packages[@]}"; do update_version "$sdk" "$NEXT_VERSION" done - + # Step 2: Update peerDependencies in each SDK package for sdk in "${sdk_packages[@]}"; do update_peer_dependencies "$sdk" "$NEXT_VERSION" done - + # Step 3: Update dependencies in example projects example_packages=$(find $EXAMPLES_PATH -name "package.json" -not -path "*/node_modules/*") @@ -201,19 +208,19 @@ runs: echo "::group::Printing SDK and Example packages" echo "SDK libs:" print_packages "$SDK_LIBS_PATH" - echo "" + echo "" echo "Examples:" print_packages "$EXAMPLES_PATH" echo "::endgroup::" - shell: bash + shell: bash - name: 'Install project' working-directory: ${{ github.workspace }}/core-web/ - run: | + run: | yarn install npm --version node --version - npx --version + npx --version shell: bash - name: 'Build SDK packages' @@ -229,14 +236,14 @@ runs: NPM_AUTH_TOKEN: ${{ inputs.npm-token }} NPM_TAG: ${{ inputs.npm-package-tag }} run: | - echo "::group::Publishing SDK packages" + echo "::group::Publishing SDK packages" sdks=$(ls) for sdk in $sdks; do echo "Publishing SDK lib [${sdk}]" cd $sdk && echo "$(pwd)" echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}" > ~/.npmrc npm publish --access public --tag $NPM_TAG - npm dist-tag add @dotcms/${sdk}@${NEXT_VERSION} latest + npm dist-tag add @dotcms/${sdk}@${NEXT_VERSION} next cd .. done echo "::endgroup::" From bed24f3bdaadb4ef544ec1de6b577fd692bf98ad Mon Sep 17 00:00:00 2001 From: Jalinson Diaz Date: Mon, 3 Feb 2025 19:39:55 -0300 Subject: [PATCH 03/12] test(actions): SDK Publish (#189) Just a file to trigger the workflow --- .../libs/sdk/client/src/lib/utils/page/common-utils.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core-web/libs/sdk/client/src/lib/utils/page/common-utils.ts b/core-web/libs/sdk/client/src/lib/utils/page/common-utils.ts index 390347199731..1efff77c97b5 100644 --- a/core-web/libs/sdk/client/src/lib/utils/page/common-utils.ts +++ b/core-web/libs/sdk/client/src/lib/utils/page/common-utils.ts @@ -47,9 +47,10 @@ export const getPageRequestParams = ({ finalParams['language_id'] = copiedParams['language_id']; } - if (copiedParams['variantName']) { - finalParams['variantName'] = copiedParams['variantName']; - } + // nonsense change just to trigger a build + finalParams['variantName'] = (copiedParams['variantName'] as string)?.length + ? copiedParams['variantName'] + : undefined; if (copiedParams['personaId'] || dotMarketingPersonaId) { finalParams['personaId'] = copiedParams['personaId'] || dotMarketingPersonaId; From 99c0719d04cc605198a1f7f9e2bf45c09fff39a7 Mon Sep 17 00:00:00 2001 From: Jalinson Diaz Date: Tue, 4 Feb 2025 10:59:59 -0300 Subject: [PATCH 04/12] Small fix on SDK Publish versions (#190) This pull request includes a small but important change to the deployment script for the JavaScript SDK. The modification ensures that the `CURRENT_VERSION` is correctly set even if the retrieved version is `null`. * [`.github/actions/core-cicd/deployment/deploy-javascript-sdk/action.yml`](diffhunk://#diff-b47e2bc3507c79547b7f53206919f60585f49479fa09c01ee9ab15eb6bb4c068L74-R74): Updated the condition to check if `CURRENT_VERSION` is `null` and set it to `0.0.1-beta.0` if true. --- .../core-cicd/deployment/deploy-javascript-sdk/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/core-cicd/deployment/deploy-javascript-sdk/action.yml b/.github/actions/core-cicd/deployment/deploy-javascript-sdk/action.yml index 9fe75724b391..5f8392120138 100644 --- a/.github/actions/core-cicd/deployment/deploy-javascript-sdk/action.yml +++ b/.github/actions/core-cicd/deployment/deploy-javascript-sdk/action.yml @@ -71,7 +71,7 @@ runs: # This should be empty on the first run. Setting the NEXT_VERSION to 0.0.1-beta.1 CURRENT_VERSION=$(npm view @dotcms/client dist-tags --json | jq -r '.beta') - if [ -z "$CURRENT_VERSION" ]; then + if [ -z "$CURRENT_VERSION" ] || [ "$CURRENT_VERSION" = "null" ]; then CURRENT_VERSION="0.0.1-beta.0" fi From 3193ebd7462308a81691754fe3c0fcbe84e86603 Mon Sep 17 00:00:00 2001 From: Jalinson Diaz Date: Tue, 4 Feb 2025 14:46:52 -0300 Subject: [PATCH 05/12] Trigger SDK Workflow (#191) Just trigger the workflow --- .../libs/sdk/client/src/lib/utils/page/common-utils.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/core-web/libs/sdk/client/src/lib/utils/page/common-utils.ts b/core-web/libs/sdk/client/src/lib/utils/page/common-utils.ts index 1efff77c97b5..390347199731 100644 --- a/core-web/libs/sdk/client/src/lib/utils/page/common-utils.ts +++ b/core-web/libs/sdk/client/src/lib/utils/page/common-utils.ts @@ -47,10 +47,9 @@ export const getPageRequestParams = ({ finalParams['language_id'] = copiedParams['language_id']; } - // nonsense change just to trigger a build - finalParams['variantName'] = (copiedParams['variantName'] as string)?.length - ? copiedParams['variantName'] - : undefined; + if (copiedParams['variantName']) { + finalParams['variantName'] = copiedParams['variantName']; + } if (copiedParams['personaId'] || dotMarketingPersonaId) { finalParams['personaId'] = copiedParams['personaId'] || dotMarketingPersonaId; From 998fe3c94887feaccb12e7f9a6d7321c37744e38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Enrique=20Colina=20Rodr=C3=ADguez?= Date: Thu, 13 Feb 2025 12:23:09 +0100 Subject: [PATCH 06/12] Update legacy-release_comp_maven-build-docker-image.yml --- .../workflows/legacy-release_comp_maven-build-docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 d6c42ede5189..8f4751855068 100644 --- a/.github/workflows/legacy-release_comp_maven-build-docker-image.yml +++ b/.github/workflows/legacy-release_comp_maven-build-docker-image.yml @@ -258,7 +258,7 @@ jobs: - name: Set up QEMU uses: docker/setup-qemu-action@v3.0.0 with: - image: tonistiigi/binfmt:latest + image: tonistiigi/binfmt:qemu-v8.1.5 platforms: ${{ inputs.docker_platforms }} if: success() From 06ab587d38c9663b8aad3fb78011498c6e980dbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Enrique=20Colina=20Rodr=C3=ADguez?= Date: Thu, 13 Feb 2025 12:23:59 +0100 Subject: [PATCH 07/12] Update action.yml --- .github/actions/core-cicd/deployment/deploy-docker/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/core-cicd/deployment/deploy-docker/action.yml b/.github/actions/core-cicd/deployment/deploy-docker/action.yml index 73f32f375318..8fef9ac29031 100644 --- a/.github/actions/core-cicd/deployment/deploy-docker/action.yml +++ b/.github/actions/core-cicd/deployment/deploy-docker/action.yml @@ -148,7 +148,7 @@ runs: - name: Set up QEMU uses: docker/setup-qemu-action@v3.0.0 with: - image: tonistiigi/binfmt:latest + image: tonistiigi/binfmt:qemu-v8.1.5 platforms: ${{ inputs.docker_platforms }} - name: Docker Metadata @@ -191,4 +191,4 @@ runs: push: ${{ inputs.do_deploy }} cache-from: type=gha cache-to: type=gha,mode=max - build-args: ${{ inputs.build_args }} \ No newline at end of file + build-args: ${{ inputs.build_args }} From e4a3e5e626a91c2fcacab91f199c881baff4ed5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Enrique=20Colina=20Rodr=C3=ADguez?= Date: Thu, 13 Feb 2025 17:19:24 +0100 Subject: [PATCH 08/12] Update action.yml --- .github/actions/core-cicd/deployment/deploy-docker/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/core-cicd/deployment/deploy-docker/action.yml b/.github/actions/core-cicd/deployment/deploy-docker/action.yml index 8fef9ac29031..7e2971762a6c 100644 --- a/.github/actions/core-cicd/deployment/deploy-docker/action.yml +++ b/.github/actions/core-cicd/deployment/deploy-docker/action.yml @@ -148,7 +148,7 @@ runs: - name: Set up QEMU uses: docker/setup-qemu-action@v3.0.0 with: - image: tonistiigi/binfmt:qemu-v8.1.5 + image: tonistiigi/binfmt:qemu-v7.0.0 platforms: ${{ inputs.docker_platforms }} - name: Docker Metadata From 6e1d7c9d8d978763c42ce21fbeec265e5971b9dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Enrique=20Colina=20Rodr=C3=ADguez?= Date: Thu, 13 Feb 2025 17:20:15 +0100 Subject: [PATCH 09/12] Update legacy-release_comp_maven-build-docker-image.yml --- .../workflows/legacy-release_comp_maven-build-docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 8f4751855068..474150a95b6e 100644 --- a/.github/workflows/legacy-release_comp_maven-build-docker-image.yml +++ b/.github/workflows/legacy-release_comp_maven-build-docker-image.yml @@ -258,7 +258,7 @@ jobs: - name: Set up QEMU uses: docker/setup-qemu-action@v3.0.0 with: - image: tonistiigi/binfmt:qemu-v8.1.5 + image: tonistiigi/binfmt:qemu-v7.0.0 platforms: ${{ inputs.docker_platforms }} if: success() From aa4d38aa756c46b4b360eff380a3055bce1517f2 Mon Sep 17 00:00:00 2001 From: spbolton Date: Tue, 18 Feb 2025 01:23:37 +0000 Subject: [PATCH 10/12] add renovate config (#194) ### Proposed Changes * change 1 * change 2 ### Checklist - [ ] Tests - [ ] Translations - [ ] Security Implications Contemplated (add notes if applicable) ### Additional Info ** any additional useful context or info ** ### Screenshots Original | Updated :-------------------------:|:-------------------------: ** original screenshot ** | ** updated screenshot ** --- renovate.json | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 renovate.json diff --git a/renovate.json b/renovate.json new file mode 100644 index 000000000000..a785f2559995 --- /dev/null +++ b/renovate.json @@ -0,0 +1,15 @@ +{ + "enabled": true, + "prHourlyLimit": 0, + "prConcurrentLimit": 0, + "automerge": false, + "packageRules": [ + { + "matchDepTypes": ["dependencies", "devDependencies"], + "enabled": false + } + ], + "logLevel": "debug", + "dependencyDashboard": true, + +} \ No newline at end of file From 87601ea421f5510d74f1e8f57f8312a101bd03f3 Mon Sep 17 00:00:00 2001 From: spbolton Date: Tue, 18 Feb 2025 01:29:44 +0000 Subject: [PATCH 11/12] fix renovate config (#195) ### Proposed Changes * change 1 * change 2 ### Checklist - [ ] Tests - [ ] Translations - [ ] Security Implications Contemplated (add notes if applicable) ### Additional Info ** any additional useful context or info ** ### Screenshots Original | Updated :-------------------------:|:-------------------------: ** original screenshot ** | ** updated screenshot ** --- renovate.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/renovate.json b/renovate.json index a785f2559995..d311d4f0f15b 100644 --- a/renovate.json +++ b/renovate.json @@ -9,7 +9,6 @@ "enabled": false } ], - "logLevel": "debug", - "dependencyDashboard": true, + "dependencyDashboard": true } \ No newline at end of file From 01748370779b1f109c8096f47e4b59d26d505c5e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 18 Feb 2025 01:58:17 +0000 Subject: [PATCH 12/12] chore(deps): update dependency com.knuddels:jtokkit to v1 --- bom/application/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bom/application/pom.xml b/bom/application/pom.xml index 16b6750564ac..d9dde4e21db9 100644 --- a/bom/application/pom.xml +++ b/bom/application/pom.xml @@ -1616,7 +1616,7 @@ com.knuddels jtokkit - 0.6.1 + 1.1.0 com.pgvector