Merge "Upgrade pre-commit hook repos to latest"
authorAnil Belur <abelur@linuxfoundation.org>
Thu, 23 Jan 2020 00:19:26 +0000 (00:19 +0000)
committerGerrit Code Review <gerrit@linuxfoundation.org>
Thu, 23 Jan 2020 00:19:26 +0000 (00:19 +0000)
15 files changed:
docs/jjb/lf-python-jobs.rst
jjb/lf-ci-jobs.yaml
jjb/lf-macros.yaml
jjb/lf-python-jobs.yaml
releasenotes/notes/ignore-staging-repo-565069d9ab316adc.yaml [new file with mode: 0644]
releasenotes/notes/maven-javadoc-dash-f-87c652e0363b3c6d.yaml [new file with mode: 0644]
releasenotes/notes/tox-sonar-mvn-params-3d81e313676816c8.yaml [new file with mode: 0644]
releasenotes/notes/update-jjb-deploy-job-0802fb0d7e47726d.yaml [new file with mode: 0644]
shell/check-info-votes.sh
shell/jjb-deploy-job.sh
shell/job-cost.sh
shell/maven-javadoc-generate.sh
shell/python-tools-install.sh
shell/rtd-verify.sh
shell/tox-install.sh

index c179366..117ab38 100644 (file)
@@ -369,12 +369,17 @@ paths. For example, a PyPI merge job should not run on a non-Python
 file change such as documentation, because the job cannot upload the
 same package twice.
 
+To make the document files available for building a Python package
+long description in setup.py, add a symbolic link "docs" in the
+package subdirectory pointing to the top-level docs directory.
+
 .. code-block:: bash
 
     git-repo-name/
     │
     ├── docs/
-    │   └── index.rst
+    │   ├── index.rst
+    │   └── release-notes.rst
     │
     ├── helloworld-package/
     │   │
@@ -399,10 +404,10 @@ same package twice.
     └── README.md
 
 
-Use of these templates requires a .pypirc configuration file in the
-Jenkins builder home directory. An example appears next that uses API
-tokens. Note that in the [pypi] entry the repository key-value pair is
-optional, it defaults to pypi.org.
+Jobs built from the PyPI templates depend on a .pypirc configuration file
+in the Jenkins builder home directory. An example appears next that uses
+API tokens. Note that in the [pypi] entry the repository key-value pair
+is optional, it defaults to pypi.org.
 
 .. code-block:: bash
 
@@ -434,6 +439,7 @@ optional, it defaults to pypi.org.
     :build-node: The node to run the build on.
     :jenkins-ssh-credential: Credential to use for SSH. (Generally set
         in defaults.yaml)
+    :mvn-settings: The settings file with credentials for the project
     :project: Git repository name
     :project-name: Jenkins job name prefix
 
@@ -448,6 +454,9 @@ optional, it defaults to pypi.org.
     :disable-job: Whether to disable the job (default: false)
     :dist-binary: Whether to build a binary wheel distribution. (default: true)
     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
+    :mvn-opts: Sets MAVEN_OPTS to start up the JVM running Maven. (default: '')
+    :mvn-params: Parameters to pass to the mvn CLI. (default: '')
+    :mvn-version: Version of maven to use. (default: mvn35)
     :parallel: Boolean indicator for tox to run tests in parallel or series.
        (default: false, in series)
     :pre-build-script: Shell script to execute before the tox builder. For
@@ -507,6 +516,7 @@ pyenv variables before running.
     :build-node: The node to run the build on.
     :jenkins-ssh-credential: Credential to use for SSH. (Generally set
         in defaults.yaml)
+    :mvn-settings: The settings file with credentials for the project
     :project: Git repository name
     :project-name: Jenkins job name prefix
 
@@ -518,6 +528,9 @@ pyenv variables before running.
     :disable-job: Whether to disable the job (default: false)
     :dist-binary: Whether to build a binary wheel distribution. (default: true)
     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
+    :mvn-opts: Sets MAVEN_OPTS to start up the JVM running Maven. (default: '')
+    :mvn-params: Parameters to pass to the mvn CLI. (default: '')
+    :mvn-version: Version of maven to use. (default: mvn35)
     :parallel: Boolean indicator for tox to run tests in parallel or series.
        (default: false, in series)
     :pre-build-script: Shell script to execute before the tox builder. For
index 701898c..59045b6 100644 (file)
           jenkins-ssh-credential: "{jenkins-ssh-credential}"
 
     builders:
-      - lf-pip-install:
-          pip-packages: jenkins-job-builder
       - lf-infra-jjbini
       - shell: !include-raw-escape: ../shell/jjb-deploy-job.sh
 
