Merge "Update docs with missing cloud config params"
authorAndrew Grimberg <agrimberg@linuxfoundation.org>
Fri, 31 Jan 2020 20:25:53 +0000 (20:25 +0000)
committerGerrit Code Review <gerrit@linuxfoundation.org>
Fri, 31 Jan 2020 20:25:53 +0000 (20:25 +0000)
docs/jjb/lf-release-jobs.rst
jjb/lf-python-jobs.yaml
jjb/lf-release-jobs.yaml
releasenotes/notes/lf-rtdv3-jobs-5fda8e30d8f3e5ed.yaml [new file with mode: 0644]
releasenotes/notes/python-merge-gerrit-choosing-strategy-4d9c631e8f0c535b.yaml [new file with mode: 0644]
shell/jenkins-configure-clouds.sh
shell/rtdv3.sh

index 5966cd6..2ddc6ee 100644 (file)
@@ -279,6 +279,10 @@ Release Merge
 
 This template supports Maven and Container release jobs.
 
+This template uses a git commit choosing strategy that builds the merged
+commit with the release yaml file, not the tip of the target branch, so
+projects can repeat the release action in case of merge job failure.
+
 :Template Name: {project-name}-release-merge
 
 :Comment Trigger: remerge
@@ -349,6 +353,10 @@ artifacts to the PyPI release repository, tags the git repository,
 signs the tag and pushes the tag to the git server. The release merge
 template accepts neither a branch nor a stream parameter.
 
+These templates use a git commit choosing strategy that builds the merged
+commit with the release yaml file, not the tip of the target branch, so
+projects can repeat the release action in case of merge job failure.
+
 :Template Names:
 
     - {project-name}-pypi-release-merge
@@ -431,7 +439,9 @@ verify template accepts neither a branch nor a stream parameter.
 PackageCloud Release Verify
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-This template supports PackageCloud release jobs.
+This template supports PackageCloud release jobs. Checks that the specified
+packages are present in the staging repository and absent from the release
+repository.
 
 :Template Name: {project-name}-packagecloud-release-verify
 
@@ -465,7 +475,12 @@ This template supports PackageCloud release jobs.
 PackageCloud Release Merge
 ~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-This template supports PackageCloud release jobs.
+This template supports PackageCloud release jobs.  Promotes the specified
+packages from the staging repository to the release repository.
+
+This template uses a git commit choosing strategy that builds the merged
+commit with the release yaml file, not the tip of the target branch, so
+projects can repeat the release action in case of merge job failure.
 
 :template name: {project-name}-packagecloud-release-merge
 
index 1b7c63a..d215a67 100644 (file)
           submodule-recursive: "{submodule-recursive}"
           submodule-timeout: "{submodule-timeout}"
           submodule-disable: "{submodule-disable}"
-          choosing-strategy: gerrit
+          # merge jobs always build from tip
+          choosing-strategy: default
 
     triggers:
       - gerrit:
           submodule-recursive: "{submodule-recursive}"
           submodule-timeout: "{submodule-timeout}"
           submodule-disable: "{submodule-disable}"
-          choosing-strategy: gerrit
+          # merge jobs always build from tip
+          choosing-strategy: default
 
     triggers:
       - timed: "{obj:cron}"
index b95ffe8..398a53e 100644 (file)
           submodule-disable: true
           submodule-recursive: false
           submodule-timeout: 10
+          # release merge jobs build from commit not tip
           choosing-strategy: gerrit
 
     triggers:
           submodule-recursive: "{submodule-recursive}"
           submodule-timeout: "{submodule-timeout}"
           submodule-disable: "{submodule-disable}"
+          # release merge jobs build from commit not tip
           choosing-strategy: gerrit
 
     triggers:
           submodule-disable: true
           submodule-recursive: false
           submodule-timeout: 10
+          # release merge jobs build from commit not tip
           choosing-strategy: gerrit
 
     triggers:
