diff --git a/Jenkinsfile b/Jenkinsfile index 8901580..6d0ab31 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -87,14 +87,24 @@ pipeline { "PloneSaaS": { node(label: 'docker') { - sh '''docker run -i --rm --name="$BUILD_TAG-plonesaas" -e GIT_NAME="$GIT_NAME" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" eeacms/plonesaas-devel /debug.sh bin/test --test-path /plone/instance/src/$GIT_NAME -v -vv -s $GIT_NAME''' + script { + try { + sh '''docker pull eeacms/plonesaas-devel; docker run -i --name="$BUILD_TAG-plonesaas" -e GIT_NAME="$GIT_NAME" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" eeacms/plonesaas-devel /debug.sh coverage''' + sh '''mkdir -p xunit-reports; docker cp $BUILD_TAG-plonesaas:/plone/instance/parts/xmltestreport/testreports/. xunit-reports/''' + stash name: "xunit-reports", includes: "xunit-reports/*.xml" + sh '''docker cp $BUILD_TAG-plonesaas:/plone/instance/src/$GIT_NAME/coverage.xml coverage.xml''' + stash name: "coverage.xml", includes: "coverage.xml" + } finally { + sh '''docker rm -v $BUILD_TAG-plonesaas''' + } + junit 'xunit-reports/*.xml' + } } - } + }, ) } } - stage('Report to SonarQube') { when { allOf { @@ -105,10 +115,15 @@ pipeline { node(label: 'swarm') { script{ checkout scm + dir("xunit-reports") { + unstash "xunit-reports" + } + unstash "coverage.xml" def scannerHome = tool 'SonarQubeScanner'; def nodeJS = tool 'NodeJS11'; withSonarQubeEnv('Sonarqube') { - sh "export PATH=$PATH:${scannerHome}/bin:${nodeJS}/bin; sonar-scanner -Dsonar.python.xunit.skipDetails=true -Dsonar.python.xunit.reportPath=xunit-reports/*.xml -Dsonar.python.coverage.reportPath=coverage.xml -Dsonar.sources=./eea -Dsonar.projectKey=$GIT_NAME-$BRANCH_NAME -Dsonar.projectVersion=$BRANCH_NAME-$BUILD_NUMBER" + sh '''sed -i "s|/plone/instance/src/$GIT_NAME|$(pwd)|g" coverage.xml''' + sh "export PATH=$PATH:${scannerHome}/bin:${nodeJS}/bin; sonar-scanner -Dsonar.python.xunit.skipDetails=true -Dsonar.python.xunit.reportPath=xunit-reports/*.xml -Dsonar.python.coverage.reportPaths=coverage.xml -Dsonar.sources=./eea -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''' } } @@ -116,6 +131,7 @@ pipeline { } } + stage('Pull Request') { when { not { diff --git a/docs/HISTORY.txt b/docs/HISTORY.txt index 4d2cb3a..faaf5e0 100644 --- a/docs/HISTORY.txt +++ b/docs/HISTORY.txt @@ -1,6 +1,11 @@ Changelog ========= +2.7 - (2021-11-22) +--------------------------- +* allow digits in role_id filtering + [valipod] + 2.6 - (2021-04-08) --------------------------- * add email validation (replacing validate_email package) [dumitval] diff --git a/eea/usersdb/db_agent.py b/eea/usersdb/db_agent.py index 97c19de..d69a440 100644 --- a/eea/usersdb/db_agent.py +++ b/eea/usersdb/db_agent.py @@ -531,7 +531,7 @@ def filter_roles( pattern = pattern.lower() for ch in pattern: - if ch not in ascii_lowercase + '-*': + if ch not in ascii_lowercase + digits + '-*': return set() if not pattern: diff --git a/eea/usersdb/tests/test_db_agent.py b/eea/usersdb/tests/test_db_agent.py index 9ec7c1b..62da632 100644 --- a/eea/usersdb/tests/test_db_agent.py +++ b/eea/usersdb/tests/test_db_agent.py @@ -5,9 +5,9 @@ import unittest from copy import deepcopy -from mock import Mock import six from six.moves import map +from mock import Mock import ldap from eea.usersdb import db_agent from eea.usersdb.tests.mock_recorder import Recorder diff --git a/eea/usersdb/version.txt b/eea/usersdb/version.txt index 5154b3f..1effb00 100644 --- a/eea/usersdb/version.txt +++ b/eea/usersdb/version.txt @@ -1 +1 @@ -2.6 +2.7