From 1fc316fe3c99a45e3c9a07917bead63782cef4b4 Mon Sep 17 00:00:00 2001 From: valentinab25 Date: Tue, 17 Oct 2023 00:59:40 +0300 Subject: [PATCH 1/5] chore: husky, lint-staged use fixed versions --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index c2f46d2..859b5f0 100644 --- a/package.json +++ b/package.json @@ -22,8 +22,8 @@ "@cypress/code-coverage": "^3.10.0", "@plone/scripts": "*", "babel-plugin-transform-class-properties": "^6.24.1", - "husky": "*", - "lint-staged": "*", + "husky": "^8.0.3", + "lint-staged": "^14.0.1", "md5": "^2.3.0" }, "repository": { From a52f83cd540bc6727c762153dcb2ecb1c5528d56 Mon Sep 17 00:00:00 2001 From: valentinab25 Date: Tue, 31 Oct 2023 02:40:49 +0200 Subject: [PATCH 2/5] chore: [JENKINS] Refactor automated testing --- Dockerfile | 2 +- Jenkinsfile | 287 ++++++++++++++++++++++++++++------------------------ Makefile | 37 ++++++- 3 files changed, 188 insertions(+), 138 deletions(-) diff --git a/Dockerfile b/Dockerfile index bd8e10d..b1ce603 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1 ARG VOLTO_VERSION -FROM plone/frontend-builder:${VOLTO_VERSION} +FROM eeacms/frontend-builder:${VOLTO_VERSION} ARG ADDON_NAME ARG ADDON_PATH diff --git a/Jenkinsfile b/Jenkinsfile index d658f88..c1594b2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,16 +1,20 @@ pipeline { - agent any + agent { + node { label 'docker-host' } + } environment { - GIT_NAME = "volto-columns-block" - NAMESPACE = "@eeacms" - SONARQUBE_TAGS = "volto.eea.europa.eu,climate-energy.eea.europa.eu,forest.eea.europa.eu,biodiversity.europa.eu,www.eea.europa.eu-ims,sustainability.eionet.europa.eu,clms.land.copernicus.eu,industry.eea.europa.eu,water.europa.eu-freshwater,demo-www.eea.europa.eu,clmsdemo.devel6cph.eea.europa.eu,water.europa.eu-marine,climate-adapt.eea.europa.eu,climate-advisory-board.devel4cph.eea.europa.eu,climate-advisory-board.europa.eu,www.eea.europa.eu-en" - DEPENDENCIES = "" - VOLTO = "16" - } + GIT_NAME = "volto-columns-block" + NAMESPACE = "@eeacms" + SONARQUBE_TAGS = "volto.eea.europa.eu,climate-energy.eea.europa.eu,forest.eea.europa.eu,biodiversity.europa.eu,www.eea.europa.eu-ims,sustainability.eionet.europa.eu,clms.land.copernicus.eu,industry.eea.europa.eu,water.europa.eu-freshwater,demo-www.eea.europa.eu,clmsdemo.devel6cph.eea.europa.eu,water.europa.eu-marine,climate-adapt.eea.europa.eu,climate-advisory-board.devel4cph.eea.europa.eu,climate-advisory-board.europa.eu,www.eea.europa.eu-en" + DEPENDENCIES = "" + BACKEND_PROFILES = "eea.kitkat:testing" + BACKEND_ADDONS = "" + VOLTO = "16" + IMAGE_NAME = BUILD_TAG.toLowerCase() + } stages { - stage('Release') { when { allOf { @@ -20,52 +24,41 @@ pipeline { } steps { node(label: 'docker') { - withCredentials([string(credentialsId: 'eea-jenkins-token', variable: 'GITHUB_TOKEN'),string(credentialsId: 'eea-jenkins-npm-token', variable: 'NPM_TOKEN')]) { - sh '''docker pull eeacms/gitflow''' - sh '''docker run -i --rm --name="$BUILD_TAG-gitflow-master" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_NAME="$GIT_NAME" -e GIT_TOKEN="$GITHUB_TOKEN" -e NPM_TOKEN="$NPM_TOKEN" -e LANGUAGE=javascript eeacms/gitflow''' + withCredentials([string(credentialsId: 'eea-jenkins-token', variable: 'GITHUB_TOKEN'), string(credentialsId: 'eea-jenkins-npm-token', variable: 'NPM_TOKEN')]) { + sh '''docker run -i --rm --pull always --name="$IMAGE_NAME-gitflow-master" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_NAME="$GIT_NAME" -e GIT_TOKEN="$GITHUB_TOKEN" -e NPM_TOKEN="$NPM_TOKEN" -e LANGUAGE=javascript eeacms/gitflow''' } } } } - stage('Code') { + stage('Check if testing needed') { when { allOf { - environment name: 'CHANGE_ID', value: '' - not { changelog '.*^Automated release [0-9\\.]+$' } not { branch 'master' } + not { branch 'develop' } + environment name: 'CHANGE_ID', value: '' } } steps { - parallel( - - "ES lint": { - node(label: 'docker') { - sh '''docker run -i --rm --name="$BUILD_TAG-eslint" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e VOLTO=$VOLTO plone/volto-addon-ci eslint''' - } - }, - - "Style lint": { - node(label: 'docker') { - sh '''docker run -i --rm --name="$BUILD_TAG-stylelint" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e VOLTO=$VOLTO plone/volto-addon-ci stylelint''' - } - }, + script { + withCredentials([string(credentialsId: 'eea-jenkins-token', variable: 'GITHUB_TOKEN')]) { + check_result = sh script: '''docker run --pull always -i --rm --name="$IMAGE_NAME-gitflow-check" -e GIT_TOKEN="$GITHUB_TOKEN" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_ORG="$GIT_ORG" -e GIT_NAME="$GIT_NAME" eeacms/gitflow /check_if_testing_needed.sh''', returnStatus: true - "Prettier": { - node(label: 'docker') { - sh '''docker run -i --rm --name="$BUILD_TAG-prettier" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e VOLTO=$VOLTO plone/volto-addon-ci prettier''' + if (check_result == 0) { + env.SKIP_TESTS = 'yes' + } } - } - ) + } } } - stage('Tests') { + stage('Testing') { when { anyOf { allOf { not { environment name: 'CHANGE_ID', value: '' } environment name: 'CHANGE_TARGET', value: 'develop' + environment name: 'SKIP_TESTS', value: '' } allOf { environment name: 'CHANGE_ID', value: '' @@ -73,26 +66,76 @@ pipeline { not { changelog '.*^Automated release [0-9\\.]+$' } branch 'master' } + environment name: 'SKIP_TESTS', value: '' } } } - steps { - parallel( + stages { + stage('Build test image') { + steps { + checkout scm + sh '''docker build --build-arg="VOLTO_VERSION=$VOLTO" --build-arg="ADDON_NAME=$NAMESPACE/$GIT_NAME" --build-arg="ADDON_PATH=$GIT_NAME" . -t $IMAGE_NAME-frontend''' + } + } + + stage('Fix code') { + when { + environment name: 'CHANGE_ID', value: '' + not { branch 'master' } + } + steps { + script { + fix_result = sh(script: '''docker run --name="$IMAGE_NAME-fix" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend ci-fix''', returnStatus: true) + sh '''docker cp $IMAGE_NAME-fix:/app/src/addons/$GIT_NAME/src .''' + sh '''docker rm -v $IMAGE_NAME-fix''' + FOUND_FIX = sh(script: '''git diff | wc -l''', returnStdout: true).trim() - "Volto": { - node(label: 'docker') { - script { - try { - sh '''docker pull plone/volto-addon-ci''' - sh '''docker run -i --name="$BUILD_TAG-volto" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e VOLTO=$VOLTO plone/volto-addon-ci''' - sh '''rm -rf xunit-reports''' - sh '''mkdir -p xunit-reports''' - sh '''docker cp $BUILD_TAG-volto:/opt/frontend/my-volto-project/coverage xunit-reports/''' - sh '''docker cp $BUILD_TAG-volto:/opt/frontend/my-volto-project/junit.xml xunit-reports/''' - sh '''docker cp $BUILD_TAG-volto:/opt/frontend/my-volto-project/unit_tests_log.txt xunit-reports/''' - stash name: "xunit-reports", includes: "xunit-reports/**" - archiveArtifacts artifacts: "xunit-reports/unit_tests_log.txt", fingerprint: true - publishHTML (target : [ + if (FOUND_FIX != '0') { + withCredentials([string(credentialsId: 'eea-jenkins-token', variable: 'GITHUB_TOKEN')]) { + sh '''sed -i "s|url = .*|url = https://eea-jenkins:$GITHUB_TOKEN@github.com/eea/$GIT_NAME.git|" .git/config''' + } + sh '''git fetch origin $GIT_BRANCH:$GIT_BRANCH''' + sh '''git checkout $GIT_BRANCH''' + sh '''git add src/''' + sh '''git commit -m "style: Automated code fix" ''' + sh '''git push --set-upstream origin $GIT_BRANCH''' + sh '''exit 1''' + } + } + } + } + + stage('ES lint') { + steps { + sh '''docker run --rm --name="$IMAGE_NAME-eslint" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend lint''' + } + } + + stage('Style lint') { + steps { + sh '''docker run --rm --name="$IMAGE_NAME-stylelint" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend stylelint''' + } + } + + stage('Prettier') { + steps { + sh '''docker run --rm --name="$IMAGE_NAME-prettier" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend prettier''' + } + } + + stage('Coverage Tests') { + parallel { + + stage('Unit tests') { + steps { + script { + try { + sh '''docker run --name="$IMAGE_NAME-volto" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend test-ci''' + sh '''rm -rf xunit-reports''' + sh '''mkdir -p xunit-reports''' + sh '''docker cp $IMAGE_NAME-volto:/app/coverage xunit-reports/''' + sh '''docker cp $IMAGE_NAME-volto:/app/junit.xml xunit-reports/''' + publishHTML(target : [ allowMissing: false, alwaysLinkToLastBuild: true, keepAll: true, @@ -105,75 +148,60 @@ pipeline { catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') { junit testResults: 'xunit-reports/junit.xml', allowEmptyResults: true } - sh script: '''docker rm -v $BUILD_TAG-volto''', returnStatus: true + sh script: '''docker rm -v $IMAGE_NAME-volto''', returnStatus: true + } } } } - } - ) - } - } + + stage('Integration tests') { + steps { + script { + try { + sh '''docker run --pull always --rm -d --name="$IMAGE_NAME-plone" -e SITE="Plone" -e PROFILES="$BACKEND_PROFILES" -e ADDONS="$BACKEND_ADDONS" eeacms/plone-backend''' + sh '''docker run --link $IMAGE_NAME-plone:plone --entrypoint=make --name="$IMAGE_NAME-cypress" --workdir=/app/src/addons/${GIT_NAME} -e "RAZZLE_INTERNAL_API_PATH=http://plone:8080/Plone" $IMAGE_NAME-frontend cypress-ci''' + } finally { + try { + sh '''rm -rf cypress-videos cypress-results cypress-coverage cypress-screenshots''' + sh '''mkdir -p cypress-videos cypress-results cypress-coverage cypress-screenshots''' + sh '''docker cp $IMAGE_NAME-cypress:/app/src/addons/$GIT_NAME/cypress/videos cypress-videos/''' + sh '''docker cp $IMAGE_NAME-cypress:/app/src/addons/$GIT_NAME/cypress/reports cypress-results/''' + screenshots = sh script: '''docker cp $IMAGE_NAME-cypress:/app/src/addons/$GIT_NAME/cypress/screenshots cypress-screenshots''', returnStatus: true - stage('Integration tests') { - when { - anyOf { - allOf { - not { environment name: 'CHANGE_ID', value: '' } - environment name: 'CHANGE_TARGET', value: 'develop' - } - allOf { - environment name: 'CHANGE_ID', value: '' - anyOf { - not { changelog '.*^Automated release [0-9\\.]+$' } - branch 'master' - } - } - } - } - steps { - parallel( + archiveArtifacts artifacts: 'cypress-screenshots/**', fingerprint: true, allowEmptyArchive: true - "Cypress": { - node(label: 'docker') { - script { - try { - sh '''docker pull eeacms/plone-backend; docker run --rm -d --name="$BUILD_TAG-plone" -e SITE="Plone" -e PROFILES="eea.kitkat:testing" eeacms/plone-backend''' - sh '''docker pull plone/volto-addon-ci; docker run -i --name="$BUILD_TAG-cypress" --link $BUILD_TAG-plone:plone -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e DEPENDENCIES="$DEPENDENCIES" -e NODE_ENV=development -e VOLTO=$VOLTO plone/volto-addon-ci cypress''' - } finally { - try { - sh '''rm -rf cypress-reports cypress-results cypress-coverage''' - sh '''mkdir -p cypress-reports cypress-results cypress-coverage''' - sh '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/src/addons/$GIT_NAME/cypress/videos cypress-reports/''' - sh '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/src/addons/$GIT_NAME/cypress/reports cypress-results/''' - coverage = sh script: '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/src/addons/$GIT_NAME/coverage cypress-coverage/''', returnStatus: true - if ( coverage == 0 ) { - publishHTML (target : [allowMissing: false, + coverage = sh script: '''docker cp $IMAGE_NAME-cypress:/app/src/addons/$GIT_NAME/coverage cypress-coverage''', returnStatus: true + + if ( coverage == 0 ) { + publishHTML(target : [allowMissing: false, alwaysLinkToLastBuild: true, keepAll: true, reportDir: 'cypress-coverage/coverage/lcov-report', reportFiles: 'index.html', reportName: 'CypressCoverage', reportTitles: 'Integration Tests Code Coverage']) - } - sh '''touch empty_file; for ok_test in $(grep -E 'file=.*failures="0"' $(grep 'testsuites .*failures="0"' $(find cypress-results -name *.xml) empty_file | awk -F: '{print $1}') empty_file | sed 's/.* file="\\(.*\\)" time.*/\\1/' | sed 's#^cypress/integration/##g' | sed 's#^../../../node_modules/@eeacms/##g'); do rm -f cypress-reports/videos/$ok_test.mp4; rm -f cypress-reports/$ok_test.mp4; done''' - archiveArtifacts artifacts: 'cypress-reports/**/*.mp4', fingerprint: true, allowEmptyArchive: true - stash name: "cypress-coverage", includes: "cypress-coverage/**", allowEmpty: true - } - finally { - catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') { + } + sh '''for file in $(find cypress-results -name *.xml); do if [ $(grep -E 'failures="[1-9].*"' $file | wc -l) -eq 0 ]; then testname=$(grep -E 'file=.*failures="0"' $file | sed 's#.* file=".*\\/\\(.*\\.[jsxt]\\+\\)" time.*#\\1#' ); rm -f cypress-videos/videos/$testname.mp4; fi; done''' + archiveArtifacts artifacts: 'cypress-videos/**', fingerprint: true, allowEmptyArchive: true + } finally { + catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') { junit testResults: 'cypress-results/**/*.xml', allowEmptyResults: true + } + sh script: "docker stop $IMAGE_NAME-plone", returnStatus: true + sh script: "docker rm -v $IMAGE_NAME-plone", returnStatus: true + sh script: "docker rm -v $IMAGE_NAME-cypress", returnStatus: true } - sh script: "docker stop $BUILD_TAG-plone", returnStatus: true - sh script: "docker rm -v $BUILD_TAG-plone", returnStatus: true - sh script: "docker rm -v $BUILD_TAG-cypress", returnStatus: true - } } } } } - - ) + } + } + post { + always { + sh script: "docker rmi $IMAGE_NAME-frontend", returnStatus: true + } } } @@ -197,20 +225,16 @@ pipeline { } } steps { - node(label: 'swarm') { - script{ - checkout scm - unstash "xunit-reports" - unstash "cypress-coverage" - def scannerHome = tool 'SonarQubeScanner'; - def nodeJS = tool 'NodeJS'; - withSonarQubeEnv('Sonarqube') { - sh '''sed -i "s#/opt/frontend/my-volto-project/src/addons/${GIT_NAME}/##g" xunit-reports/coverage/lcov.info''' - sh '''sed -i "s#src/addons/${GIT_NAME}/##g" xunit-reports/coverage/lcov.info''' - sh "export PATH=${scannerHome}/bin:${nodeJS}/bin:$PATH; sonar-scanner -Dsonar.javascript.lcov.reportPaths=./xunit-reports/coverage/lcov.info,./cypress-coverage/coverage/lcov.info -Dsonar.sources=./src -Dsonar.projectKey=$GIT_NAME-$BRANCH_NAME -Dsonar.projectVersion=$BRANCH_NAME-$BUILD_NUMBER" - sh "export PATH=${scannerHome}/bin:${nodeJS}/bin:$PATH; sonar-scanner -Dsonar.javascript.lcov.reportPaths=./cypress-coverage/coverage/lcov.info -Dsonar.sources=./src -Dsonar.projectKey=$GIT_NAME-$BRANCH_NAME -Dsonar.projectVersion=$BRANCH_NAME-$BUILD_NUMBER" - sh '''try=2; while [ \$try -gt 0 ]; do curl -s -XPOST -u "${SONAR_AUTH_TOKEN}:" "${SONAR_HOST_URL}api/project_tags/set?project=${GIT_NAME}-${BRANCH_NAME}&tags=${SONARQUBE_TAGS},${BRANCH_NAME}" > set_tags_result; if [ \$(grep -ic error set_tags_result ) -eq 0 ]; then try=0; else cat set_tags_result; echo "... Will retry"; sleep 60; try=\$(( \$try - 1 )); fi; done''' - } + script { + def scannerHome = tool 'SonarQubeScanner' + def nodeJS = tool 'NodeJS' + withSonarQubeEnv('Sonarqube') { + sh '''sed -i "s#/app/src/addons/${GIT_NAME}/##g" xunit-reports/coverage/lcov.info''' + sh '''sed -i "s#src/addons/${GIT_NAME}/##g" xunit-reports/coverage/lcov.info''' + sh '''cat xunit-reports/coverage/lcov.info''' + sh '''cat cypress-coverage/coverage/lcov.info''' + sh "export PATH=${scannerHome}/bin:${nodeJS}/bin:$PATH; sonar-scanner -Dsonar.javascript.lcov.reportPaths=./xunit-reports/coverage/lcov.info,./cypress-coverage/coverage/lcov.info -Dsonar.sources=./src -Dsonar.projectKey=$GIT_NAME-$BRANCH_NAME -Dsonar.projectVersion=$BRANCH_NAME-$BUILD_NUMBER" + sh '''try=5; while [ \$try -gt 0 ]; do curl -s -XPOST -u "${SONAR_AUTH_TOKEN}:" "${SONAR_HOST_URL}api/project_tags/set?project=${GIT_NAME}-${BRANCH_NAME}&tags=${SONARQUBE_TAGS},${BRANCH_NAME}" > set_tags_result; if [ \$(grep -ic error set_tags_result ) -eq 0 ]; then try=0; else cat set_tags_result; echo "... Will retry"; sleep 15; try=\$(( \$try - 1 )); fi; done''' } } } @@ -231,18 +255,15 @@ pipeline { } } steps { - node(label: 'docker') { - script { - sh '''docker pull eeacms/gitflow''' - sh '''echo "Error" > checkresult.txt''' - catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { - sh '''set -o pipefail; docker run -i --rm --name="$BUILD_TAG-gitflow-sn" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_NAME="$GIT_NAME" eeacms/gitflow /checkSonarqubemaster.sh | grep -v "Found script" | tee checkresult.txt''' - } - - publishChecks name: 'SonarQube', title: 'Sonarqube Code Quality Check', summary: "Quality check on the SonarQube metrics from branch develop, comparing it with the ones from master branch. No bugs are allowed", - text: readFile(file: 'checkresult.txt'), conclusion: "${currentBuild.currentResult}", - detailsURL: "${env.BUILD_URL}display/redirect" + script { + sh '''echo "Error" > checkresult.txt''' + catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { + sh '''set -o pipefail; docker run -i --rm --pull always --name="$IMAGE_NAME-gitflow-sn" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_NAME="$GIT_NAME" eeacms/gitflow /checkSonarqubemaster.sh | grep -v "Found script" | tee checkresult.txt''' } + + publishChecks name: 'SonarQube', title: 'Sonarqube Code Quality Check', summary: 'Quality check on the SonarQube metrics from branch develop, comparing it with the ones from master branch. No bugs are allowed', + text: readFile(file: 'checkresult.txt'), conclusion: "${currentBuild.currentResult}", + detailsURL: "${env.BUILD_URL}display/redirect" } } } @@ -255,20 +276,16 @@ pipeline { environment name: 'CHANGE_TARGET', value: 'master' } steps { - node(label: 'docker') { - script { - if ( env.CHANGE_BRANCH != "develop" ) { - error "Pipeline aborted due to PR not made from develop branch" - } - withCredentials([string(credentialsId: 'eea-jenkins-token', variable: 'GITHUB_TOKEN')]) { - sh '''docker pull eeacms/gitflow''' - sh '''docker run -i --rm --name="$BUILD_TAG-gitflow-pr" -e GIT_CHANGE_TARGET="$CHANGE_TARGET" -e GIT_CHANGE_BRANCH="$CHANGE_BRANCH" -e GIT_CHANGE_AUTHOR="$CHANGE_AUTHOR" -e GIT_CHANGE_TITLE="$CHANGE_TITLE" -e GIT_TOKEN="$GITHUB_TOKEN" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e GIT_ORG="$GIT_ORG" -e GIT_NAME="$GIT_NAME" -e LANGUAGE=javascript eeacms/gitflow''' - } + script { + if (env.CHANGE_BRANCH != 'develop') { + error 'Pipeline aborted due to PR not made from develop branch' + } + withCredentials([string(credentialsId: 'eea-jenkins-token', variable: 'GITHUB_TOKEN')]) { + sh '''docker run --pull always -i --rm --name="$IMAGE_NAME-gitflow-pr" -e GIT_CHANGE_TARGET="$CHANGE_TARGET" -e GIT_CHANGE_BRANCH="$CHANGE_BRANCH" -e GIT_CHANGE_AUTHOR="$CHANGE_AUTHOR" -e GIT_CHANGE_TITLE="$CHANGE_TITLE" -e GIT_TOKEN="$GITHUB_TOKEN" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e GIT_ORG="$GIT_ORG" -e GIT_NAME="$GIT_NAME" -e LANGUAGE=javascript eeacms/gitflow''' } } } } - } post { diff --git a/Makefile b/Makefile index f3614a8..6e221b3 100644 --- a/Makefile +++ b/Makefile @@ -50,6 +50,11 @@ VOLTO_VERSION?=16 ADDON_PATH="${DIR}" ADDON_NAME="@eeacms/${ADDON_PATH}" DOCKER_COMPOSE=PLONE_VERSION=${PLONE_VERSION} VOLTO_VERSION=${VOLTO_VERSION} ADDON_NAME=${ADDON_NAME} ADDON_PATH=${ADDON_PATH} docker compose +RAZZLE_INTERNAL_API_PATH?="${RAZZLE_DEV_PROXY_API_PATH}" +RAZZLE_DEV_PROXY_API_PATH?="${RAZZLE_INTERNAL_API_PATH}" +CYPRESS_API_PATH="${RAZZLE_DEV_PROXY_API_PATH}" + + # Top-level targets .PHONY: all @@ -77,11 +82,11 @@ shell: ## Start a shell in the frontend container .PHONY: cypress-open cypress-open: ## Open cypress integration tests - NODE_ENV=development $(NODE_MODULES)/cypress/bin/cypress open + CYPRESS_API_PATH="${RAZZLE_DEV_PROXY_API_PATH}" NODE_ENV=development $(NODE_MODULES)/cypress/bin/cypress open .PHONY: cypress-run cypress-run: ## Run cypress integration tests - NODE_ENV=development $(NODE_MODULES)/cypress/bin/cypress run + CYPRESS_API_PATH="${RAZZLE_DEV_PROXY_API_PATH}" NODE_ENV=development $(NODE_MODULES)/cypress/bin/cypress run .PHONY: test test: ## Run jest tests @@ -129,3 +134,31 @@ i18n: ## i18n help: ## Show this help. @echo -e "$$(grep -hE '^\S+:.*##' $(MAKEFILE_LIST) | sed -e 's/:.*##\s*/:/' -e 's/^\(.\+\):\(.*\)/\\x1b[36m\1\\x1b[m:\2/' | column -c2 -t -s :)" head -n 14 Makefile + +.PHONY: ci-fix +ci-fix: + echo "Running lint-fix" + make lint-fix + echo "Running prettier-fix" + make prettier-fix + echo "Running stylelint-fix" + make stylelint-fix + +.PHONY: test-ci +test-ci: + cd /app + RAZZLE_JEST_CONFIG=src/addons/${ADDON_PATH}/jest-addon.config.js CI=true yarn test src/addons/${ADDON_PATH}/src --watchAll=false --reporters=default --reporters=jest-junit --collectCoverage --coverageReporters lcov cobertura text + +.PHONY: start-ci +start-ci: + cd ../.. + yarn start & + +.PHONY: cypress-ci +cypress-ci: + cp .coverage.babel.config.js /app/babel.config.js + make start-ci + $(NODE_MODULES)/.bin/wait-on -t 240000 http://localhost:3000 + NODE_ENV=development make cypress-run + + From 8080e843d9ed2604da76d361d65ede5d03446732 Mon Sep 17 00:00:00 2001 From: laszlocseh Date: Wed, 1 Nov 2023 10:30:19 +0200 Subject: [PATCH 3/5] Fix margin-bottom inside the columns block --- src/less/columns.less | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/less/columns.less b/src/less/columns.less index 448fc6b..a86737b 100644 --- a/src/less/columns.less +++ b/src/less/columns.less @@ -15,12 +15,6 @@ .block-editor-columnsBlock, .quanta-block-editor-columnsBlock { - .block-column .ui.block.inner { - .block { - margin-bottom: 0; - } - } - .block.columnsBlock.selected::before, .block.columnsBlock:hover::before { border-style: dashed; From d88a8ccd7af8648f22f182016570a9ee5ba69a2f Mon Sep 17 00:00:00 2001 From: Alin Voinea Date: Thu, 2 Nov 2023 11:03:03 +0200 Subject: [PATCH 4/5] Release 6.4.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 859b5f0..46108ba 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@eeacms/volto-columns-block", - "version": "6.3.5", + "version": "6.4.0", "description": "volto-columns-block: Volto add-on", "main": "src/index.js", "author": "European Environment Agency: IDM2 A-Team", From 545592cab030ac03a80ba9ec2b32a95a0d9b3328 Mon Sep 17 00:00:00 2001 From: EEA Jenkins <@users.noreply.github.com> Date: Thu, 2 Nov 2023 09:13:15 +0000 Subject: [PATCH 5/5] Automated release 6.4.0 --- CHANGELOG.md | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b8af0f0..630450f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +### [6.4.0](https://github.com/eea/volto-columns-block/compare/6.3.5...6.4.0) - 2 November 2023 + +#### :house: Internal changes + +- chore: husky, lint-staged use fixed versions [valentinab25 - [`1fc316f`](https://github.com/eea/volto-columns-block/commit/1fc316fe3c99a45e3c9a07917bead63782cef4b4)] + +#### :hammer_and_wrench: Others + +- Release 6.4.0 [Alin Voinea - [`d88a8cc`](https://github.com/eea/volto-columns-block/commit/d88a8ccd7af8648f22f182016570a9ee5ba69a2f)] +- Fix margin-bottom inside the columns block [laszlocseh - [`8080e84`](https://github.com/eea/volto-columns-block/commit/8080e843d9ed2604da76d361d65ede5d03446732)] ### [6.3.5](https://github.com/eea/volto-columns-block/compare/6.3.4...6.3.5) - 16 October 2023 #### :house: Internal changes @@ -64,7 +74,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### :house: Internal changes -- chore: [JENKINS] Deprecate circularity website [valentinab25 - [`b535c91`](https://github.com/eea/volto-columns-block/commit/b535c9135bce0dd172e60f7f8af5ebd9fa0c073d)] #### :hammer_and_wrench: Others @@ -92,12 +101,10 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### :hammer_and_wrench: Others -- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`5738a85`](https://github.com/eea/volto-columns-block/commit/5738a85810a7fe5ad64d6ae0362ffffa7bbc6bc5)] ### [6.1.0](https://github.com/eea/volto-columns-block/compare/6.0.2...6.1.0) - 27 March 2023 #### :hammer_and_wrench: Others -- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`8e96c96`](https://github.com/eea/volto-columns-block/commit/8e96c967909944e827a1c1a303283c04d76f5db6)] ### [6.0.2](https://github.com/eea/volto-columns-block/compare/6.0.1...6.0.2) - 21 February 2023 #### :hammer_and_wrench: Others @@ -110,7 +117,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### :hammer_and_wrench: Others - Release 6.0.0 [Alin Voinea - [`947cd73`](https://github.com/eea/volto-columns-block/commit/947cd730ac967515e8a508924eab6efb3e485196)] -- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`10b77f7`](https://github.com/eea/volto-columns-block/commit/10b77f765c2f6a42bf5e79cf46b4a48f5eb1f011)] ### [5.2.0](https://github.com/eea/volto-columns-block/compare/5.1.0...5.2.0) - 28 December 2022 #### :hammer_and_wrench: Others @@ -118,17 +124,13 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Release 5.2.0 [Alin Voinea - [`7ea7976`](https://github.com/eea/volto-columns-block/commit/7ea7976615b932802aece75d68065fa1b5063676)] - test(eslint): Fix lint [Alin Voinea - [`1a5b9af`](https://github.com/eea/volto-columns-block/commit/1a5b9afeec15d998b24e3d9bedaa9c9044a54f9b)] - Mock useLocation to fix ColumnsBlockView.test [wesleybl - [`e153a48`](https://github.com/eea/volto-columns-block/commit/e153a481103bc6db74ce19ec536e51cfcd232b6f)] -- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`e8c0e8b`](https://github.com/eea/volto-columns-block/commit/e8c0e8bc9d65fbd4e454dd5ff0de158c864dd317)] - test(Jenkins): Run tests and cypress with latest canary @plone/volto [Alin Voinea - [`2ae13d2`](https://github.com/eea/volto-columns-block/commit/2ae13d2afdaca0c774b502f716258f6a481d4e49)] -- Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`e880669`](https://github.com/eea/volto-columns-block/commit/e8806694b640a0130bed701bd01f7a4901cff05d)] - Don't fail in tests [Tiberiu Ichim - [`6c1dddf`](https://github.com/eea/volto-columns-block/commit/6c1dddf29860762c046393983b52a6609259aa29)] ### [5.1.0](https://github.com/eea/volto-columns-block/compare/5.0.1...5.1.0) - 29 November 2022 #### :hammer_and_wrench: Others - Release 5.1.0 [Alin Voinea - [`4b199b2`](https://github.com/eea/volto-columns-block/commit/4b199b20a79d5ab3e5cad058565de444c6e3c68a)] -- yarn 3 [Alin Voinea - [`b6993ba`](https://github.com/eea/volto-columns-block/commit/b6993bac1f962be29d719a8bf1e394ff57d9e3cb)] -- Add Sonarqube tag using demo-kitkat-frontend addons list [EEA Jenkins - [`1d93d8d`](https://github.com/eea/volto-columns-block/commit/1d93d8d343b8b43c8eea763630b5d4476d242a44)] ### [5.0.1](https://github.com/eea/volto-columns-block/compare/5.0.0...5.0.1) - 16 November 2022 #### :bug: Bug Fixes @@ -166,8 +168,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Cleanup [Miu Razvan - [`86e202e`](https://github.com/eea/volto-columns-block/commit/86e202eac4bc6ef4e776e79f62c0f96883848fab)] - Cleanup [Alin Voinea - [`1baba7f`](https://github.com/eea/volto-columns-block/commit/1baba7f9959a13eb15070311b6f5f07ce396c84e)] - Update dependencies [Alin Voinea - [`976c380`](https://github.com/eea/volto-columns-block/commit/976c380bb1ca2d985b2bfb1a88d2144aa2c11028)] -- Add Sonarqube tag using marine-frontend addons list [EEA Jenkins - [`d978235`](https://github.com/eea/volto-columns-block/commit/d978235da3ab5dff38faba2673bb9a1afa7012a3)] -- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`c8daea6`](https://github.com/eea/volto-columns-block/commit/c8daea6cad87650895d063c8d852b01d74cfd326)] - update(jest): add @plone/volto-slate resolver refs- #153447 [nileshgulia1 - [`50ab9a0`](https://github.com/eea/volto-columns-block/commit/50ab9a0ff903badb677da43d913fd698f031895c)] ### [4.5.3](https://github.com/eea/volto-columns-block/compare/4.5.2...4.5.3) - 17 August 2022 @@ -181,7 +181,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### :hammer_and_wrench: Others -- Add Sonarqube tag using circularity-frontend addons list [EEA Jenkins - [`bab4f31`](https://github.com/eea/volto-columns-block/commit/bab4f318a773ff4de42f9e1e095a2e7ae39f6b01)] ### [4.5.0](https://github.com/eea/volto-columns-block/compare/4.4.15...4.5.0) - 11 April 2022 #### :hammer_and_wrench: Others @@ -197,8 +196,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### :hammer_and_wrench: Others -- Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`ff71f20`](https://github.com/eea/volto-columns-block/commit/ff71f2020b724e2dca5d5f5467f51fc619d5f404)] -- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`a8becc0`](https://github.com/eea/volto-columns-block/commit/a8becc0159ab140dcf6bb1b2de7429bae81adb78)] ### [4.4.14](https://github.com/eea/volto-columns-block/compare/4.4.13...4.4.14) - 21 January 2022 ### [4.4.13](https://github.com/eea/volto-columns-block/compare/4.4.12...4.4.13) - 13 January 2022 @@ -219,14 +216,11 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### :hammer_and_wrench: Others -- Add Sonarqube tag using freshwater-frontend addons list [EEA Jenkins - [`a745845`](https://github.com/eea/volto-columns-block/commit/a745845507ed2a32b4f50280439875e7287793e0)] ### [4.4.7](https://github.com/eea/volto-columns-block/compare/4.4.6...4.4.7) - 10 December 2021 #### :hammer_and_wrench: Others - Refs #142010 - Optimize Volto-addons gitflow pipelines [valentinab25 - [`eccf195`](https://github.com/eea/volto-columns-block/commit/eccf19562860a61812187a4e55dd0f03c6a727d7)] -- Add Sonarqube tag using industry-frontend addons list [EEA Jenkins - [`a04ee43`](https://github.com/eea/volto-columns-block/commit/a04ee430e1407f3aa39886e98f4f11fcbec70b66)] -- Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`946133c`](https://github.com/eea/volto-columns-block/commit/946133c42004febadf2a1c8d330fbac6f820f160)] ### [4.4.6](https://github.com/eea/volto-columns-block/compare/4.4.5...4.4.6) - 14 October 2021 #### :hammer_and_wrench: Others @@ -236,8 +230,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Add missing 40/60 grid [kreafox - [`c30b33c`](https://github.com/eea/volto-columns-block/commit/c30b33c393062f7ac2a09e3bc181224d3e8f921f)] - Add padding for columns [kreafox - [`f945477`](https://github.com/eea/volto-columns-block/commit/f945477cd4150d8a570c26774a8afb3989d6fcba)] - Add custom class for columns [kreafox - [`0e4783f`](https://github.com/eea/volto-columns-block/commit/0e4783f44d87c526dc0535874f75d41a85c5cf12)] -- Add Sonarqube tag using sustainability-frontend addons list [EEA Jenkins - [`35aa796`](https://github.com/eea/volto-columns-block/commit/35aa79635a03778819365873fdad2937e79b4f5f)] -- Add Sonarqube tag using ims-frontend addons list [EEA Jenkins - [`ab3713a`](https://github.com/eea/volto-columns-block/commit/ab3713a9e696b31f90c57b7e39faab03c767196f)] ### [4.4.5](https://github.com/eea/volto-columns-block/compare/4.4.4...4.4.5) - 13 August 2021 #### :hammer_and_wrench: Others @@ -255,9 +247,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - pretty [Tiberiu Ichim - [`53f1ab7`](https://github.com/eea/volto-columns-block/commit/53f1ab7970018f0a6de5ddf09495d1792320949d)] - Fix styles in quanta toolbar [Tiberiu Ichim - [`97cfc46`](https://github.com/eea/volto-columns-block/commit/97cfc46e617bc5a22795817f71b1dd826ed1faf5)] -- Add Sonarqube tag using frontend addons list [EEA Jenkins - [`b26321b`](https://github.com/eea/volto-columns-block/commit/b26321bdf9eb2e4b5c1282210dfc8faa8849487f)] -- Add Sonarqube tag using frontend addons list [EEA Jenkins - [`0809fcb`](https://github.com/eea/volto-columns-block/commit/0809fcb4bce8611e5e417aa2222a7e9b40ba5936)] -- Add Sonarqube tag using frontend addons list [EEA Jenkins - [`36a4df2`](https://github.com/eea/volto-columns-block/commit/36a4df2cd83d48ddc2cefe9946a2c604798b9d6c)] ### [4.4.3](https://github.com/eea/volto-columns-block/compare/4.4.2...4.4.3) - 27 May 2021 ### [4.4.2](https://github.com/eea/volto-columns-block/compare/4.4.1...4.4.2) - 29 April 2021 @@ -393,7 +382,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Release 1.0.0 [Alin Voinea - [`b432244`](https://github.com/eea/volto-columns-block/commit/b43224465fc15096fd41c61eee3f4cadffaed57f)] - Update docs [Alin Voinea - [`f698f3c`](https://github.com/eea/volto-columns-block/commit/f698f3ca05b3f5a8f240db409cde4d1ddeeed78b)] -- yarn prettier [Alin Voinea - [`ae092f6`](https://github.com/eea/volto-columns-block/commit/ae092f6a101857cf068ed639c7d4686722db4d58)] ### [0.3.7](https://github.com/eea/volto-columns-block/compare/0.3.6...0.3.7) - 9 November 2020 #### :hammer_and_wrench: Others