Skip to content

Commit

Permalink
Fix dealing with ign-gazebo to be gz-sim
Browse files Browse the repository at this point in the history
Signed-off-by: Jose Luis Rivero <[email protected]>
  • Loading branch information
j-rivero committed Feb 8, 2024
1 parent b6a0fae commit 9f6bf14
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 23 deletions.
19 changes: 19 additions & 0 deletions check_releasepy.bash
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ exec_ignition_releasepy_test()
ign-foo 1.2.3 token ${test_params}""
}

exec_ignition_gazebo_releasepy_test()
{
test_params=${1}

./release.py \
--dry-run \
--no-sanity-checks \
ign-gazebo 1.2.3 token ${test_params}""
}

expect_job_run()
{
output="${1}" job="${2}"
Expand Down Expand Up @@ -109,3 +119,12 @@ expect_number_of_jobs "${ignition_source_tarball_uri_test}" "7"
expect_param "${ignition_source_tarball_uri_test}" "SOURCE_TARBALL_URI=https%3A%2F%2Fgazebosim%2Fgz-foo-1.2.3.tar.gz"
expect_param "${ignition_source_tarball_uri_test}" "PACKAGE=ign-foo"
expect_param "${ignition_source_tarball_uri_test}" "PACKAGE_ALIAS=ignition-foo"

ign_gazebo_source_tarball_uri_test=$(exec_ignition_gazebo_releasepy_test "--source-tarball-uri https://gazebosim/ign-gazebo-1.2.3.tar.gz")
expect_job_run "${ign_gazebo_source_tarball_uri_test}" "gz-sim-debbuilder"
expect_job_run "${ign_gazebo_source_tarball_uri_test}" "generic-release-homebrew_pull_request_updater"
expect_job_not_run "${ign_gazebo_source_tarball_uri_test}" "gz-sim-source"
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"
32 changes: 9 additions & 23 deletions release.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,6 @@

IGNORE_DRY_RUN = True

GARDEN_IGN_PACKAGES = ['ign-cmake3',
'ign-common5',
'ign-fuel-tools8',
'ign-sim7',
'ign-gui7',
'ign-launch6',
'ign-math7',
'ign-msgs9',
'ign-physics6',
'ign-plugin2',
'ign-rendering7',
'ign-sensors7',
'ign-tools2',
'ign-transport12',
'ign-utils2']


class ErrorNoPermsRepo(Exception):
pass
Expand Down Expand Up @@ -85,6 +69,12 @@ def get_canonical_package_name(pkg_name):
return pkg_name.rstrip('1234567890')


def replace_ignition_gz(pkg_name):
return pkg_name \
.replace('ignition-gazebo', 'gz-sim') \
.replace('ignition-', 'gz-')


def github_repo_exists(url):
try:
check_call(['git', 'ls-remote', '-q', '--exit-code', url], IGNORE_DRY_RUN)
Expand Down Expand Up @@ -164,10 +154,6 @@ def parse_args(argv):

args = parser.parse_args()

if args.package in GARDEN_IGN_PACKAGES:
print(f"Garden packages start with gz- prefix, changing {args.package} to {args.package.replace('ign-','gz-')}",)
args.package = args.package.replace('ign-', 'gz-')

args.package_alias = args.package
if args.package.startswith('ign-'):
args.package_alias = args.package.replace('ign-', 'ignition-')
Expand Down Expand Up @@ -451,15 +437,15 @@ def generate_source_repository_uri(args):
git_remote = out.decode().split('\n')[0]
if org_repo not in git_remote:
# Handle the special case for citadel ignition repositories
if org_repo.replace('/ignition-', '/gz-') not in git_remote:
if replace_ignition_gz(org_repo) not in git_remote:
print(f""" !! Automatic calculation of the source repository URI\
failed with different information:\
\n * git remote origin in the local direcotry is: {git_remote}\
\n * Package name generated org/repo: {org_repo}\
\n >> Please use --source-repo-uri parameter""")
sys.exit(1)
else:
org_repo = org_repo.replace('/ignition-', '/gz-')
org_repo = replace_ignition_gz(org_repo)
print(' ~ Ignition found in generated org/repo assuming gz repo: '
+ org_repo)

Expand Down Expand Up @@ -536,7 +522,7 @@ def go(argv):
if not args.release_version:
args.release_version = 1

package_alias_force_gz = args.package_alias.replace('ignition-','gz-')
package_alias_force_gz = replace_ignition_gz(args.package_alias)

print(f"Downloading releasing info for {args.package}")
# Sanity checks and dicover supported distributions before proceed.
Expand Down

0 comments on commit 9f6bf14

Please sign in to comment.