index 6d192bf..8961184 100644 (file)
             - file-id: "{settings-file}"
               variable: "SETTINGS_FILE"
 
-- builder:
-    name: lf-pip-install
-    builders:
-      - inject:
-          properties-content: PIP_PACKAGES={pip-packages}
-      - shell: !include-raw-escape: ../shell/pip-install.sh
-
 - builder:
     name: lf-provide-maven-settings-cleanup
     builders:
index fe06d71..1b7c63a 100644 (file)
 #########################
 
 - lf_tox_sonar: &lf_tox_sonar
-    name: lf-tox_sonar
+    name: lf-tox-sonar
 
     ######################
     # Default parameters #
     java-version: openjdk8
     mvn-global-settings: global-settings
     mvn-goals: validate
+    mvn-opts: ""
+    mvn-params: ""
     mvn-settings: "{mvn-settings}"
     mvn-version: mvn35
     parallel: true
           project: "{project}"
           branch: "{branch}"
           stream: "{stream}"
+      - lf-infra-maven-parameters:
+          mvn-opts: "{mvn-opts}"
+          mvn-params: "{mvn-params}"
+          mvn-version: "{mvn-version}"
       - lf-infra-tox-parameters:
           tox-dir: "{tox-dir}"
           tox-envs: "{tox-envs}"
diff --git a/releasenotes/notes/ignore-staging-repo-565069d9ab316adc.yaml b/releasenotes/notes/ignore-staging-repo-565069d9ab316adc.yaml
new file mode 100644 (file)
index 0000000..7d32caa
--- /dev/null
@@ -0,0 +1,7 @@
+---
+fixes:
+  - |
+    Disable the pip install warning that are not useful in the console logs.
+
+    00:25:10   WARNING: The scripts easy_install and easy_install-3.6 are installed in '/home/jenkins/.local/bin' which is not on PATH.
+    00:25:10   Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
diff --git a/releasenotes/notes/maven-javadoc-dash-f-87c652e0363b3c6d.yaml b/releasenotes/notes/maven-javadoc-dash-f-87c652e0363b3c6d.yaml
new file mode 100644 (file)
index 0000000..bb3e5ce
--- /dev/null
@@ -0,0 +1,7 @@
+---
+fixes:
+  - |
+    Revise shell script maven-javadoc-generate.sh to supply -f
+    argument to maven with argument translated by call to readlink.
+    This works around the javadoc:aggregate behavior of silently
+    doing nothing if invoked "-f ."
diff --git a/releasenotes/notes/tox-sonar-mvn-params-3d81e313676816c8.yaml b/releasenotes/notes/tox-sonar-mvn-params-3d81e313676816c8.yaml
new file mode 100644 (file)
index 0000000..1e88681
--- /dev/null
@@ -0,0 +1,11 @@
+---
+fixes:
+  - |
+    Extend macro lf_tox_sonar with parameters macro lf-infra-maven-parameters
+    so job definitions can configure mvn-opts, mvn-params and mvn-version
+    values. Default values are defined so existing jobs are not affected.
+    This change makes the python-tox sonar template consistent with the
+    maven sonar template.
+
+    Extend the PyPI package structure recommendation with a way to share
+    the docs/ folder.
diff --git a/releasenotes/notes/update-jjb-deploy-job-0802fb0d7e47726d.yaml b/releasenotes/notes/update-jjb-deploy-job-0802fb0d7e47726d.yaml
new file mode 100644 (file)
index 0000000..c3a05e8
--- /dev/null
@@ -0,0 +1,11 @@
+---
+fixes:
+  - |
+    The jjb-deploy-job.sh was 'activating' a venv that was created by
+    pip-install.sh in /tmp/v. This venv was based on python2. Now
+    jjb-deploy-job.sh calls lf-activate-venv() to install jenkins-jobs in a
+    venv based on python3.
+upgrade:
+  - |
+    The lf-pip-install builder macro has been deleted. At some point we will
+    also be deleting shell/pip-install.sh.
index 32384be..fb489af 100644 (file)
@@ -36,10 +36,10 @@ if [ -d "/opt/pyenv" ]; then
     export PYENV_VERSION="3.6.4"
 fi
 
-$pip install --user niet
-$pip install --user lftools
-$pip install --user lftools[nexus]
-$pip install --user jsonschema
+$pip install niet
+$pip install lftools
+$pip install lftools[nexus]
+$pip install jsonschema
 
 echo "Checking votes:"
 lftools infofile check-votes INFO.yaml "$GERRIT_URL" "$ref" > gerrit_comment.txt
