diff --git a/check_releasepy.bash b/check_releasepy.bash
index 921153017..9d5c100c4 100755
--- a/check_releasepy.bash
+++ b/check_releasepy.bash
@@ -1,9 +1,22 @@
#!/bin/bash -e
-test_dir=$(mktemp -d)
-mkdir -p ${test_dir}/{focal,jammy,ubuntu}/debian
-export _RELEASEPY_TEST_RELEASE_REPO=${test_dir}
export _RELEASEPY_DEBUG=1
+test_dir=$(mktemp -d)
+export _RELEASEPY_TEST_RELEASE_REPO="${test_dir}/test-release"
+mkdir -p ${_RELEASEPY_TEST_RELEASE_REPO}/{focal,jammy,ubuntu}/debian
+export _RELEASEPY_TEST_SOURCE_REPO="${test_dir}/src"
+mkdir -p ${_RELEASEPY_TEST_SOURCE_REPO}
+# Fake packages.xml to make the vendor package script happy
+cat > "${_RELEASEPY_TEST_SOURCE_REPO}/package.xml" <<-EOF
+
+
+ gz-foo
+ 0.0.0
+ test
+ Testing maintainer
+ Foo License
+
+EOF
exec_releasepy_test()
{
@@ -12,7 +25,7 @@ exec_releasepy_test()
./release.py \
--dry-run \
--no-sanity-checks \
- gz-foo 1.2.3 token ${test_params}""
+ gz-foo 1.2.3 token ${test_params}
}
exec_ignition_releasepy_test()
@@ -22,7 +35,7 @@ exec_ignition_releasepy_test()
./release.py \
--dry-run \
--no-sanity-checks \
- ign-foo 1.2.3 token ${test_params}""
+ ign-foo 1.2.3 token ${test_params}
}
exec_ignition_gazebo_releasepy_test()
@@ -32,7 +45,18 @@ exec_ignition_gazebo_releasepy_test()
./release.py \
--dry-run \
--no-sanity-checks \
- ign-gazebo 1.2.3 token ${test_params}""
+ ign-gazebo 1.2.3 token ${test_params}
+}
+
+exec_releasepy_with_real_gz()
+{
+ gz_pkg=${1} major_version=${2}
+ ./release.py \
+ --dry-run \
+ --no-sanity-checks \
+ --source-repo-uri http://github.com/gazebosim/gz-common \
+ --source-repo-existing-ref http://github.com/gazebosim/gz-common/foo-tag \
+ "${gz_pkg}" "${major_version}.x.y" token
}
expect_job_run()
@@ -73,7 +97,26 @@ expect_param()
echo "${param} not found in test output"
exit 1
fi
+}
+
+expect_vendor_repo()
+{
+ output="${1}" repo="${2}"
+
+ if ! grep -q "Github ${repo}" <<< "${output}"; then
+ echo "${repo} not found in test output"
+ exit 1
+ fi
+}
+
+expect_no_vendor()
+{
+ output="${1}"
+ if grep -q 'in ROS 2' <<< "${output}"; then
+ echo "ROS 2 string found in output"
+ exit 1
+ fi
}
source_repo_uri_test=$(exec_releasepy_test "--source-repo-uri https://github.com/gazebosim/gz-foo.git")
@@ -81,6 +124,7 @@ expect_job_run "${source_repo_uri_test}" "gz-foo-source"
expect_job_not_run "${source_repo_uri_test}" "gz-foo-debbuilder"
expect_number_of_jobs "${source_repo_uri_test}" "1"
expect_param "${source_repo_uri_test}" "SOURCE_REPO_URI=https%3A%2F%2Fgithub.com%2Fgazebosim%2Fgz-foo.git"
+expect_no_vendor "${source_repo_uri_test}" # non existing package
source_tarball_uri_test=$(exec_releasepy_test "--source-tarball-uri https://gazebosim/gz-foo-1.2.3.tar.gz")
expect_job_run "${source_tarball_uri_test}" "gz-foo-debbuilder"
@@ -88,6 +132,7 @@ expect_job_run "${source_tarball_uri_test}" "generic-release-homebrew_pull_reque
expect_job_not_run "${source_tarball_uri_test}" "gz-foo-source"
expect_number_of_jobs "${source_tarball_uri_test}" "7"
expect_param "${source_tarball_uri_test}" "SOURCE_TARBALL_URI=https%3A%2F%2Fgazebosim%2Fgz-foo-1.2.3.tar.gz"
+expect_no_vendor "${source_tarball_uri_test}"
nightly_test=$(exec_releasepy_test "--nightly-src-branch my-nightly-branch3 --upload-to-repo nightly")
expect_job_run "${nightly_test}" "gz-foo-debbuilder"
@@ -95,6 +140,7 @@ expect_job_not_run "${nightly_test}" "generic-release-homebrew_pull_request_upda
expect_job_not_run "${nightly_test}" "gz-foo-source"
expect_number_of_jobs "${nightly_test}" "2"
expect_param "${nightly_test}" "SOURCE_TARBALL_URI=my-nightly-branch3"
+expect_no_vendor "${nightly_test}"
bump_linux_test=$(exec_releasepy_test "--source-tarball-uri https://gazebosim/gz-foo-1.2.3.tar.gz --only-bump-revision-linux -r 2")
expect_job_run "${bump_linux_test}" "gz-foo-debbuilder"
@@ -102,6 +148,7 @@ expect_job_not_run "${bump_linux_test}" "generic-release-homebrew_pull_request_u
expect_job_not_run "${bump_linux_test}" "gz-foo-source"
expect_number_of_jobs "${bump_linux_test}" "6"
expect_param "${bump_linux_test}" "RELEASE_VERSION=2"
+expect_no_vendor "${bump_linux_test}"
ignition_test=$(exec_ignition_releasepy_test "--source-repo-uri https://github.com/gazebosim/gz-foo.git")
expect_job_run "${ignition_test}" "gz-foo-source"
@@ -128,3 +175,12 @@ expect_number_of_jobs "${ign_gazebo_source_tarball_uri_test}" "7"
expect_param "${ign_gazebo_source_tarball_uri_test}" "SOURCE_TARBALL_URI=https%3A%2F%2Fgazebosim%2Fign-gazebo-1.2.3.tar.gz"
expect_param "${ign_gazebo_source_tarball_uri_test}" "PACKAGE=ign-gazebo"
expect_param "${ign_gazebo_source_tarball_uri_test}" "PACKAGE_ALIAS=ignition-gazebo"
+
+ros_vendor_test=$(exec_releasepy_with_real_gz gz-fuel-tools 9)
+expect_vendor_repo "${ros_vendor_test}" gazebo-release/gz_fuel_tools_vendor
+
+ros_vendor_test=$(exec_releasepy_with_real_gz gz-cmake 2)
+expect_no_vendor "${ros_vendor_test}"
+
+ros_vendor_test=$(exec_releasepy_with_real_gz gz-ionic 3)
+expect_no_vendor "${ros_vendor_test}"
diff --git a/jenkins-scripts/docker/lib/docker_generate_dockerfile.bash b/jenkins-scripts/docker/lib/docker_generate_dockerfile.bash
index fc3e7c9eb..873f15369 100644
--- a/jenkins-scripts/docker/lib/docker_generate_dockerfile.bash
+++ b/jenkins-scripts/docker/lib/docker_generate_dockerfile.bash
@@ -145,6 +145,7 @@ fi
echo '# BEGIN SECTION: create the Dockerfile'
cat > Dockerfile << DELIM_DOCKER
+#!/bin/bash
#######################################################
# Docker file to run build.sh
diff --git a/jenkins-scripts/dsl/_configs_/OSRFLinuxCompilation.groovy b/jenkins-scripts/dsl/_configs_/OSRFLinuxCompilation.groovy
index 07fc5c23f..9461b4f68 100644
--- a/jenkins-scripts/dsl/_configs_/OSRFLinuxCompilation.groovy
+++ b/jenkins-scripts/dsl/_configs_/OSRFLinuxCompilation.groovy
@@ -80,6 +80,7 @@ class OSRFLinuxCompilation extends OSRFLinuxBase
filters {
'io.jenkins.plugins.analysis.core.filter.ExcludeFile' {
pattern('.*ALSA lib.*')
+ pattern('\\d+: \\(')
}
}
isEnabledForFailure(false)
diff --git a/jenkins-scripts/dsl/brew_release.dsl b/jenkins-scripts/dsl/brew_release.dsl
index 080151a83..704c28e08 100644
--- a/jenkins-scripts/dsl/brew_release.dsl
+++ b/jenkins-scripts/dsl/brew_release.dsl
@@ -4,7 +4,7 @@ import javaposse.jobdsl.dsl.Job
Globals.default_emails = "jrivero@osrfoundation.org, scpeters@osrfoundation.org"
// first distro in list is used as touchstone
-brew_supported_distros = [ "monterey", "ventura" ]
+brew_supported_distros = [ "ventura", "sonoma" ]
bottle_hash_updater_job_name = 'generic-release-homebrew_pr_bottle_hash_updater'
bottle_builder_job_name = 'generic-release-homebrew_triggered_bottle_builder'
directory_for_bottles = 'pkgs'
diff --git a/jenkins-scripts/dsl/gz-collections.yaml b/jenkins-scripts/dsl/gz-collections.yaml
index 470ad0754..e1448e379 100644
--- a/jenkins-scripts/dsl/gz-collections.yaml
+++ b/jenkins-scripts/dsl/gz-collections.yaml
@@ -379,7 +379,7 @@ collections:
- name: gz-common
major_version: 6
repo:
- current_branch: main
+ current_branch: gz-common6
- name: gz-msgs
major_version: 11
repo:
@@ -411,15 +411,15 @@ collections:
- name: gz-physics
major_version: 8
repo:
- current_branch: main
+ current_branch: gz-physics8
- name: gz-sim
major_version: 9
repo:
- current_branch: main
+ current_branch: gz-sim9
- name: gz-launch
major_version: 8
repo:
- current_branch: main
+ current_branch: gz-launch8
- name: gz-ionic
major_version: 1
repo:
@@ -449,6 +449,10 @@ collections:
major_version: 4
repo:
current_branch: main
+ - name: gz-common
+ major_version: 6
+ repo:
+ current_branch: main
- name: gz-fuel-tools
major_version: 10
repo:
@@ -457,6 +461,10 @@ collections:
major_version: 9
repo:
current_branch: main
+ - name: gz-launch
+ major_version: 8
+ repo:
+ current_branch: main
- name: gz-math
major_version: 8
repo:
@@ -465,6 +473,10 @@ collections:
major_version: 11
repo:
current_branch: main
+ - name: gz-physics
+ major_version: 8
+ repo:
+ current_branch: main
- name: gz-plugin
major_version: 3
repo:
@@ -477,6 +489,10 @@ collections:
major_version: 9
repo:
current_branch: main
+ - name: gz-sim
+ major_version: 9
+ repo:
+ current_branch: main
- name: gz-transport
major_version: 14
repo:
diff --git a/jenkins-scripts/dsl/logs/generated_jobs.txt b/jenkins-scripts/dsl/logs/generated_jobs.txt
index 555f754fd..c15a66b28 100644
--- a/jenkins-scripts/dsl/logs/generated_jobs.txt
+++ b/jenkins-scripts/dsl/logs/generated_jobs.txt
@@ -1,11 +1,15 @@
asan_ci __upcoming__ gz_cmake-ci_asan-main-noble-amd64
+asan_ci __upcoming__ gz_common-ci_asan-main-noble-amd64
asan_ci __upcoming__ gz_fuel_tools-ci_asan-main-noble-amd64
asan_ci __upcoming__ gz_gui-ci_asan-main-noble-amd64
+asan_ci __upcoming__ gz_launch-ci_asan-main-noble-amd64
asan_ci __upcoming__ gz_math-ci_asan-main-noble-amd64
asan_ci __upcoming__ gz_msgs-ci_asan-main-noble-amd64
+asan_ci __upcoming__ gz_physics-ci_asan-main-noble-amd64
asan_ci __upcoming__ gz_plugin-ci_asan-main-noble-amd64
asan_ci __upcoming__ gz_rendering-ci_asan-main-noble-amd64
asan_ci __upcoming__ gz_sensors-ci_asan-main-noble-amd64
+asan_ci __upcoming__ gz_sim-ci_asan-main-noble-amd64
asan_ci __upcoming__ gz_tools-ci_asan-main-noble-amd64
asan_ci __upcoming__ gz_transport-ci_asan-main-noble-amd64
asan_ci __upcoming__ gz_utils-ci_asan-main-noble-amd64
@@ -74,17 +78,17 @@ asan_ci harmonic gz_transport-ci_asan-gz-transport13-jammy-amd64
asan_ci harmonic gz_utils-ci_asan-gz-utils2-jammy-amd64
asan_ci harmonic sdformat-ci_asan-sdf14-jammy-amd64
asan_ci ionic gz_cmake-ci_asan-gz-cmake4-noble-amd64
-asan_ci ionic gz_common-ci_asan-main-noble-amd64
+asan_ci ionic gz_common-ci_asan-gz-common6-noble-amd64
asan_ci ionic gz_fuel_tools-ci_asan-gz-fuel-tools10-noble-amd64
asan_ci ionic gz_gui-ci_asan-gz-gui9-noble-amd64
-asan_ci ionic gz_launch-ci_asan-main-noble-amd64
+asan_ci ionic gz_launch-ci_asan-gz-launch8-noble-amd64
asan_ci ionic gz_math-ci_asan-gz-math8-noble-amd64
asan_ci ionic gz_msgs-ci_asan-gz-msgs11-noble-amd64
-asan_ci ionic gz_physics-ci_asan-main-noble-amd64
+asan_ci ionic gz_physics-ci_asan-gz-physics8-noble-amd64
asan_ci ionic gz_plugin-ci_asan-gz-plugin3-noble-amd64
asan_ci ionic gz_rendering-ci_asan-gz-rendering9-noble-amd64
asan_ci ionic gz_sensors-ci_asan-gz-sensors9-noble-amd64
-asan_ci ionic gz_sim-ci_asan-main-noble-amd64
+asan_ci ionic gz_sim-ci_asan-gz-sim9-noble-amd64
asan_ci ionic gz_tools-ci_asan-gz-tools2-noble-amd64
asan_ci ionic gz_transport-ci_asan-gz-transport14-noble-amd64
asan_ci ionic gz_utils-ci_asan-gz-utils3-noble-amd64
@@ -92,18 +96,27 @@ asan_ci ionic sdformat-ci_asan-sdf15-noble-amd64
branch_ci __upcoming__ gz_cmake-ci-main-homebrew-amd64
branch_ci __upcoming__ gz_cmake-ci-main-noble-amd64
branch_ci __upcoming__ gz_cmake-main-win
+branch_ci __upcoming__ gz_common-ci-main-homebrew-amd64
+branch_ci __upcoming__ gz_common-ci-main-noble-amd64
+branch_ci __upcoming__ gz_common-main-win
branch_ci __upcoming__ gz_fuel_tools-ci-main-homebrew-amd64
branch_ci __upcoming__ gz_fuel_tools-ci-main-noble-amd64
branch_ci __upcoming__ gz_fuel_tools-main-win
branch_ci __upcoming__ gz_gui-ci-main-homebrew-amd64
branch_ci __upcoming__ gz_gui-ci-main-noble-amd64
branch_ci __upcoming__ gz_gui-main-win
+branch_ci __upcoming__ gz_launch-ci-main-homebrew-amd64
+branch_ci __upcoming__ gz_launch-ci-main-noble-amd64
+branch_ci __upcoming__ gz_launch-main-win
branch_ci __upcoming__ gz_math-ci-main-homebrew-amd64
branch_ci __upcoming__ gz_math-ci-main-noble-amd64
branch_ci __upcoming__ gz_math-main-win
branch_ci __upcoming__ gz_msgs-ci-main-homebrew-amd64
branch_ci __upcoming__ gz_msgs-ci-main-noble-amd64
branch_ci __upcoming__ gz_msgs-main-win
+branch_ci __upcoming__ gz_physics-ci-main-homebrew-amd64
+branch_ci __upcoming__ gz_physics-ci-main-noble-amd64
+branch_ci __upcoming__ gz_physics-main-win
branch_ci __upcoming__ gz_plugin-ci-main-homebrew-amd64
branch_ci __upcoming__ gz_plugin-ci-main-noble-amd64
branch_ci __upcoming__ gz_plugin-main-win
@@ -113,6 +126,9 @@ branch_ci __upcoming__ gz_rendering-main-win
branch_ci __upcoming__ gz_sensors-ci-main-homebrew-amd64
branch_ci __upcoming__ gz_sensors-ci-main-noble-amd64
branch_ci __upcoming__ gz_sensors-main-win
+branch_ci __upcoming__ gz_sim-ci-main-homebrew-amd64
+branch_ci __upcoming__ gz_sim-ci-main-noble-amd64
+branch_ci __upcoming__ gz_sim-main-win
branch_ci __upcoming__ gz_tools-ci-main-homebrew-amd64
branch_ci __upcoming__ gz_tools-ci-main-noble-amd64
branch_ci __upcoming__ gz_tools-main-win
@@ -331,27 +347,27 @@ branch_ci harmonic sdformat-sdf14-win
branch_ci ionic gz_cmake-4-win
branch_ci ionic gz_cmake-ci-gz-cmake4-homebrew-amd64
branch_ci ionic gz_cmake-ci-gz-cmake4-noble-amd64
-branch_ci ionic gz_common-ci-main-homebrew-amd64
-branch_ci ionic gz_common-ci-main-noble-amd64
-branch_ci ionic gz_common-main-win
+branch_ci ionic gz_common-6-win
+branch_ci ionic gz_common-ci-gz-common6-homebrew-amd64
+branch_ci ionic gz_common-ci-gz-common6-noble-amd64
branch_ci ionic gz_fuel_tools-10-win
branch_ci ionic gz_fuel_tools-ci-gz-fuel-tools10-homebrew-amd64
branch_ci ionic gz_fuel_tools-ci-gz-fuel-tools10-noble-amd64
branch_ci ionic gz_gui-9-win
branch_ci ionic gz_gui-ci-gz-gui9-homebrew-amd64
branch_ci ionic gz_gui-ci-gz-gui9-noble-amd64
-branch_ci ionic gz_launch-ci-main-homebrew-amd64
-branch_ci ionic gz_launch-ci-main-noble-amd64
-branch_ci ionic gz_launch-main-win
+branch_ci ionic gz_launch-8-win
+branch_ci ionic gz_launch-ci-gz-launch8-homebrew-amd64
+branch_ci ionic gz_launch-ci-gz-launch8-noble-amd64
branch_ci ionic gz_math-8-win
branch_ci ionic gz_math-ci-gz-math8-homebrew-amd64
branch_ci ionic gz_math-ci-gz-math8-noble-amd64
branch_ci ionic gz_msgs-11-win
branch_ci ionic gz_msgs-ci-gz-msgs11-homebrew-amd64
branch_ci ionic gz_msgs-ci-gz-msgs11-noble-amd64
-branch_ci ionic gz_physics-ci-main-homebrew-amd64
-branch_ci ionic gz_physics-ci-main-noble-amd64
-branch_ci ionic gz_physics-main-win
+branch_ci ionic gz_physics-8-win
+branch_ci ionic gz_physics-ci-gz-physics8-homebrew-amd64
+branch_ci ionic gz_physics-ci-gz-physics8-noble-amd64
branch_ci ionic gz_plugin-3-win
branch_ci ionic gz_plugin-ci-gz-plugin3-homebrew-amd64
branch_ci ionic gz_plugin-ci-gz-plugin3-noble-amd64
@@ -361,9 +377,9 @@ branch_ci ionic gz_rendering-ci-gz-rendering9-noble-amd64
branch_ci ionic gz_sensors-9-win
branch_ci ionic gz_sensors-ci-gz-sensors9-homebrew-amd64
branch_ci ionic gz_sensors-ci-gz-sensors9-noble-amd64
-branch_ci ionic gz_sim-ci-main-homebrew-amd64
-branch_ci ionic gz_sim-ci-main-noble-amd64
-branch_ci ionic gz_sim-main-win
+branch_ci ionic gz_sim-9-win
+branch_ci ionic gz_sim-ci-gz-sim9-homebrew-amd64
+branch_ci ionic gz_sim-ci-gz-sim9-noble-amd64
branch_ci ionic gz_tools-2-win
branch_ci ionic gz_tools-ci-gz-tools2-homebrew-amd64
branch_ci ionic gz_tools-ci-gz-tools2-noble-amd64
@@ -378,20 +394,28 @@ branch_ci ionic sdformat-ci-sdf15-noble-amd64
branch_ci ionic sdformat-sdf15-win
install_ci __upcoming__ gz_cmake4-install-pkg-noble-amd64
install_ci __upcoming__ gz_cmake4-install_bottle-homebrew-amd64
+install_ci __upcoming__ gz_common6-install-pkg-noble-amd64
+install_ci __upcoming__ gz_common6-install_bottle-homebrew-amd64
install_ci __upcoming__ gz_fuel_tools10-install-pkg-noble-amd64
install_ci __upcoming__ gz_fuel_tools10-install_bottle-homebrew-amd64
install_ci __upcoming__ gz_gui9-install-pkg-noble-amd64
install_ci __upcoming__ gz_gui9-install_bottle-homebrew-amd64
+install_ci __upcoming__ gz_launch8-install-pkg-noble-amd64
+install_ci __upcoming__ gz_launch8-install_bottle-homebrew-amd64
install_ci __upcoming__ gz_math8-install-pkg-noble-amd64
install_ci __upcoming__ gz_math8-install_bottle-homebrew-amd64
install_ci __upcoming__ gz_msgs11-install-pkg-noble-amd64
install_ci __upcoming__ gz_msgs11-install_bottle-homebrew-amd64
+install_ci __upcoming__ gz_physics8-install-pkg-noble-amd64
+install_ci __upcoming__ gz_physics8-install_bottle-homebrew-amd64
install_ci __upcoming__ gz_plugin3-install-pkg-noble-amd64
install_ci __upcoming__ gz_plugin3-install_bottle-homebrew-amd64
install_ci __upcoming__ gz_rendering9-install-pkg-noble-amd64
install_ci __upcoming__ gz_rendering9-install_bottle-homebrew-amd64
install_ci __upcoming__ gz_sensors9-install-pkg-noble-amd64
install_ci __upcoming__ gz_sensors9-install_bottle-homebrew-amd64
+install_ci __upcoming__ gz_sim9-install-pkg-noble-amd64
+install_ci __upcoming__ gz_sim9-install_bottle-homebrew-amd64
install_ci __upcoming__ gz_tools3-install-pkg-noble-amd64
install_ci __upcoming__ gz_tools3-install_bottle-homebrew-amd64
install_ci __upcoming__ gz_transport14-install-pkg-noble-amd64
diff --git a/release.py b/release.py
index 265796308..262851709 100755
--- a/release.py
+++ b/release.py
@@ -2,6 +2,7 @@
from __future__ import print_function
from argparse import RawTextHelpFormatter
+from typing import Tuple
import subprocess
import sys
import tempfile
@@ -10,6 +11,7 @@
import urllib.request
import argparse
import shutil
+import venv
USAGE = 'release.py '
try:
@@ -22,6 +24,7 @@
LINUX_DISTROS = ['ubuntu', 'debian']
SUPPORTED_ARCHS = ['amd64', 'armhf', 'arm64']
RELEASEPY_NO_ARCH_PREFIX = '.releasepy_NO_ARCH_'
+ROS_VENDOR = {'harmonic': 'jazzy', 'ionic': 'rolling'}
OSRF_REPOS_SUPPORTED = "stable prerelease nightly testing none"
@@ -48,6 +51,10 @@ class ErrorNoOutput(Exception):
pass
+class ErrorAlreadyExists(Exception):
+ pass
+
+
def error(msg):
print("\n !! " + msg + "\n")
sys.exit(1)
@@ -151,6 +158,9 @@ def parse_args(argv):
parser.add_argument('--only-bump-revision-linux', dest='bump_rev_linux_only',
action='store_true', default=False,
help='Bump only revision number. Do not upload new tarball.')
+ parser.add_argument('--only-bump-ros-vendor-package', dest='bump_ros_vendor_only',
+ action='store_true', default=False,
+ help='Only process the ROS vendor package (if any).')
args = parser.parse_args()
@@ -375,13 +385,13 @@ def discover_distros(repo_dir):
return distro_arch_list
-def check_call(cmd, ignore_dry_run=False):
+def check_call(cmd, ignore_dry_run=False, cwd=None):
if DRY_RUN and not ignore_dry_run:
print_only_dbg('Dry-run running:\n %s\n' % (' '.join(cmd)))
return b'', b''
else:
print_only_dbg('Running:\n %s' % (' '.join(cmd)))
- po = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ po = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=cwd)
out, err = po.communicate()
if po.returncode != 0:
# bitbucket for the first one, github for the second
@@ -391,6 +401,8 @@ def check_call(cmd, ignore_dry_run=False):
raise ErrorNoPermsRepo()
if b"abort: no username supplied" in err:
raise ErrorNoUsernameSupplied()
+ if b"already exists:" in err:
+ raise ErrorAlreadyExists()
if not out and not err:
# assume that call is only for getting return code
raise ErrorNoOutput()
@@ -515,9 +527,170 @@ def display_help_job_chain_for_source_calls(args):
f'{releasepy_check_url}')
+def get_collections_for_package(package_name, version) -> list:
+ script_directory = os.path.dirname(os.path.abspath(sys.argv[0]))
+ helper_script = f'{script_directory}/jenkins-scripts/dsl/tools/get_collections_from_package_and_version.py'
+ collection_yaml = f'{script_directory}/jenkins-scripts/dsl/gz-collections.yaml'
+ cmd = [helper_script,
+ get_canonical_package_name(package_name),
+ version,
+ collection_yaml]
+ try:
+ _out, _err = check_call(cmd, IGNORE_DRY_RUN)
+ except ErrorNoOutput:
+ # no output is a valid result
+ _out = b""
+ _err = ""
+ else:
+ if _err:
+ print(f"An error happened running get_collections_from_package_and_version: {_err}")
+ sys.exit(1)
+
+ collection_list = _out.decode().strip().split(' ')
+ return collection_list
+
+
+def get_vendor_github_repo(package_name) -> str:
+ canonical_name = get_canonical_package_name(package_name)
+ return f"gazebo-release/{canonical_name.replace('-', '_')}_vendor"
+
+
+def get_vendor_repo_url(package_name) -> str:
+ # Clone needs ssh for real pushing operations. In simulation prefer https to avoid
+ # unexpected pushes and facilitate testing
+ protocol = 'https://github.com/' if DRY_RUN else 'ssh://git@github.com:'
+ return f"{protocol}{get_vendor_github_repo(package_name)}"
+
+
+def prepare_vendor_pr_temp_workspace(package_name, ws_dir) -> Tuple[str, str, str]:
+ gz_vendor_tool = os.path.join(ws_dir, "gz_vendor")
+ # Create virtualenv for vendor dependencies
+ venv_dir = os.path.join(ws_dir, "venv")
+ venv.create(venv_dir, system_site_packages=True, with_pip=True)
+ subprocess.run([os.path.join(venv_dir, 'bin', 'pip3'), 'install', '-q',
+ 'jinja2==3.1.2',
+ 'catkin_pkg==1.0.0'])
+ cmd = ['git', 'clone', '-q',
+ 'https://github.com/gazebo-tooling/gz_vendor/',
+ gz_vendor_tool]
+ _, _err_tool = check_call(cmd, IGNORE_DRY_RUN)
+ gz_vendor_repo = os.path.join(ws_dir, 'gz_vendor_repo')
+ cmd = ['git', 'clone', '-q',
+ get_vendor_repo_url(package_name),
+ gz_vendor_repo]
+ _, _err_repo = check_call(cmd, IGNORE_DRY_RUN)
+ if _err_tool or _err_repo:
+ print("Problems with cloning vendor and tool repos:")
+ print(f"{_err_tool} {_err_repo}")
+ sys.exit(1)
+
+ return gz_vendor_tool, gz_vendor_repo, venv_dir
+
+
+def execute_update_vendor_package_tool(vendor_tool_path,
+ vendor_repo_path,
+ vendor_venv) -> None:
+ # The source repository when releasing matches the
+ src_repo = os.getcwd()
+ try:
+ src_repo = os.environ['_RELEASEPY_TEST_SOURCE_REPO']
+ except KeyError:
+ pass
+
+ run_cmd = [os.path.join(vendor_venv, 'bin', 'python3'),
+ f"{vendor_tool_path}/create_gz_vendor_pkg/create_vendor_package.py",
+ f"{os.path.join(src_repo, 'package.xml')}",
+ '--output_dir', vendor_repo_path]
+ _, _err_run = check_call(run_cmd, IGNORE_DRY_RUN)
+ if _err_run:
+ print("Problems running the create_vendor_package.py script:")
+ print(_err_run.decode())
+ sys.exit(1)
+
+
+def create_pr_for_vendor_package(args, repo_path, base_branch) -> str:
+ cmd_diff = ['git', "-C", repo_path, 'diff']
+ _out, _ = check_call(cmd_diff, IGNORE_DRY_RUN)
+ if not _out.decode():
+ return 'vendor tool did not produce any change, avoid the PR'
+
+ branch_name = f'releasepy/{args.version}'
+ vendor_repo = get_vendor_repo_url(args.package)
+ branch_cmd = ['git', "-C", repo_path,
+ 'checkout', '-b', branch_name]
+ _, _ = check_call(branch_cmd, IGNORE_DRY_RUN)
+ commit_cmd = ['git', "-C", repo_path,
+ 'commit',
+ '-m', f'Bump version to {args.version}',
+ '--all']
+ _, _ = check_call(commit_cmd)
+ push_cmd = ['git', "-C", repo_path,
+ 'push', '--force',
+ vendor_repo, branch_name]
+ _, _ = check_call(push_cmd)
+ pr_cmd = ['gh', 'pr', 'create',
+ '--base', base_branch,
+ '--head', branch_name,
+ '--title', f'Bump version to {args.version}',
+ '--body', 'PR automatically created by release.py']
+ try:
+ _out, _err = check_call(pr_cmd, cwd=repo_path)
+ except ErrorAlreadyExists:
+ return f'there is already a PR for the branch: {branch_name} .'\
+ 'Please check it out manuallly.'
+
+ if _err:
+ print("Problems creating the PR for the vendor package:")
+ print(_err.decode())
+ sys.exit(1)
+
+ if DRY_RUN:
+ return ' (skipped the creation on --dry-run)'
+
+ return _out.decode()
+
+
+def create_pr_in_gz_vendor_repo(args, ros_distro) -> str:
+ pr_msg = ''
+ with tempfile.TemporaryDirectory() as ws_dir:
+ ws_dir = tempfile.mkdtemp()
+ # Prepare the temporary workspace
+ vendor_tool_path, vendor_repo_path, venv_dir = \
+ prepare_vendor_pr_temp_workspace(args.package, ws_dir)
+ # Run updating script on the temporary workspace
+ execute_update_vendor_package_tool(
+ vendor_tool_path, vendor_repo_path, venv_dir)
+ # Commits and PR creation
+ pr_msg = create_pr_for_vendor_package(
+ args, vendor_repo_path, ros_distro)
+
+ return pr_msg
+
+
+def process_ros_vendor_package(args):
+ print("ROS vendor packages that can be updated:")
+ if args.package.replace('gz-','') in ROS_VENDOR:
+ print(" - There are no gz metapackages in ROS")
+ return
+ for collection in get_collections_for_package(args.package,
+ args.version):
+ if collection in ROS_VENDOR:
+ ros_distro = ROS_VENDOR[collection]
+ print(f" * Github {get_vendor_github_repo(args.package)} "
+ f"part of {collection} in ROS 2 {ros_distro}")
+ print(" + Preparing a PR: ", end='', flush=True)
+ pr_url = create_pr_in_gz_vendor_repo(args, ros_distro)
+ print(pr_url)
+
+
def go(argv):
args = parse_args(argv)
+ # If only the process of ROS vendor package is set, just do it
+ if args.bump_ros_vendor_only:
+ process_ros_vendor_package(args)
+ sys.exit(0)
+
# Default to release 1 if not present
if not args.release_version:
args.release_version = 1
@@ -640,7 +813,8 @@ def go(argv):
'Source',
args.version)
display_help_job_chain_for_source_calls(args)
-
+ # Process the possible update of an associated ROS vendor package
+ process_ros_vendor_package(args)
if __name__ == '__main__':
go(sys.argv)
diff --git a/source-repo-scripts/source_changelog.bash b/source-repo-scripts/source_changelog.bash
index 71a8aea23..6b93dfd05 100755
--- a/source-repo-scripts/source_changelog.bash
+++ b/source-repo-scripts/source_changelog.bash
@@ -11,7 +11,8 @@
git fetch --tags
PREV_VER=${1:-$(git describe --tags --abbrev=0 | sed 's/.*_//')}
-echo "Changes since $PREV_VER"
+echo "1. **Baseline:** this includes all changes from $PREV_VER and earlier."
+echo ""
ORIGIN_URL=$(git remote get-url origin)
REPO=$(basename ${ORIGIN_URL%.git})