From 74203cf7bd8502a89e7a4216c16447e4944f77d0 Mon Sep 17 00:00:00 2001 From: Jose Luis Rivero Date: Mon, 18 Dec 2023 17:24:20 +0100 Subject: [PATCH 1/2] Autogenerate dashboard collection views (#1088) * Autogenerate dashboard collection views * Change ign prefix per gz --------- Signed-off-by: Jose Luis Rivero --- jenkins-scripts/dsl/gazebo_libs.dsl | 80 +++- jenkins-scripts/dsl/ignition_collection.dsl | 421 -------------------- 2 files changed, 77 insertions(+), 424 deletions(-) diff --git a/jenkins-scripts/dsl/gazebo_libs.dsl b/jenkins-scripts/dsl/gazebo_libs.dsl index 9adcad88f..6ab40c007 100644 --- a/jenkins-scripts/dsl/gazebo_libs.dsl +++ b/jenkins-scripts/dsl/gazebo_libs.dsl @@ -215,6 +215,18 @@ void generate_win_ci_job(gz_win_ci_job, lib_name, branch, ci_config) add_win_devel_bat_call(gz_win_ci_job, lib_name, ws_checkout_dir) } + +String get_debbuilder_name(parsed_yaml_lib, parsed_yaml_packaging) +{ + major_version = parsed_yaml_lib.major_version + + ignore_major_version = parsed_yaml_packaging.linux?.ignore_major_version + if (ignore_major_version && ignore_major_version.contains(parsed_yaml_lib.name)) + major_version = "" + + return parsed_yaml_lib.name + major_version + "-debbuilder" +} + String generate_linux_install(src_name, lib_name, platform, arch) { def script_name_prefix = cleanup_library_name(src_name) @@ -476,9 +488,71 @@ pkgconf_per_src_index.each { pkg_src, pkg_src_configs -> } } +def File log_file if (WRITE_JOB_LOG) { - File log_file = new File("logs/generated_jobs.txt") - logging_list.each { log_type, items -> - items.each { log_file.append("${log_type} ${it.collection} ${it.job_name}\n") } + log_file = new File("logs/generated_jobs.txt") +} + +def collection_job_names = [:].withDefault {[]} +logging_list.each { log_type, items -> + items.each { + collection_job_names[it.collection] << it.job_name + if (WRITE_JOB_LOG) { + log_file.append("${log_type} ${it.collection} ${it.job_name}\n") } + } +} + +/* + * ------------------------------------------------------- + * DASHBOARD VIEWS + * ------------------------------------------------------- + */ +collection_job_names.each { collection_name, job_names -> + // TODO: change ign by gz when testing is ready + dashboardView("gz-${collection_name}") + { + jobs { + job_names.each { jobname -> + name(jobname) + } + def collection = gz_collections_yaml.collections.find { it.name == collection_name } + println(collection) + if (collection.packaging?.linux?.nightly) { + collection.libs.each { lib -> + name(get_debbuilder_name(lib, collection.packaging)) + } + } + } + + columns { + status() + weather() + name() + testResult(0) + lastSuccess() + lastFailure() + lastDuration() + buildButton() + + } + + bottomPortlets { + jenkinsJobsList { + displayName('Jenkins jobs list') + } + } + + configure { view -> + view / columns << "hudson.plugins.warnings.WarningsColumn" (plugin: 'warnings@5.0.1') + + def topPortlets = view / NodeBuilder.newInstance().topPortlets {} + + topPortlets << 'hudson.plugins.view.dashboard.core.UnstableJobsPortlet' { + id createPortletId() + name 'Failing jobs' + showOnlyFailedJobs 'true' + recurse 'false' + } + } } } diff --git a/jenkins-scripts/dsl/ignition_collection.dsl b/jenkins-scripts/dsl/ignition_collection.dsl index 61fa50036..43018c8df 100644 --- a/jenkins-scripts/dsl/ignition_collection.dsl +++ b/jenkins-scripts/dsl/ignition_collection.dsl @@ -24,376 +24,6 @@ String get_debbuilder_name(parsed_yaml_lib, parsed_yaml_packaging) return parsed_yaml_lib.name + major_version + "-debbuilder" } -gz_collection_jobs = -[ - 'citadel' : [ - 'gz_cmake-2-win', - 'gz_common-3-win', - 'gz_fuel_tools-4-win', - 'gz_gazebo-3-win', - 'gz_gui-3-win', - 'gz_math-6-win', - 'gz_msgs-5-win', - 'gz_physics-2-win', - 'gz_plugin-1-win', - 'gz_rendering-3-win', - 'gz_sensors-3-win', - 'gz_tools-1-win', - 'gz_transport-8-win', - 'ignition_citadel-ci-main-homebrew-amd64', - 'ignition_citadel-install-pkg-focal-amd64', - 'ignition_citadel-install_bottle-homebrew-amd64', - 'gz_cmake-ci-ign-cmake2-focal-amd64', - 'gz_cmake-ci-ign-cmake2-homebrew-amd64', - 'ignition_cmake2-install-pkg-focal-amd64', - 'ignition_cmake2-install_bottle-homebrew-amd64', - 'gz_common-ci-ign-common3-focal-amd64', - 'gz_common-ci-ign-common3-homebrew-amd64', - 'ignition_common3-install-pkg-focal-amd64', - 'ignition_common3-install_bottle-homebrew-amd64', - 'gz_fuel_tools-ci-ign-fuel-tools4-focal-amd64', - 'gz_fuel_tools-ci-ign-fuel-tools4-homebrew-amd64', - 'ignition_fuel-tools4-install-pkg-focal-amd64', - 'ignition_fuel-tools4-install_bottle-homebrew-amd64', - 'gz_gazebo-ci-ign-gazebo3-focal-amd64', - 'gz_gazebo-ci-ign-gazebo3-homebrew-amd64', - 'ignition_gazebo3-install-pkg-focal-amd64', - 'ignition_gazebo3-install_bottle-homebrew-amd64', - 'gz_gui-ci-ign-gui3-focal-amd64', - 'gz_gui-ci-ign-gui3-homebrew-amd64', - 'ignition_gui3-install-pkg-focal-amd64', - 'ignition_gui3-install_bottle-homebrew-amd64', - 'gz_launch-ci-ign-launch2-focal-amd64', - 'gz_launch-ci-ign-launch2-homebrew-amd64', - 'ignition_launch2-install-pkg-focal-amd64', - 'ignition_launch2-install_bottle-homebrew-amd64', - 'gz_math-ci-ign-math6-focal-amd64', - 'gz_math-ci-ign-math6-homebrew-amd64', - 'ignition_math6-install-pkg-focal-amd64', - 'ignition_math6-install_bottle-homebrew-amd64', - 'gz_msgs-ci-ign-msgs5-focal-amd64', - 'gz_msgs-ci-ign-msgs5-homebrew-amd64', - 'ignition_msgs5-install-pkg-focal-amd64', - 'ignition_msgs5-install_bottle-homebrew-amd64', - 'gz_physics-ci-ign-physics2-focal-amd64', - 'gz_physics-ci-ign-physics2-homebrew-amd64', - 'ignition_physics2-install-pkg-focal-amd64', - 'ignition_physics2-install_bottle-homebrew-amd64', - 'gz_plugin-ci-ign-plugin1-focal-amd64', - 'gz_plugin-ci-ign-plugin1-homebrew-amd64', - 'ignition_plugin-install-pkg-focal-amd64', - 'ignition_plugin1-install_bottle-homebrew-amd64', - 'gz_rendering-ci-ign-rendering3-focal-amd64', - 'gz_rendering-ci-ign-rendering3-homebrew-amd64', - 'ignition_rendering3-install-pkg-focal-amd64', - 'ignition_rendering3-install_bottle-homebrew-amd64', - 'gz_sensors-ci-ign-sensors3-focal-amd64', - 'gz_sensors-ci-ign-sensors3-homebrew-amd64', - 'ignition_sensors3-install-pkg-focal-amd64', - 'ignition_sensors3-install_bottle-homebrew-amd64', - 'gz_tools-ci-ign-tools1-focal-amd64', - 'gz_tools-ci-ign-tools1-homebrew-amd64', - 'ignition_tools-install-pkg-focal-amd64', - 'ignition_tools1-install_bottle-homebrew-amd64', - 'gz_transport-ci-ign-transport8-focal-amd64', - 'gz_transport-ci-ign-transport8-homebrew-amd64', - 'ignition_transport8-install-pkg-focal-amd64', - 'ignition_transport8-install_bottle-homebrew-amd64', - 'sdformat-ci-sdf9-focal-amd64', - 'sdformat-ci-sdf9-homebrew-amd64', - 'sdformat-install-sdformat9_pkg-focal-amd64', - 'sdformat-sdf9-win' - ], - 'fortress' : [ - 'gz_cmake-ign-cmake2-win', - 'gz_common-ign-common4-win', - 'gz_fuel_tools-ign-fuel-tools7-win', - 'gz_sim-ign-gazebo6-win', - 'gz_gui-ign-gui6-win', - 'gz_launch-ign-launch5-win', - 'gz_math-ign-math6-win', - 'gz_msgs-ign-msgs8-win', - 'gz_physics-ign-physics5-win', - 'gz_plugin-ign-plugin1-win', - 'gz_rendering-ign-rendering6-win', - 'gz_sensors-ign-sensors6-win', - 'gz_tools-ign-tools1-win', - 'gz_transport-ign-transport11-win', - 'gz_utils-ign-utils1-win', - 'gz_cmake-ci-ign-cmake2-focal-amd64', - 'gz_cmake-ci-ign-cmake2-homebrew-amd64', - 'gz_cmake2-install-pkg-focal-amd64', - 'ignition_cmake2-install_bottle-homebrew-amd64', - 'gz_common-ci-ign-common4-focal-amd64', - 'gz_common-ci-ign-common4-homebrew-amd64', - 'gz_common4-install-pkg-focal-amd64', - 'ignition_common4-install_bottle-homebrew-amd64', - 'ignition_fortress-ci-main-homebrew-amd64', - 'ignition_fortress-install-pkg-focal-amd64', - 'ignition_fortress-install_bottle-homebrew-amd64', - 'gz_fuel-tools-ci-ign-fuel-tools7-focal-amd64', - 'gz_fuel-tools-ci-ign-fuel-tools7-homebrew-amd64', - 'gz_fuel-tools7-install-pkg-focal-amd64', - 'ignition_fuel-tools7-install_bottle-homebrew-amd64', - 'gz_sim-ci-ign-gazebo6-focal-amd64', - 'gz_sim-ci-ign-gazebo6-homebrew-amd64', - 'ignition_gazebo6-install-pkg-focal-amd64', - 'ignition_gazebo6-install_bottle-homebrew-amd64', - 'gz_gui-ci-ign-gui6-focal-amd64', - 'gz_gui-ci-ign-gui6-homebrew-amd64', - 'gz_gui6-install-pkg-focal-amd64', - 'ignition_gui6-install_bottle-homebrew-amd64', - 'gz_launch-ci-ign-launch5-focal-amd64', - 'gz_launch-ci-ign-launch5-homebrew-amd64', - 'gz_launch5-install-pkg-focal-amd64', - 'ignition_launch5-install_bottle-homebrew-amd64', - 'gz_math-ci-ign-math6-focal-amd64', - 'gz_math-ci-ign-math6-homebrew-amd64', - 'gz_math6-install-pkg-focal-amd64', - 'ignition_math6-install_bottle-homebrew-amd64', - 'gz_msgs-ci-ign-msgs8-focal-amd64', - 'gz_msgs-ci-ign-msgs8-homebrew-amd64', - 'gz_msgs8-install-pkg-focal-amd64', - 'ignition_msgs8-install_bottle-homebrew-amd64', - 'gz_physics-ci-ign-physics5-focal-amd64', - 'gz_physics-ci-ign-physics5-homebrew-amd64', - 'gz_physics5-install-pkg-focal-amd64', - 'ignition_physics5-install_bottle-homebrew-amd64', - 'gz_plugin-ci-ign-plugin1-focal-amd64', - 'gz_plugin-ci-ign-plugin1-homebrew-amd64', - 'ignition_plugin-install-pkg-focal-amd64', - 'ignition_plugin1-install_bottle-homebrew-amd64', - 'gz_rendering-ci-ign-rendering6-focal-amd64', - 'gz_rendering-ci-ign-rendering6-homebrew-amd64', - 'gz_rendering6-install-pkg-focal-amd64', - 'ignition_rendering6-install_bottle-homebrew-amd64', - 'gz_sensors-ci-ign-sensors6-focal-amd64', - 'gz_sensors-ci-ign-sensors6-homebrew-amd64', - 'gz_sensors6-install-pkg-focal-amd64', - 'ignition_sensors6-install_bottle-homebrew-amd64', - 'gz_tools-ci-ign-tools1-focal-amd64', - 'gz_tools-ci-ign-tools1-homebrew-amd64', - 'ignition_tools-install-pkg-focal-amd64', - 'ignition_tools1-install_bottle-homebrew-amd64', - 'gz_transport-ci-ign-transport11-focal-amd64', - 'gz_transport-ci-ign-transport11-homebrew-amd64', - 'gz_transport11-install-pkg-focal-amd64', - 'ignition_transport11-install_bottle-homebrew-amd64', - 'gz_utils-ci-ign-utils1-focal-amd64', - 'gz_utils-ci-ign-utils1-homebrew-amd64', - 'ignition_utils-install-pkg-focal-amd64', - 'ignition_utils1-install_bottle-homebrew-amd64', - 'sdformat-ci-sdf12-focal-amd64', - 'sdformat-ci-sdf12-homebrew-amd64', - 'sdformat-install-sdformat12_pkg-focal-amd64', - 'sdformat-sdf12-win' - ], - 'garden' : [ - 'gz_cmake3-install-pkg-focal-amd64', - 'gz_common5-install-pkg-focal-amd64', - 'gz_fuel-tools8-install-pkg-focal-amd64', - 'gz_garden-install-pkg-focal-amd64', - 'gz_sim7-install-pkg-focal-amd64', - 'gz_gui7-install-pkg-focal-amd64', - 'gz_launch6-install-pkg-focal-amd64', - 'gz_math7-install-pkg-focal-amd64', - 'gz_msgs9-install-pkg-focal-amd64', - 'gz_physics6-install-pkg-focal-amd64', - 'gz_plugin2-install-pkg-focal-amd64', - 'gz_rendering7-install-pkg-focal-amd64', - 'gz_sensors7-install-pkg-focal-amd64', - 'gz_tools2-install-pkg-focal-amd64', - 'gz_transport12-install-pkg-focal-amd64', - 'gz_utils2-install-pkg-focal-amd64', - 'sdformat-install-sdformat13_pkg-focal-amd64', - 'gz_cmake-3-win', - 'gz_common-5-win', - 'gz_fuel-tools-8-win', - 'gz_sim-7-win', - 'gz_gui-7-win', - 'gz_launch-6-win', - 'gz_math-7-win', - 'gz_msgs-9-win', - 'gz_physics-6-win', - 'gz_plugin-2-win', - 'gz_rendering-7-win', - 'gz_sensors-7-win', - 'gz_tools-2-win', - 'gz_transport-12-win', - 'gz_utils-2-win', - 'sdformat-sdf13-win', - 'gz_cmake-ci-gz-cmake3-focal-amd64', - 'gz_cmake-ci-gz-cmake3-homebrew-amd64', - 'ignition_cmake3-install_bottle-homebrew-amd64', - 'gz_common-ci-gz-common5-focal-amd64', - 'gz_common-ci-gz-common5-homebrew-amd64', - 'ignition_common5-install_bottle-homebrew-amd64', - 'gz_fuel-tools-ci-gz-fuel-tools8-focal-amd64', - 'gz_fuel-tools-ci-gz-fuel-tools8-homebrew-amd64', - 'ignition_fuel-tools8-install_bottle-homebrew-amd64', - 'ignition_garden-ci-main-homebrew-amd64', - 'ignition_garden-install-pkg-focal-amd64', - 'ignition_garden-install_bottle-homebrew-amd64', - 'gz_sim-ci-gz-sim7-focal-amd64', - 'gz_sim-ci-gz-sim7-homebrew-amd64', - 'ignition_sim7-install_bottle-homebrew-amd64', - 'gz_gui-ci-gz-gui7-focal-amd64', - 'gz_gui-ci-gz-gui7-homebrew-amd64', - 'ignition_gui6-install_bottle-homebrew-amd64', - 'gz_launch-ci-gz-launch6-focal-amd64', - 'gz_launch-ci-gz-launch6-homebrew-amd64', - 'ignition_launch6-install_bottle-homebrew-amd64', - 'gz_math-ci-gz-math7-focal-amd64', - 'gz_math-ci-gz-math7-homebrew-amd64', - 'ignition_math7-install_bottle-homebrew-amd64', - 'gz_msgs-ci-gz-msgs9-focal-amd64', - 'gz_msgs-ci-gz-msgs9-homebrew-amd64', - 'ignition_msgs9-install_bottle-homebrew-amd64', - 'gz_physics-ci-gz-physics6-focal-amd64', - 'gz_physics-ci-gz-physics6-homebrew-amd64', - 'ignition_physics6-install_bottle-homebrew-amd64', - 'gz_plugin-ci-gz-plugin2-focal-amd64', - 'gz_plugin-ci-gz-plugin2-homebrew-amd64', - 'ignition_plugin2-install_bottle-homebrew-amd64', - 'gz_rendering-ci-gz-rendering7-focal-amd64', - 'gz_rendering-ci-gz-rendering7-homebrew-amd64', - 'ignition_rendering7-install_bottle-homebrew-amd64', - 'gz_sensors-ci-gz-sensors7-focal-amd64', - 'gz_sensors-ci-gz-sensors7-homebrew-amd64', - 'ignition_sensors7-install_bottle-homebrew-amd64', - 'gz_tools-ci-gz-tools2-focal-amd64', - 'gz_tools-ci-gz-tools2-homebrew-amd64', - 'ignition_tools2-install_bottle-homebrew-amd64', - 'gz_transport-ci-gz-transport12-focal-amd64', - 'gz_transport-ci-gz-transport12-homebrew-amd64', - 'ignition_transport12-install_bottle-homebrew-amd64', - 'gz_utils-ci-gz-utils2-focal-amd64', - 'gz_utils-ci-gz-utils2-homebrew-amd64', - 'ignition_utils2-install_bottle-homebrew-amd64', - 'sdformat-ci-sdf13-focal-amd64', - 'sdformat-ci-sdf13-homebrew-amd64' - ], - 'harmonic' : [ - 'gz_cmake-3-win', - 'gz_common-5-win', - 'gz_fuel-tools-9-win', - 'gz_sim-8-win', - 'gz_gui-8-win', - 'gz_launch-7-win', - 'gz_math-7-win', - 'gz_msgs-10-win', - 'gz_physics-7-win', - 'gz_plugin-2-win', - 'gz_rendering-8-win', - 'gz_sensors-8-win', - 'gz_tools-2-win', - 'gz_transport-13-win', - 'gz_utils-2-win', - 'gz_cmake-ci-gz-cmake3-jammy-amd64', - 'gz_common-ci-gz-common5-jammy-amd64', - 'gz_fuel_tools-ci-gz-fuel-tools9-jammy-amd64', - 'gz_gui-ci-gz-gui8-jammy-amd64', - 'gz_launch-ci-gz-launch7-jammy-amd64', - 'gz_math-ci-gz-math7-jammy-amd64', - 'gz_msgs-ci-gz-msgs10-jammy-amd64', - 'gz_physics-ci-gz-physics7-jammy-amd64', - 'gz_plugin-ci-gz-plugin2-jammy-amd64', - 'gz_rendering-ci-gz-rendering8-jammy-amd64', - 'gz_sensors-ci-gz-sensors8-jammy-amd64', - 'gz_sim-ci-gz-sim8-jammy-amd64', - 'gz_tools-ci-gz-tools2-jammy-amd64', - 'gz_transport-ci-gz-transport13-jammy-amd64', - 'gz_utils-ci-gz-utils2-jammy-amd64', - 'gz_cmake-ci-gz-cmake3-homebrew-amd64', - 'ignition_cmake3-install_bottle-homebrew-amd64', - 'gz_common-ci-gz-common5-homebrew-amd64', - 'ignition_common5-install_bottle-homebrew-amd64', - 'gz_fuel-tools-ci-gz-fuel-tools9-homebrew-amd64', - 'ignition_fuel-tools9-install_bottle-homebrew-amd64', - 'ignition_harmonic-ci-main-homebrew-amd64', - 'ignition_harmonic-install_bottle-homebrew-amd64', - 'gz_sim-ci-gz-sim8-homebrew-amd64', - 'ignition_sim8-install_bottle-homebrew-amd64', - 'gz_gui-ci-gz-gui8-homebrew-amd64', - 'ignition_gui8-install_bottle-homebrew-amd64', - 'gz_launch-gz-launch7-homebrew-amd64', - 'ignition_launch7-install_bottle-homebrew-amd64', - 'gz_math-ci-gz-math7-homebrew-amd64', - 'ignition_math7-install_bottle-homebrew-amd64', - 'gz_msgs-ci-gz-msgs10-homebrew-amd64', - 'ignition_msgs10-install_bottle-homebrew-amd64', - 'gz_physics-ci-gz-physics7-homebrew-amd64', - 'ignition_physics7-install_bottle-homebrew-amd64', - 'gz_plugin-ci-gz-plugin2-homebrew-amd64', - 'ignition_plugin2-install_bottle-homebrew-amd64', - 'gz_rendering-ci-gz-rendering8-homebrew-amd64', - 'ignition_rendering8-install_bottle-homebrew-amd64', - 'gz_sensors-ci-gz-sensors8-homebrew-amd64', - 'ignition_sensors8-install_bottle-homebrew-amd64', - 'gz_tools-ci-gz-tools2-homebrew-amd64', - 'ignition_tools2-install_bottle-homebrew-amd64', - 'gz_transport-ci-gz-transport13-homebrew-amd64', - 'ignition_transport13-install_bottle-homebrew-amd64', - 'gz_utils-ci-gz-utils2-homebrew-amd64', - 'ignition_utils2-install_bottle-homebrew-amd64', - 'sdformat-ci-sdf14-jammy-amd64', - 'sdformat-ci-sdf14-homebrew-amd64', - 'sdformat14-install_bottle-homebrew-amd64', - 'sdformat-sdf14-win' - ], - 'ionic' : [ - 'gz_cmake-main-win', - 'gz_common-main-win', - 'gz_fuel-tools-main-win', - 'gz_gazebo-main-win', - 'gz_gui-main-win', - 'gz_launch-main-win', - 'gz_math-main-win', - 'gz_msgs-main-win', - 'gz_physics-main-win', - 'gz_plugin-main-win', - 'gz_rendering-main-win', - 'gz_sensors-main-win', - 'gz_tools-2-win', - 'gz_transport-main-win', - 'gz_utils-main-win', - 'gz_cmake-ci-main-jammy-amd64', - 'gz_common-ci-main-jammy-amd64', - 'gz_fuel_tools-ci-main-jammy-amd64', - 'gz_gui-ci-main-jammy-amd64', - 'gz_launch-ci-main-jammy-amd64', - 'gz_math-ci-main-jammy-amd64', - 'gz_msgs-ci-main-jammy-amd64', - 'gz_physics-ci-main-jammy-amd64', - 'gz_plugin-ci-main-jammy-amd64', - 'gz_rendering-ci-main-jammy-amd64', - 'gz_sensors-ci-main-jammy-amd64', - 'gz_sim-ci-main-jammy-amd64', - 'gz_tools-ci-gz-tools2-jammy-amd64', - 'gz_transport-ci-main-jammy-amd64', - 'gz_utils-ci-main-jammy-amd64', - 'gz_cmake-ci-main-homebrew-amd64', - 'gz_common-ci-main-homebrew-amd64', - 'gz_fuel-tools-ci-main-homebrew-amd64', - 'gz_ionic-ci-main-homebrew-amd64', - 'gz_sim-ci-main-homebrew-amd64', - 'gz_gui-ci-main-homebrew-amd64', - 'gz_launch-ci-main-homebrew-amd64', - 'gz_math-ci-main-homebrew-amd64', - 'gz_msgs-ci-main-homebrew-amd64', - 'gz_physics-ci-main-homebrew-amd64', - 'gz_plugin-ci-main-homebrew-amd64', - 'gz_rendering-ci-main-homebrew-amd64', - 'gz_sensors-ci-main-homebrew-amd64', - 'gz_tools-ci-gz-tools2-homebrew-amd64', - 'gz_transport-ci-main-homebrew-amd64', - 'gz_utils-ci-main-homebrew-amd64', - 'sdformat-ci-main-jammy-amd64', - 'sdformat-ci-main-homebrew-amd64', - 'sdformat-main-win' - ], -] - def DISABLE_TESTS = false void generate_install_job(prefix, gz_collection_name, distro, arch) @@ -433,57 +63,6 @@ void generate_install_job(prefix, gz_collection_name, distro, arch) gz_collections_yaml.collections.each { collection -> gz_collection_name = collection.name - dashboard_name = "ign-${gz_collection_name}" - if (gz_collection_name == "__upcoming__") - dashboard_name = gz_collection_name - - // Gazebo dashboards - // -------------------------------------------------------------- - dashboardView(dashboard_name) - { - jobs { - gz_collection_jobs["${gz_collection_name}"].each { jobname -> - name(jobname) - } - if (collection.packaging?.linux?.nightly) { - collection.libs.each { lib -> - name(get_debbuilder_name(lib, collection.packaging)) - } - } - } - - columns { - status() - weather() - name() - testResult(0) - lastSuccess() - lastFailure() - lastDuration() - buildButton() - - } - - bottomPortlets { - jenkinsJobsList { - displayName('Jenkins jobs list') - } - } - - configure { view -> - view / columns << "hudson.plugins.warnings.WarningsColumn" (plugin: 'warnings@5.0.1') - - def topPortlets = view / NodeBuilder.newInstance().topPortlets {} - - topPortlets << 'hudson.plugins.view.dashboard.core.UnstableJobsPortlet' { - id createPortletId() - name 'Failing jobs' - showOnlyFailedJobs 'true' - recurse 'false' - } - } - } - if (! collection.packaging.exclude?.contains(gz_collection_name)) { // DEBBUILD: linux package builder // -------------------------------------------------------------- From ac4663677fc36beeebcde3f7c397bb7211609617 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Crist=C3=B3bal=20Arroyo?= Date: Tue, 19 Dec 2023 12:30:54 -0500 Subject: [PATCH 2/2] Improve outdated job feching and success strategy (#1091) * Parse tracked jobs from URL Signed-off-by: Crola1702 * Set unstable or failed depending on projects disabled or existing Signed-off-by: Crola1702 * Change jobs list URL Signed-off-by: Crola1702 * Replace println by reporting code on problems Signed-off-by: Jose Luis Rivero --------- Signed-off-by: Crola1702 Signed-off-by: Jose Luis Rivero Co-authored-by: Jose Luis Rivero --- .../tools/outdated-job-runner.groovy | 269 ++---------------- 1 file changed, 21 insertions(+), 248 deletions(-) diff --git a/jenkins-scripts/tools/outdated-job-runner.groovy b/jenkins-scripts/tools/outdated-job-runner.groovy index 138f7d8ec..7165da8d6 100644 --- a/jenkins-scripts/tools/outdated-job-runner.groovy +++ b/jenkins-scripts/tools/outdated-job-runner.groovy @@ -10,10 +10,11 @@ import java.util.Date; /* * Schedule a job to run immediately + * Will return true or false depending on if the job was scheduled */ def runJob(String jobName) { def job = Jenkins.instance.getItemByFullName(jobName) - job.scheduleBuild(0) + return job.scheduleBuild(0) } /* @@ -52,260 +53,32 @@ def runJobsInAvailableNodes(LinkedHashMap outdatedJobs) { try { def jobName = outdatedJobs[os.key].remove(0) println("Running job ${jobName}") - runJob(jobName) - } catch (Exception e) { - println("Error running job ${jobName}") - println(e) - println("MARK_AS_UNSTABLE") + if (!runJob(jobName)) { + println("Error scheduling job ${jobName}. Project disabled?") + println("MARK_AS_UNSTABLE") + } + } catch (NullPointerException e) { + println("Error running job ${jobName}. Project exist?") + throw e } } } } } -// TODO (Cristobal): This is a hardcoded list of jobs that we're tracking. We should get this list dynamically -// Ideally generated automatically after: https://github.com/gazebo-tooling/release-tools/pull/1089 -def trackedJobsList = [ -'gz_cmake-ci-ign-cmake2-focal-amd64', -'gz_cmake-ci-ign-cmake2-homebrew-amd64', -'gz_cmake-ign-cmake2-win', -'gz_cmake-ci-ign-cmake2-focal-amd64', -'gz_cmake-ign-cmake2-win', -'gz_cmake-ci-ign-cmake2-homebrew-amd64', -'gz_cmake-ci-gz-cmake3-focal-amd64', -'gz_cmake-ci-gz-cmake3-homebrew-amd64', -'gz_cmake-3-win', -'gz_cmake-ci-gz-cmake3-homebrew-amd64', -'gz_cmake-3-win', -'gz_cmake-ci-gz-cmake3-jammy-amd64', -'gz_cmake-ci-main-homebrew-amd64', -'gz_cmake-main-win', -'gz_cmake-ci-main-jammy-amd64', -'gz_tools-ci-ign-tools1-focal-amd64', -'gz_tools-ci-ign-tools1-homebrew-amd64', -'gz_tools-ci-ign-tools1-homebrew-amd64', -'gz_tools-ci-ign-tools1-focal-amd64', -'gz_tools-ci-gz-tools2-focal-amd64', -'gz_tools-ci-gz-tools2-homebrew-amd64', -'gz_tools-ci-gz-tools2-homebrew-amd64', -'gz_tools-ci-gz-tools2-homebrew-amd64', -'gz_tools-ign-tools1-win', -'gz_tools-ign-tools1-win', -'gz_tools-2-win', -'gz_tools-2-win', -'gz_tools-2-win', -'gz_tools-ci-gz-tools2-jammy-amd64', -'gz_tools-ci-gz-tools2-jammy-amd64', -'gz_math-ci-ign-math6-focal-amd64', -'gz_math-ci-ign-math6-focal-amd64', -'gz_math-ci-gz-math7-focal-amd64', -'gz_math-ci-ign-math6-homebrew-amd64', -'gz_math-ci-ign-math6-homebrew-amd64', -'gz_math-ci-gz-math7-homebrew-amd64', -'gz_math-ci-gz-math7-homebrew-amd64', -'gz_math-ci-main-homebrew-amd64', -'gz_math-ign-math6-win', -'gz_math-ign-math6-win', -'gz_math-7-win', -'gz_math-7-win', -'gz_math-main-win', -'gz_math-ci-gz-math7-jammy-amd64', -'gz_math-ci-main-jammy-amd64', -'gz_plugin-ci-ign-plugin1-focal-amd64', -'gz_plugin-ci-ign-plugin1-focal-amd64', -'gz_plugin-ci-gz-plugin2-focal-amd64', -'gz_plugin-ci-ign-plugin1-homebrew-amd64', -'gz_plugin-ci-ign-plugin1-homebrew-amd64', -'gz_plugin-ci-gz-plugin2-homebrew-amd64', -'gz_plugin-ci-gz-plugin2-homebrew-amd64', -'gz_plugin-ci-main-homebrew-amd64', -'gz_plugin-ign-plugin1-win', -'gz_plugin-ign-plugin1-win', -'gz_plugin-2-win', -'gz_plugin-2-win', -'gz_plugin-main-win', -'gz_plugin-ci-gz-plugin2-jammy-amd64', -'gz_plugin-ci-main-jammy-amd64', -'gz_common-ci-ign-common3-focal-amd64', -'gz_common-ci-ign-common4-focal-amd64', -'gz_common-ci-gz-common5-focal-amd64', -'gz_common-ci-ign-common3-homebrew-amd64', -'gz_common-ci-ign-common4-homebrew-amd64', -'gz_common-ci-gz-common5-homebrew-amd64', -'gz_common-ci-gz-common5-homebrew-amd64', -'gz_common-ci-main-homebrew-amd64', -'gz_common-ign-common3-win', -'gz_common-ign-common4-win', -'gz_common-5-win', -'gz_common-5-win', -'gz_common-main-win', -'gz_common-ci-gz-common5-jammy-amd64', -'gz_common-ci-main-jammy-amd64', -'gz_msgs-ci-ign-msgs5-focal-amd64', -'gz_msgs-ci-ign-msgs8-focal-amd64', -'gz_msgs-ci-gz-msgs9-focal-amd64', -'gz_msgs-ci-ign-msgs5-homebrew-amd64', -'gz_msgs-ci-ign-msgs8-homebrew-amd64', -'gz_msgs-ci-gz-msgs9-homebrew-amd64', -'gz_msgs-ci-gz-msgs10-homebrew-amd64', -'gz_msgs-ci-main-homebrew-amd64', -'gz_msgs-ign-msgs5-win', -'gz_msgs-ign-msgs8-win', -'gz_msgs-9-win', -'gz_msgs-10-win', -'gz_msgs-main-win', -'gz_msgs-ci-gz-msgs10-jammy-amd64', -'gz_msgs-ci-main-jammy-amd64', -'gz_rendering-ci-ign-rendering3-focal-amd64', -'gz_rendering-ci-ign-rendering6-focal-amd64', -'gz_rendering-ci-gz-rendering7-focal-amd64', -'gz_rendering-ci-ign-rendering3-homebrew-amd64', -'gz_rendering-ci-ign-rendering6-homebrew-amd64', -'gz_rendering-ci-gz-rendering7-homebrew-amd64', -'gz_rendering-ci-gz-rendering8-homebrew-amd64', -'gz_rendering-ci-main-homebrew-amd64', -'gz_rendering-ign-rendering3-win', -'gz_rendering-ign-rendering6-win', -'gz_rendering-7-win', -'gz_rendering-8-win', -'gz_rendering-main-win', -'gz_rendering-ci-gz-rendering8-jammy-amd64', -'gz_rendering-ci-main-jammy-amd64', -'sdformat-ci-sdf9-focal-amd64', -'sdformat-ci-sdf12-focal-amd64', -'sdformat-ci-sdf13-focal-amd64', -'sdformat-ci-sdf9-homebrew-amd64', -'sdformat-ci-sdf12-homebrew-amd64', -'sdformat-ci-sdf13-homebrew-amd64', -'sdformat-ci-sdf14-homebrew-amd64', -'sdformat-ci-main-homebrew-amd64', -'sdformat-sdf9-win', -'sdformat-sdf12-win', -'sdformat-sdf13-win', -'sdformat-sdf14-win', -'sdformat-main-win', -'sdformat-ci-sdf14-jammy-amd64', -'sdformat-ci-main-jammy-amd64', -'gz_fuel_tools-ci-ign-fuel-tools4-focal-amd64', -'gz_fuel_tools-ci-ign-fuel-tools7-focal-amd64', -'gz_fuel_tools-ci-gz-fuel-tools8-focal-amd64', -'gz_fuel_tools-ci-ign-fuel-tools4-homebrew-amd64', -'gz_fuel_tools-ci-ign-fuel-tools7-homebrew-amd64', -'gz_fuel_tools-ci-gz-fuel-tools8-homebrew-amd64', -'gz_fuel_tools-ci-gz-fuel-tools9-homebrew-amd64', -'gz_fuel_tools-ci-main-homebrew-amd64', -'gz_fuel_tools-ign-fuel-tools4-win', -'gz_fuel_tools-ign-fuel-tools7-win', -'gz_fuel_tools-8-win', -'gz_fuel_tools-9-win', -'gz_fuel_tools-main-win', -'gz_fuel_tools-ci-gz-fuel-tools9-jammy-amd64', -'gz_fuel_tools-ci-main-jammy-amd64', -'gz_transport-ci-ign-transport8-focal-amd64', -'gz_transport-ci-ign-transport11-focal-amd64', -'gz_transport-ci-gz-transport12-focal-amd64', -'gz_transport-ci-ign-transport8-homebrew-amd64', -'gz_transport-ci-ign-transport11-homebrew-amd64', -'gz_transport-ci-gz-transport12-homebrew-amd64', -'gz_transport-ci-gz-transport13-homebrew-amd64', -'gz_transport-ci-main-homebrew-amd64', -'gz_transport-ign-transport8-win', -'gz_transport-ign-transport11-win', -'gz_transport-12-win', -'gz_transport-13-win', -'gz_transport-main-win', -'gz_transport-ci-gz-transport13-jammy-amd64', -'gz_transport-ci-main-jammy-amd64', -'gz_gui-ci-ign-gui3-focal-amd64', -'gz_gui-ci-ign-gui6-focal-amd64', -'gz_gui-ci-gz-gui7-focal-amd64', -'gz_gui-ci-ign-gui3-homebrew-amd64', -'gz_gui-ci-ign-gui6-homebrew-amd64', -'gz_gui-ci-gz-gui7-homebrew-amd64', -'gz_gui-ci-gz-gui8-homebrew-amd64', -'gz_gui-ci-main-homebrew-amd64', -'gz_gui-ign-gui3-win', -'gz_gui-ign-gui6-win', -'gz_gui-7-win', -'gz_gui-8-win', -'gz_gui-main-win', -'gz_gui-ci-gz-gui8-jammy-amd64', -'gz_gui-ci-main-jammy-amd64', -'gz_sensors-ci-ign-sensors3-focal-amd64', -'gz_sensors-ci-ign-sensors6-focal-amd64', -'gz_sensors-ci-gz-sensors7-focal-amd64', -'gz_sensors-ci-ign-sensors3-homebrew-amd64', -'gz_sensors-ci-ign-sensors6-homebrew-amd64', -'gz_sensors-ci-gz-sensors7-homebrew-amd64', -'gz_sensors-ci-gz-sensors8-homebrew-amd64', -'gz_sensors-ci-main-homebrew-amd64', -'gz_sensors-ign-sensors3-win', -'gz_sensors-ign-sensors6-win', -'gz_sensors-7-win', -'gz_sensors-8-win', -'gz_sensors-main-win', -'gz_sensors-ci-gz-sensors8-jammy-amd64', -'gz_sensors-ci-main-jammy-amd64', -'gz_physics-ci-ign-physics2-focal-amd64', -'gz_physics-ci-ign-physics5-focal-amd64', -'gz_physics-ci-gz-physics6-focal-amd64', -'gz_physics-ci-ign-physics2-homebrew-amd64', -'gz_physics-ci-ign-physics5-homebrew-amd64', -'gz_physics-ci-gz-physics6-homebrew-amd64', -'gz_physics-ci-gz-physics7-homebrew-amd64', -'gz_physics-ci-main-homebrew-amd64', -'gz_physics-ign-physics2-win', -'gz_physics-ign-physics5-win', -'gz_physics-6-win', -'gz_physics-7-win', -'gz_physics-main-win', -'gz_physics-ci-gz-physics7-jammy-amd64', -'gz_physics-ci-main-jammy-amd64', -'gz_sim-ci-ign-gazebo3-focal-amd64', -'gz_sim-ci-ign-gazebo6-focal-amd64', -'gz_sim-ci-gz-sim7-focal-amd64', -'gz_sim-ci-ign-gazebo3-homebrew-amd64', -'gz_sim-ci-ign-gazebo6-homebrew-amd64', -'gz_sim-ci-gz-sim7-homebrew-amd64', -'gz_sim-ci-gz-sim8-homebrew-amd64', -'gz_sim-ci-main-homebrew-amd64', -'gz_sim-ign-gazebo3-win', -'gz_sim-ign-gazebo6-win', -'gz_sim-7-win', -'gz_sim-8-win', -'gz_sim-main-win', -'gz_sim-ci-gz-sim8-jammy-amd64', -'gz_sim-ci-main-jammy-amd64', -'gz_launch-ci-ign-launch2-focal-amd64', -'gz_launch-ci-ign-launch5-focal-amd64', -'gz_launch-ci-gz-launch6-focal-amd64', -'gz_launch-ci-ign-launch2-homebrew-amd64', -'gz_launch-ci-ign-launch5-homebrew-amd64', -'gz_launch-ci-gz-launch6-homebrew-amd64', -'gz_launch-ci-gz-launch7-homebrew-amd64', -'gz_launch-ci-main-homebrew-amd64', -'gz_launch-ign-launch2-win', -'gz_launch-ign-launch5-win', -'gz_launch-6-win', -'gz_launch-7-win', -'gz_launch-main-win', -'gz_launch-ci-gz-launch7-jammy-amd64', -'gz_launch-ci-main-jammy-amd64', -'gz_utils-ci-ign-utils1-focal-amd64', -'gz_utils-ci-gz-utils2-focal-amd64', -'gz_utils-ci-ign-utils1-homebrew-amd64', -'gz_utils-ci-gz-utils2-homebrew-amd64', -'gz_utils-ci-gz-utils2-homebrew-amd64', -'gz_utils-ci-main-homebrew-amd64', -'gz_utils-ign-utils1-win', -'gz_utils-2-win', -'gz_utils-2-win', -'gz_utils-main-win', -'gz_utils-ci-gz-utils2-jammy-amd64', -'gz_utils-ci-main-jammy-amd64' -]; +def JOBS_URL = 'https://raw.githubusercontent.com/gazebo-tooling/release-tools/master/jenkins-scripts/dsl/logs/generated_jobs.txt' -def trackedJobs = new LinkedHashSet(trackedJobsList); +def trackedJobs = new LinkedHashSet(); + +def get = new URL(JOBS_URL).openConnection(); +def getRC = get.getResponseCode(); +if(getRC.equals(200)) { + get.getInputStream().getText().split('\n').each { + line -> trackedJobs << (line =~ /.+? .+? (.+)/)[0][1]; + }; +} else { + throw new Exception("Error getting jobs list from ${JOBS_URL}. Return code: ${getRC}"); +} def jenkinsJobs = Hudson.instance