Skip to content

Commit

Permalink
Add a check to avoid infinite number of builds archived by a job (#1187)
Browse files Browse the repository at this point in the history
* Add a check to avoid infinite number of builds archived by a job
* Restrict the builds to keep to 75 in infinite configurations

---------
Signed-off-by: Jose Luis Rivero <[email protected]>
  • Loading branch information
j-rivero authored Oct 9, 2024
1 parent 606af28 commit 6826bdd
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions jenkins-scripts/dsl/_configs_/OSRFLinuxBackportPkg.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class OSRFLinuxBackportPkg

logRotator {
artifactNumToKeep(20)
numToKeep(75)
}

parameters {
Expand Down
1 change: 1 addition & 0 deletions jenkins-scripts/dsl/brew_release.dsl
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ bottle_job_builder.with

logRotator {
artifactNumToKeep(10)
numToKeep(75)
}

axes {
Expand Down
1 change: 1 addition & 0 deletions jenkins-scripts/dsl/debian.dsl
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ ratt_pkg_job.with

logRotator {
artifactNumToKeep(10)
numToKeep(75)
}

concurrentBuild(true)
Expand Down
9 changes: 7 additions & 2 deletions jenkins-scripts/dsl/dsl_checks.bash
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ if [[ -n ${empty_branches_on_github_triggered} ]]; then
exit 1
fi

# re-enable after https://github.com/gazebo-tooling/release-tools/issues/1095

# Filter out the previous auto jobs
filtered_dir=$(mktemp -d)
cp -- *-abichecker-*.xml "${filtered_dir}"
Expand All @@ -76,3 +74,10 @@ if [[ -n ${repeated} ]]; then
echo "please exclude one of the versions in the yaml file to reduce the server workload"
exit 1
fi

avoid_infinite_build_archive=$(grep '<numToKeep>-1</numToKeep>' -- *.xml || true)
if [[ -n ${avoid_infinite_build_archive} ]]; then
echo "Found a job setup to keep infinite number of builds. This is BAD"
echo "${avoid_infinite_build_archive}"
exit 1
fi
1 change: 1 addition & 0 deletions jenkins-scripts/dsl/extra.dsl
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ gbp_repo_debbuilds.each { software ->

logRotator {
artifactNumToKeep(10)
numToKeep(75)
}

concurrentBuild(true)
Expand Down

0 comments on commit 6826bdd

Please sign in to comment.