Cap build retention with branch-conditional properties() - #13
Open
jjpersch wants to merge 1 commit into
Open
Conversation
The job set no buildDiscarder at all, so every build was retained forever. Mainline now keeps 60 days/100 builds; PR and topic branches keep 30 days/5. Both caps are required: a day-only rotator keeps every build a busy job produces inside the window, which is unbounded disk on the controller -- the pattern behind the 2026-08-09 dev-build-cm disk-full outage. Same treatment as monetate-server PR 30702 (monetate/monetate-server#30702). Co-authored-by: Claude Fable 5 <noreply@anthropic.com> Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds branch-conditional Jenkins job properties to enforce bounded build retention, preventing unbounded /var/lib/jenkins growth and future disk-full outages.
Changes:
- Apply
buildDiscarder(logRotator(...))via top-levelproperties()for all branches. - Use stricter retention on non-mainline branches (30 days / 5 builds) while keeping mainline longer (60 days / 100 builds).
- Preserve existing non-mainline
disableConcurrentBuilds(abortPrevious: true)behavior.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Riccardo-Maio
approved these changes
Aug 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a branch-conditional
buildDiscarderso builds stop being retained forever. Mainline keeps 60 days/100 builds; PR and topic branches keep 30 days/5.Background
The 2026-08-09 dev-build-cm disk-full outage was caused by unbounded Jenkins build retention: the controller's 250G
/var/lib/jenkinsvolume hit 99% and the built-in node went offline, blocking all builds and the multibranch scans that prune closed-PR jobs. A fleet audit after the incident found this repo's Jenkinsfile sets nobuildDiscarderat all, so its jobs retain every build indefinitely. The volume here is far lower than the repos that actually filled the disk, so this is preventive rather than urgent — but it is the same unbounded shape, and the existing top-levelproperties()call makes the fix a small one.What changed
properties()call now owns build retention for every branch: mainline getslogRotator(daysToKeepStr: '60', numToKeepStr: '100'), PR/topic branches getlogRotator(daysToKeepStr: '30', numToKeepStr: '5')alongside the existingdisableConcurrentBuilds(abortPrevious: true).Verification
Deployment plan and risks
Merging is the deployment; jobs pick the new retention up on their next run. No declarative
options{}block in this repo owns a discarder, soproperties()is the sole owner and there is no transitional run without one. Build history beyond the caps is permanently discarded on the next run's post-build cleanup; if older build logs from this repo are still wanted, export them before merging.