Feat!: Update JJB version to 6x 47/137147/2
authorAnil Belur <abelur@linuxfoundation.org>
Wed, 7 Feb 2024 03:05:28 +0000 (13:05 +1000)
committerAnil Belur <abelur@linuxfoundation.org>
Wed, 7 Feb 2024 09:43:51 +0000 (19:43 +1000)
Jenkins Job Builder 6.0.0 is released and breaks backward
compatibility with 5.1.0.

The breaking changes with previous 5.1.0 release:

- Jobs are now expanded the same way as job templates.
- Macros without parameters are now expanded the same way as macros
  with parameters.
- Tags !include-raw: and !include-raw-escape: should now be used the
  same way in jobs and macros without parameters as they are used in
  job templates and macros with parameters.
- Update pre-commit dependencies

Ref:
https://storyboard.openstack.org/#!/story/2010963
https://storyboard.openstack.org/#!/story/2010588

NOTE: Set the var "JJB_VERSION" to "6.0.0" at the GH orginazation
level for GHA JJB Verify to pick up the latest version of JJB.

Issue-ID: CIMAN-33 LF-JIRA RELENG-5131
Change-Id: Icdeecb8bf216ceab4c5af5720f3bd89d3ef2621d
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
.pre-commit-config.yaml
global-jjb
jjb/integration/integration-macros.yaml
jjb/integration/netconf-pnp-simulator-verify.sh
tox.ini

index ca94141..497c634 100644 (file)
@@ -1,7 +1,7 @@
 ---
 repos:
   - repo: https://github.com/pre-commit/pre-commit-hooks
-    rev: v4.4.0
+    rev: v4.5.0
     hooks:
       - id: trailing-whitespace
       - id: check-executables-have-shebangs
@@ -21,12 +21,12 @@ repos:
       - id: gitlint
 
   - repo: https://github.com/adrienverge/yamllint.git
-    rev: v1.31.0
+    rev: v1.34.0
     hooks:
       - id: yamllint
 
   - repo: https://github.com/pre-commit/mirrors-prettier
-    rev: v3.0.0-alpha.9-for-vscode
+    rev: v4.0.0-alpha.8
     hooks:
       - id: prettier
         stages: [commit]
index 766dbef..5d33657 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 766dbef8a63d824d6e551d4f179806521be95d13
+Subproject commit 5d336574e77fb349ace15356ef8ffb816d463544
index 5e90999..a101a71 100644 (file)
@@ -40,7 +40,7 @@
 - builder:
     name: integration-install-robotframework-py3
     builders:
-      - shell: !include-raw:
+      - shell: !include-raw-escape:
           - include-raw-integration-install-robotframework-py3.sh
 
 - builder:
     builders:
       - shell: |
           git clone https://gerrit.onap.org/r/ci-management /tmp/ci-management
-          cp /tmp/ci-management/jjb/integration/*csit.sh ${WORKSPACE}
-          ${WORKSPACE}/run-csit.sh ${TESTPLAN} ${TESTOPTIONS}
+          cp /tmp/ci-management/jjb/integration/*csit.sh "$WORKSPACE"
+          "$WORKSPACE/run-csit.sh" "$TESTPLAN" "$TESTOPTIONS"
 
 - builder:
     name: integration-run-project-test
     builders:
-      - shell: "${WORKSPACE}/csit/run-project-csit.sh ${TESTOPTIONS}"
+      - shell: "$WORKSPACE/csit/run-project-csit.sh $TESTOPTIONS"
 
 - builder:
     name: integration-autorelease-fix-relativepaths
index 28e8ae3..6617f70 100644 (file)
@@ -25,7 +25,7 @@ DOCKER_COMPOSE_LOG="/tmp/docker-compose.log"
 DOCKER_COMPOSE_LOG_MSG=( "success:" "entered RUNNING state" )
 DOCKER_COMPOSE_SLEEP_INTERVAL=60
 
-if [ -z ${NETCONF_SIM_SERVICE_NAME} ];
+if [ -z "$NETCONF_SIM_SERVICE_NAME" ];
 then
     echo "ERROR: netconf-pnp-simulator service name not set."
     exit 1
@@ -34,17 +34,17 @@ fi
 pushd $DOCKER_ROOT
 
 # Dump container logs
-sleep ${DOCKER_COMPOSE_SLEEP_INTERVAL} # Hang for a while so the services settle
-docker-compose logs --no-color > ${DOCKER_COMPOSE_LOG}
+sleep "$DOCKER_COMPOSE_SLEEP_INTERVAL" # Hang for a while so the services settle
+docker-compose logs --no-color > "$DOCKER_COMPOSE_LOG"
 
 # Get the supervisord services running within container
-supervisord_services=($(docker-compose exec -T ${NETCONF_SIM_SERVICE_NAME} /bin/sh -c \
+supervisord_services=($(docker-compose exec -T "$NETCONF_SIM_SERVICE_NAME" /bin/sh -c \
     'cat /etc/supervisord.conf /etc/supervisord.d/*' | grep -ho "program:[-a-zA-Z0-9]*" | cut -d: -f 2))
 
 # Check all services are running and fail if not
-for service in ${supervisord_services[@]};
+for service in "${{supervisord_services[@]}}";
 do
-    if ! grep -q "${DOCKER_COMPOSE_LOG_MSG[0]} $service ${DOCKER_COMPOSE_LOG_MSG[1]}" ${DOCKER_COMPOSE_LOG};
+    if ! grep -q "${{DOCKER_COMPOSE_LOG_MSG[0]}} $service ${{DOCKER_COMPOSE_LOG_MSG[1]}}" "$DOCKER_COMPOSE_LOG";
     then
         echo "ERROR: Service $service is not running, failing the build."
         exit 1
diff --git a/tox.ini b/tox.ini
index a880440..fc81f92 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -1,13 +1,38 @@
 [tox]
 minversion = 1.6
-envlist = coala
+envlist = jjb-version
 skipsdist = true
 
-[testenv:coala]
-basepython = python3
+[testenv:jenkins-jobs]
 deps =
-    coala
-    coala-bears
+    jenkins-job-builder=={env:JJB_VERSION:6.0.0}
+commands =
+    jenkins-jobs {posargs:--help}
+
+[testenv:jjb-version]
+commands = python {toxinidir}/check_jjb_version.py
+
+[testenv:pre-commit-install]
+basepython = python3
+deps = pre-commit
+commands =
+    pre-commit install
+    pre-commit install --hook-type commit-msg
+
+[testenv:pre-commit-uninstall]
+basepython = python3
+deps = pre-commit
+commands =
+    pre-commit uninstall
+    pre-commit uninstall --hook-type commit-msg
+
+[testenv:pre-commit]
+basepython = python3
+deps = pre-commit
+passenv = HOME
 commands =
-    python3 -m nltk.downloader punkt maxent_treebank_pos_tagger averaged_perceptron_tagger
-    coala --non-interactive
+    pre-commit run --all-files --show-diff-on-failure
+    pre-commit run gitlint --hook-stage commit-msg --commit-msg-filename .git/COMMIT_EDITMSG
+    # Gitlint only proposes a pre-commit configuration for the commit-msg stage but none for the commit stage.
+    # Its default arguments --passed and --msg-filename are different from CI recommandations.
+    # As a result, the line above is always skipped in jenkins CI since there cannot be a .git/COMMIT_EDITMSG file.