gazebo-tooling / release-tools

8 stars 9 forks source link

Change output in release.py to be more user friendly #1074

Closed j-rivero closed 7 months ago

j-rivero commented 7 months ago

Different actions in this PR to be able to produce a more user friendly output to check what the tool is doing during the execution and how to follow the Jenkins jobs triggered.

  1. Start by introducing an environment variable called _RELEASEPY_DEBUG to keep the output as it is now, useful for development. Simplify output for the user on releasing 02ad57cb23cb880b6ef997c557bdd9f6738e5daa (helps to avoid calling the job twice, happened to @mjcarroll).
  2. Help the to display the job chain triggered when calling the release in the current usual mode (generate source in Jenkins). The displayed URL is able to include a search string in the build history to locate the generated builds easier (the tool can not know the exact URL of the generated build) .
  3. Generalize the search string help to brew and -debbuilders (each of them use a different string schema in the job description :sweat:). Note that there is a limitation in the -debbuidlers given how seems to work the search inbox.

How look the before and now:

Note: links for the gz-utils2 example should work with the exception of the `repository_packages_uploader' that already removed it due to rotation.

calling source generation

❯ ~/code/release-tools/release.py --dry-run gz-utils2 2.2.0 foo

CURRENT

Running:
  git ls-remote -q --exit-code https://github.com/gazebo-release/gz-utils2-release
Running:
  git ls-remote --exit-code --heads https://github.com/gazebo-release/gz-utils2-release main
Running:
  git clone -b main https://github.com/gazebo-release/gz-utils2-release /tmp/tmpy1rgk7cm
Distributions in release-repo:
- focal (amd64, armhf, arm64)
- jammy (amd64, armhf, arm64)
Safety checks:
 + OK No underscore in package name
Running:
  find /tmp/tmpy1rgk7cm -name changelog -exec head -n 1 {} ;
Running:
  find /tmp/tmpy1rgk7cm -name control -exec grep -H Source: {} ;
 + OK Package names in changelog and control
Running:
  find /tmp/tmpy1rgk7cm -name changelog -exec head -n 1 {} ;
 + OK Package versions in changelog
 + OK Package release versions in changelog
 + OK sdformat version in proper sdformat package
Running:
  git ls-remote --get-url origin
INFO: no --source-repo-existing-ref used, tag the localrepository as the reference for the source code of therelease
Dry-run running:
  git tag -f gz-utils2_2.2.0

Dry-run running:
  git push --tags

- Source: http://build.osrfoundation.org/job/gz-utils2-source/buildWithParameters?SOURCE_REPO_URI=https%3A%2F%2Fgithub.com%2Fgazebosim%2Fgz-utils.git&token=foo&PACKAGE=gz-utils2&VERSION=2.2.0&RELEASE_REPO_BRANCH=main&PACKAGE_ALIAS=gz-utils2&RELEASE_VERSION=1&UPLOAD_TO_REPO=stable&OSRF_REPOS_TO_USE=stable+stable&LINUX_DISTRO=ubuntu&DISTRO=focal&SOURCE_REPO_REF=gz-utils2_2.2.0

NEW

Downloading releasing info for gz-utils2
Linux distributions in the -release repository:
 + focal  ('amd64', 'armhf', 'arm64')
 + jammy  ('amd64', 'armhf', 'arm64')
Safety checks:
 + OK No underscore in package name
 + OK Package names in changelog and control
 + OK Package versions in changelog
 + OK Package release versions in changelog
 + OK sdformat version in proper sdformat package
Triggering release jobs:
 * INFO: no --source-repo-existing-ref used, tag the local repository as the reference for the source code of the release
 + Releasing Source in http://build.osrfoundation.org/job/gz-utils2-source?$search=2.2.0
    INFO: After the source job finished, the release process will trigger:
      * Source upload:http://build.osrfoundation.org/job/repository_uploader_packages/?search=gz-utils2+2.2.0
      * Builders using release.py --source-tarball-uri:http://build.osrfoundation.org/job/_releasepy/?search=gz-utils2%2F2.2.0-1

Calling builders directly with --source-tarball-url:

❯ ~/code/release-tools/release.py --dry-run gz-utils2 2.2.0 foo --source-tarball-uri https://foo/lalla.tar.gz

CURRENT

Running:
  git ls-remote -q --exit-code https://github.com/gazebo-release/gz-utils2-release
Running:
  git ls-remote --exit-code --heads https://github.com/gazebo-release/gz-utils2-release main
Running:
  git clone -b main https://github.com/gazebo-release/gz-utils2-release /tmp/tmpq0k8b0mt
Distributions in release-repo:
- focal (amd64, armhf, arm64)
- jammy (amd64, armhf, arm64)
Safety checks:
 + OK No underscore in package name
Running:
  find /tmp/tmpq0k8b0mt -name changelog -exec head -n 1 {} ;
Running:
  find /tmp/tmpq0k8b0mt -name control -exec grep -H Source: {} ;
 + OK Package names in changelog and control
Running:
  find /tmp/tmpq0k8b0mt -name changelog -exec head -n 1 {} ;
 + OK Package versions in changelog
 + OK Package release versions in changelog
 + OK sdformat version in proper sdformat package
- Brew: http://build.osrfoundation.org/job/generic-release-homebrew_pull_request_updater/buildWithParameters?SOURCE_TARBALL_URI=https%3A%2F%2Ffoo%2Flalla.tar.gz&token=foo&PACKAGE=gz-utils2&VERSION=2.2.0&RELEASE_REPO_BRANCH=main&PACKAGE_ALIAS=gz-utils2&RELEASE_VERSION=1&UPLOAD_TO_REPO=stable&OSRF_REPOS_TO_USE=stable+stable
- ubuntu focal/amd64: http://build.osrfoundation.org/job/gz-utils2-debbuilder/buildWithParameters?SOURCE_TARBALL_URI=https%3A%2F%2Ffoo%2Flalla.tar.gz&token=foo&PACKAGE=gz-utils2&VERSION=2.2.0&RELEASE_REPO_BRANCH=main&PACKAGE_ALIAS=gz-utils2&RELEASE_VERSION=1&UPLOAD_TO_REPO=stable&OSRF_REPOS_TO_USE=stable+stable&ARCH=amd64&LINUX_DISTRO=ubuntu&DISTRO=focal
- ubuntu focal/armhf: http://build.osrfoundation.org/job/gz-utils2-debbuilder/buildWithParameters?SOURCE_TARBALL_URI=https%3A%2F%2Ffoo%2Flalla.tar.gz&token=foo&PACKAGE=gz-utils2&VERSION=2.2.0&RELEASE_REPO_BRANCH=main&PACKAGE_ALIAS=gz-utils2&RELEASE_VERSION=1&UPLOAD_TO_REPO=stable&OSRF_REPOS_TO_USE=stable+stable&ARCH=armhf&LINUX_DISTRO=ubuntu&DISTRO=focal&JENKINS_NODE_TAG=linux-armhf
- ubuntu focal/arm64: http://build.osrfoundation.org/job/gz-utils2-debbuilder/buildWithParameters?SOURCE_TARBALL_URI=https%3A%2F%2Ffoo%2Flalla.tar.gz&token=foo&PACKAGE=gz-utils2&VERSION=2.2.0&RELEASE_REPO_BRANCH=main&PACKAGE_ALIAS=gz-utils2&RELEASE_VERSION=1&UPLOAD_TO_REPO=stable&OSRF_REPOS_TO_USE=stable+stable&ARCH=arm64&LINUX_DISTRO=ubuntu&DISTRO=focal&JENKINS_NODE_TAG=linux-arm64
- ubuntu jammy/amd64: http://build.osrfoundation.org/job/gz-utils2-debbuilder/buildWithParameters?SOURCE_TARBALL_URI=https%3A%2F%2Ffoo%2Flalla.tar.gz&token=foo&PACKAGE=gz-utils2&VERSION=2.2.0&RELEASE_REPO_BRANCH=main&PACKAGE_ALIAS=gz-utils2&RELEASE_VERSION=1&UPLOAD_TO_REPO=stable&OSRF_REPOS_TO_USE=stable+stable&ARCH=amd64&LINUX_DISTRO=ubuntu&DISTRO=jammy
- ubuntu jammy/armhf: http://build.osrfoundation.org/job/gz-utils2-debbuilder/buildWithParameters?SOURCE_TARBALL_URI=https%3A%2F%2Ffoo%2Flalla.tar.gz&token=foo&PACKAGE=gz-utils2&VERSION=2.2.0&RELEASE_REPO_BRANCH=main&PACKAGE_ALIAS=gz-utils2&RELEASE_VERSION=1&UPLOAD_TO_REPO=stable&OSRF_REPOS_TO_USE=stable+stable&ARCH=armhf&LINUX_DISTRO=ubuntu&DISTRO=jammy&JENKINS_NODE_TAG=linux-armhf
- ubuntu jammy/arm64: http://build.osrfoundation.org/job/gz-utils2-debbuilder/buildWithParameters?SOURCE_TARBALL_URI=https%3A%2F%2Ffoo%2Flalla.tar.gz&token=foo&PACKAGE=gz-utils2&VERSION=2.2.0&RELEASE_REPO_BRANCH=main&PACKAGE_ALIAS=gz-utils2&RELEASE_VERSION=1&UPLOAD_TO_REPO=stable&OSRF_REPOS_TO_USE=stable+stable&ARCH=arm64&LINUX_DISTRO=ubuntu&DISTRO=jammy&JENKINS_NODE_TAG=linux-arm64

NEW

Downloading releasing info for gz-utils2
Linux distributions in the -release repository:
 + focal  ('amd64', 'armhf', 'arm64')
 + jammy  ('amd64', 'armhf', 'arm64')
Safety checks:
 + OK No underscore in package name
 + OK Package names in changelog and control
 + OK Package versions in changelog
 + OK Package release versions in changelog
 + OK sdformat version in proper sdformat package
Simulation of jobs to be called if not dry-run:
 + Releasing Brew in http://build.osrfoundation.org/job/generic-release-homebrew_pull_request_updater?search=gz-utils2-2.2.0
 + Releasing ubuntu focal/amd64 in http://build.osrfoundation.org/job/gz-utils2-debbuilder?search=2.2.0-1
 + Releasing ubuntu focal/armhf in http://build.osrfoundation.org/job/gz-utils2-debbuilder?search=2.2.0-1
 + Releasing ubuntu focal/arm64 in http://build.osrfoundation.org/job/gz-utils2-debbuilder?search=2.2.0-1
 + Releasing ubuntu jammy/amd64 in http://build.osrfoundation.org/job/gz-utils2-debbuilder?search=2.2.0-1
 + Releasing ubuntu jammy/armhf in http://build.osrfoundation.org/job/gz-utils2-debbuilder?search=2.2.0-1
 + Releasing ubuntu jammy/arm64 in http://build.osrfoundation.org/job/gz-utils2-debbuilder?search=2.2.0-1

The PR should also help the _releasepy job to produce a meaningful output and hide the token being used.