diff --git a/releasenotes/notes/lf-rtdv3-jobs-5fda8e30d8f3e5ed.yaml b/releasenotes/notes/lf-rtdv3-jobs-5fda8e30d8f3e5ed.yaml
new file mode 100644 (file)
index 0000000..c52053d
--- /dev/null
@@ -0,0 +1,10 @@
+---
+fixes:
+  - |
+    Branch discovery and build polling implemented.
+    If a Branch has not been seen by rtd
+    we trigger a build with rtd and poll till that build
+    is complete.
+    we can then enable the branch and trigger a build
+    against it, again polling all builds untill they are
+    complete.
diff --git a/releasenotes/notes/python-merge-gerrit-choosing-strategy-4d9c631e8f0c535b.yaml b/releasenotes/notes/python-merge-gerrit-choosing-strategy-4d9c631e8f0c535b.yaml
new file mode 100644 (file)
index 0000000..b436d98
--- /dev/null
@@ -0,0 +1,19 @@
+---
+fixes:
+  - |
+    Use git choosing strategy default in tox and pypi merge jobs for
+    gerrit.  This makes those jobs consistent with maven and other
+    merge jobs for gerrit that always build from tip of the target
+    branch to create artifacts from the latest & greatest code.
+    Building from tip (not from Gerrit commit/merge point) avoids
+    confusion about content when changes are merged out of order.
+    For example, a fix is submitted and merged, but the merge job
+    fails. In the mean time, a different change that happened
+    earlier in commit history gets merged (or the merge job is
+    retriggered), causing a new artifact to be pushed.  But that
+    artifact does not have the expected fix.
+
+    Add comments to release merge jobs why their choosing strategy
+    is not default.
+
+    Document the git commit choosing strategy for the release merge jobs.
index 5d394ad..78e233e 100644 (file)
@@ -211,7 +211,7 @@ get_minion_options() {
     kpn_default="$(get_cfg "$(dirname "$cfg_file")/cloud.cfg" KEY_PAIR_NAME "jenkins-ssh")"
     key_pair_name=$(get_cfg "$cfg_file" KEY_PAIR_NAME "$kpn_default")
     num_executors=$(get_cfg "$cfg_file" NUM_EXECUTORS "1")
-    jvm_options=$(get_cfg "$cfg_file" JVM_OPTIONS "null")
+    jvm_options=$(get_cfg "$cfg_file" JVM_OPTIONS "")
     fs_root=$(get_cfg "$cfg_file" FS_ROOT "/w")
     connection_type=$(get_cfg "$cfg_file" CONNECTION_TYPE "SSH")
     launcher_factory=$(get_launcher_factory "$connection_type")
index 29808af..7b4fef8 100644 (file)
 echo "---> rtdv3.sh"
 set -euo pipefail
 
+watchbuild(){
+  echo "INFO: Running build against branch $1"
+  local buildid
+  local result
+  buildid=$(lftools rtd project-build-trigger "$rtdproject" "$1" | jq '.build.id')
+
+  result=null
+  while [ $result == null ]; do
+    sleep 10
+    result=$(lftools rtd project-build-details "$rtdproject" "$buildid"  | jq '.success')
+    echo "INFO Current result of running build $result"
+    if [[ $result == failed ]]; then
+      echo "INFO: read the docs build completed with status: $result"
+      exit 1
+    fi
+  done
+  echo "INFO: read the docs build completed with status: $result"
+}
+
 project_dashed="${PROJECT////-}"
 umbrella=$(echo "$GERRIT_URL" | awk -F'.' '{print $2}')
 if [[ "$SILO" == "sandbox" ]]; then
@@ -102,12 +121,31 @@ echo "INFO: Performing merge action"
     lftools rtd project-update "$rtdproject" default_version="$default_version"
   fi
 
-  lftools rtd project-build-trigger "$rtdproject" "$GERRIT_BRANCH"
   if [[ $GERRIT_BRANCH == "master" ]]; then
-    echo "INFO: triggering latest"
-    lftools rtd project-build-trigger "$rtdproject" latest
+    echo "INFO: triggering $rtdproject latest"
+    watchbuild latest
   else
-    echo "INFO: triggering stable"
-    lftools rtd project-build-trigger "$rtdproject" stable
+
+    #read the docs only understands lower case branch names
+    branch=$(echo "$GERRIT_BRANCH" | tr '[:upper:]' '[:lower:]')
+    echo "INFO: Checking if read the docs has seen branch $branch"
+
+    #if this is 404. then run discover branch
+    if ! lftools rtd project-version-details "$rtdproject" "$branch" | jq '.active'; then
+      echo "INFO: read the docs has not seen branch $branch for project $rtdproject"
+      echo "INFO: triggering $rtdproject latest to instantiate new branch discovery"
+      watchbuild latest
+    fi
+
+    echo "INFO: triggering $rtdproject $branch"
+    watchbuild "$branch"
+
+    #Make newly discovered branches visible in the u/i
+    isactive=$(lftools rtd project-version-details "$rtdproject" "$branch" | jq '.active')
+    if [[ "$isactive" == false ]]; then
+      echo "INFO: Marking $branch as active for project $rtdproject"
+      lftools rtd project-version-update "$rtdproject" "$branch" true
+    fi
+
   fi
 fi