index 5efb9f4..152a02e 100644 (file)
 echo "---> jjb-deploy-job.sh"
 
 # Ensure we fail the job if any steps fail.
-set -e -o pipefail
+set -uef -o pipefail
 
-# shellcheck source=/tmp/v/jenkins-job-builder/bin/activate disable=SC1091
-source "/tmp/v/jenkins-job-builder/bin/activate"
+# shellcheck disable=SC1090
+source ~/lf-env.sh
+
+# Version controlled by JJB_VERSION
+lf-activate-venv jenkins-job-builder
 
 # Fetch patch if gerrit project matches the jjb-deploy project
 if [ "${GERRIT_PROJECT}" == "${PROJECT}" ]; then
index 6493a6e..5bd61be 100644 (file)
@@ -47,10 +47,10 @@ instance_type=$(curl -s http://169.254.169.254/latest/meta-data/instance-type)
 
 echo "INFO: Retrieving Pricing Info for: $instance_type"
 url="https://pricing.vexxhost.net/v1/pricing/$instance_type/cost?seconds=$uptime"
-jason_block=$(curl -s "$url")
+json_block=$(curl -s "$url")
 
-cost=$(jq .cost <<< "$jason_block")
-resource=$(jq .resource <<< "$jason_block" | tr -d '"')
+cost=$(jq .cost <<< "$json_block")
+resource=$(jq .resource <<< "$json_block" | tr -d '"')
 
 # Archive the cost date
 mkdir -p "$WORKSPACE/archives/cost"
index 137f4d7..4a66eec 100644 (file)
@@ -21,19 +21,23 @@ mkdir -p "$WORKSPACE/archives"
 
 export MAVEN_OPTS
 
+# use absolute path as workaround for javadoc:aggregate
+# silent failure on relative path, for example "-f ."
+maven_dir_abs=$(readlink -f "$MAVEN_DIR")
+
 # Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters.
 # shellcheck disable=SC2086
 # Use -x via subshell to show maven invocation details in the log
 (set -x
   $MVN clean install javadoc:aggregate \
+    -f "$maven_dir_abs" \
     -e -Pq -Dmaven.javadoc.skip=false \
     -DskipTests=true \
     -Dcheckstyle.skip=true \
     -Dfindbugs.skip=true \
     --global-settings "$GLOBAL_SETTINGS_FILE" \
     --settings "$SETTINGS_FILE" \
-    -f "$MAVEN_DIR" \
-    $MAVEN_OPTIONS $MAVEN_PARAMS \
+    $MAVEN_OPTIONS $MAVEN_PARAMS
 )
 
 mv "$WORKSPACE/$MAVEN_DIR/target/site/apidocs" "$JAVADOC_DIR"
index b908e17..7988c31 100644 (file)
@@ -35,9 +35,9 @@ EOF
 
     # Use `python -m pip` to ensure we are using pip from user venv
     python3 -m venv ~/.local
-    python3 -m pip install --user --quiet --upgrade pip
-    python3 -m pip install --user --quiet --upgrade setuptools
-    python3 -m pip install --user --quiet --upgrade --upgrade-strategy eager -r "$requirements_file"
+    python3 -m pip install --quiet --upgrade pip
+    python3 -m pip install --quiet --no-warn-script-location --upgrade setuptools
+    python3 -m pip install --quiet --no-warn-script-location --upgrade --upgrade-strategy eager -r "$requirements_file"
     rm -rf "$requirements_file"
     touch /tmp/pre-build-complete
 fi
index 86254a1..ea3aca7 100644 (file)
@@ -32,7 +32,7 @@ git submodule update
 
 if [[ $JOB_NAME == "lf-infra-lftools-rtd-verify-any" ]]; then
     # Install patchset lftools
-    python3 -m pip install --user -e .
+    python3 -m pip install -e .
 fi
 
 echo "---> Generating docs"
index f8472cc..d88c508 100644 (file)
@@ -18,9 +18,9 @@ set -eux -o pipefail
 
 
 if [[ $PYTHON == "python2" ]]; then
-    $PYTHON -m pip install --user --quiet --upgrade tox tox-pyenv virtualenv more-itertools~=5.0.0
+    $PYTHON -m pip install --quiet --upgrade tox tox-pyenv virtualenv more-itertools~=5.0.0
 else
-    $PYTHON -m pip install --user --quiet --upgrade tox tox-pyenv virtualenv
+    $PYTHON -m pip install --quiet --upgrade tox tox-pyenv virtualenv
 fi