Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into jrivero/remove_inde…
Browse files Browse the repository at this point in the history
…xes_noble_prs
  • Loading branch information
j-rivero committed May 16, 2024
2 parents 0b99e37 + 5a29f98 commit 2b11bf2
Showing 1 changed file with 31 additions and 30 deletions.
61 changes: 31 additions & 30 deletions jenkins-scripts/dsl/gazebo_libs.dsl
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,12 @@ boolean are_cmake_warnings_enabled(lib_name, ci_config)
}

/*
* TODO: deprecated, migrate the pkgconf_per_src index to use new branch_index
* or generate a new one together with the branch_index
*
* Generate an index that facilitates the operations with the yaml values,
* avoiding to parse them several times.
*
* # ci_configs_by_lib index structure:
* lib_name : [ ci_config_name : [ .branch .collection ] ]
*
* The index main keys are the lib names (i.e: gz-cmake) and associated them
* another map of CI configuration names supported as keys (i.e: jammy) with the
* list of associated items composed by a map: branch (and collection) that CI configuration
* (i.e [[branch:gz-cmake3, collection: harmonic], [branch: gz-cmake3, collection: garden])
* as values. In a graphic;
*
* index[gz-cmake][jammy] -> [ branch: gz-cmake3, collection: garden ,
* branch: gz-cmake3, collection: harmonic]
*
* # pkgconf_per_src index structure:
* pkg_src_name : [ packaging_config_name : [ .lib_name .collection ] ]
*
Expand All @@ -94,16 +85,12 @@ boolean are_cmake_warnings_enabled(lib_name, ci_config)
*
* index[gz-cmake3][jammy] -> [ lib_name: gz-cmake, collection: harmonic ]
*/
void generate_ciconfigs_by_lib(config, ciconf_per_lib_index, pkgconf_per_src_index)
void generate_ciconfigs_by_lib(config, pkgconf_per_src_index)
{
config.collections.each { collection ->
collection.libs.each { lib ->
def libName = lib.name
def branch = lib.repo.current_branch
collection.ci.configs.each { config_name ->
ciconf_per_lib_index[libName][config_name] = ciconf_per_lib_index[libName][config_name]?: []
ciconf_per_lib_index[libName][config_name].contains(branch) ?: ciconf_per_lib_index[libName][config_name] << [branch: branch, collection: collection.name]
}
def pkg_name = lib.name + lib.major_version
if (collection.packaging.linux?.ignore_major_version?.contains(libName))
pkg_name = lib.name
Expand Down Expand Up @@ -320,9 +307,8 @@ def generate_debbuilder_job(src_name, ArrayList pre_setup_script_hooks)
}
}

def ciconf_per_lib_index = [:].withDefault { [:] }
def pkgconf_per_src_index = [:].withDefault { [:] }
generate_ciconfigs_by_lib(gz_collections_yaml, ciconf_per_lib_index, pkgconf_per_src_index)
generate_ciconfigs_by_lib(gz_collections_yaml, pkgconf_per_src_index)
/*
*
* Loop over each collection, inside each collection loop over the ci configurations assigned
Expand Down Expand Up @@ -353,19 +339,16 @@ gz_collections_yaml.collections.each { collection ->
platform = 'windows'
}
branch_index[lib_name][platform] = branch_index[lib_name][platform]?: ['pr':[], 'pr_abichecker':[]]
if (! ci_config.exclude.all?.contains(lib_name))
if (categories_enabled.contains('pr'))
{
if (categories_enabled.contains('pr'))
{
branch_index[lib_name][platform]['pr'].contains(branch_name) ?:
branch_index[lib_name][platform]['pr'] << [branch: branch_name, ci_name: config_name]
}
if (categories_enabled.contains('pr_abichecker') &&
branch_index[lib_name][platform]['pr'].contains(branch_name) ?:
branch_index[lib_name][platform]['pr'] << [branch: branch_name, ci_name: config_name]
}
if (categories_enabled.contains('pr_abichecker') &&
(! ci_config.exclude.abichecker?.contains(lib_name)))
{
branch_index[lib_name][platform]['pr_abichecker'].contains(branch_name) ?:
branch_index[lib_name][platform]['pr_abichecker'] << [branch: branch_name, ci_name: config_name]
}
{
branch_index[lib_name][platform]['pr_abichecker'].contains(branch_name) ?:
branch_index[lib_name][platform]['pr_abichecker'] << [branch: branch_name, ci_name: config_name]
}

// Generate jobs for the library entry being parsed
Expand Down Expand Up @@ -440,6 +423,24 @@ branch_index.each { lib_name, distro_configs ->
ENABLE_CPPCHECK,
branch_names)
generate_label_by_requirements(gz_ci_any_job, lib_name, ci_config.requirements)
gz_ci_any_job.with
{
steps
{
shell("""\
#!/bin/bash -xe

export DISTRO=${distro}

${GLOBAL_SHELL_CMD}
${extra_cmd}

export BUILDING_SOFTWARE_DIRECTORY=${lib_name}
export ARCH=${arch}
/bin/bash -xe ./scripts/jenkins-scripts/docker/${script_name_prefix}-compilation.bash
""".stripIndent())
} // end of steps
} // end of ci_any_job
} else if (ci_config.system.so == 'darwin') {
// --------------------------------------------------------------
def gz_brew_ci_any_job_name = "${gz_job_name_prefix}-ci-pr_any-homebrew-amd64"
Expand Down

0 comments on commit 2b11bf2

Please sign in to comment.