From f78dfc5872678e0f335643a4721cfc641285c220 Mon Sep 17 00:00:00 2001 From: Scott K Logan Date: Thu, 23 May 2024 10:58:14 -0700 Subject: [PATCH 1/2] Add RPM jobs as upstream of upload jobs --- .../generate_release_trigger_upload_jobs.py | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/ros_buildfarm/scripts/release/generate_release_trigger_upload_jobs.py b/ros_buildfarm/scripts/release/generate_release_trigger_upload_jobs.py index e03a23480..9c48a5fc8 100644 --- a/ros_buildfarm/scripts/release/generate_release_trigger_upload_jobs.py +++ b/ros_buildfarm/scripts/release/generate_release_trigger_upload_jobs.py @@ -18,6 +18,7 @@ from ros_buildfarm.argument import add_argument_config_url from ros_buildfarm.argument import add_argument_dry_run from ros_buildfarm.common import get_release_job_prefix +from ros_buildfarm.common import package_format_mapping from ros_buildfarm.common import JobValidationError from ros_buildfarm.config import get_index from ros_buildfarm.config import get_release_build_files @@ -68,11 +69,23 @@ def get_sync_targets(config, repo): def get_upstream_job_names(config, repo): distributions = config.distributions.keys() + package_formats_per_rosdistro = {} + for rosdistro in distributions: + package_formats_per_rosdistro.setdefault(rosdistro, set()) + build_files = get_release_build_files(config, rosdistro) + for build_file in build_files.values(): + for os_name in build_file.targets.keys(): + package_formats_per_rosdistro[rosdistro].add( + package_format_mapping[os_name]) + upstream_job_names = [] if repo == 'main': - upstream_job_names = ['{0}_sync-packages-to-{1}'.format( - get_release_job_prefix(rosdistro), repo) for rosdistro in distributions] + for rosdistro, package_formats in package_formats_per_rosdistro.items(): + for package_format in package_formats: + upstream_job_names.append( + '{0}_sync-packages-to-{1}{2}'.format( + get_release_job_prefix(rosdistro), repo, + '' if package_format == 'deb' else '-' + package_format)) elif repo == 'testing': - upstream_job_names = [] for rosdistro in distributions: architectures_by_code_name = {} build_files = get_release_build_files(config, rosdistro) @@ -93,7 +106,13 @@ def get_upstream_job_names(config, repo): arch=arch)) else: raise JobValidationError("Unknown upstream jobs for job 'upload_{}'." % repo) - upstream_job_names.append('import_upstream') + for package_format in set( + pf for pfs in package_formats_per_rosdistro.values() for pf in pfs + ): + if package_format == 'deb': + upstream_job_names.append('import_upstream') + else: + upstream_job_names.append('import_upstream_' + package_format) return ','.join(sorted(upstream_job_names)) From 8d67269200f2eb479a8aab4f3629f07ff9a51768 Mon Sep 17 00:00:00 2001 From: Scott K Logan Date: Thu, 23 May 2024 11:02:28 -0700 Subject: [PATCH 2/2] fixup! Add RPM jobs as upstream of upload jobs --- .../scripts/release/generate_release_trigger_upload_jobs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ros_buildfarm/scripts/release/generate_release_trigger_upload_jobs.py b/ros_buildfarm/scripts/release/generate_release_trigger_upload_jobs.py index 9c48a5fc8..99073d50e 100644 --- a/ros_buildfarm/scripts/release/generate_release_trigger_upload_jobs.py +++ b/ros_buildfarm/scripts/release/generate_release_trigger_upload_jobs.py @@ -18,8 +18,8 @@ from ros_buildfarm.argument import add_argument_config_url from ros_buildfarm.argument import add_argument_dry_run from ros_buildfarm.common import get_release_job_prefix -from ros_buildfarm.common import package_format_mapping from ros_buildfarm.common import JobValidationError +from ros_buildfarm.common import package_format_mapping from ros_buildfarm.config import get_index from ros_buildfarm.config import get_release_build_files from ros_buildfarm.jenkins import configure_job