feat(renovate): throttle Renovate and ccf-bump sync for plugin batches #110
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #110"
general
weight: 0.35
gusfcarvalho
Gets Renovate and the ccf-bump sync ready for the plugin batches: once batch 1 (later 2 and 3) is active, a run must not flood the org (the plan's target is about 15 PRs an hour), and a batch must be checkable with a dry run before it is switched on.
Renovate throttle: shards of at most 15 repos, one per run
prHourlyLimitis per repo, so with 37 active repos even1allows 37 PRs an hour. Renovate 44.145.1 (the pinned version) has one global limit, the self-hostedprCommitsPerRunLimit. I didn't use it:lib/workers/global/index.tsstops processing the remaining repos for that run. Those repos then get no vulnerability fixes and no auto-merges that run, and the repos at the head of the list always go first.Instead:
dry_run: off) works on one shard of at most 15 repos (renovate.MaxLiveRepos). Repoiof the active repos goes to shardi mod n, withn = ceil(repos / 15). The run takes shardslot mod n, whereslotis the workflow's run number (github.run_number). The workflow passes the same slot to bothlist(the token's scope) andconfig, and a re-run keeps its number and its shard.renovate.ymlruns hourly (17, was daily at 06:17), and the shards take turns per run: each run takes the next shard, so each repo is visited everynruns (everynhours when runs are on time).mainran at 12:53, 14:14 and 15:29). With the clock hour, a dropped run never advanced the rotation and runs bunched into one hour repeated a shard. With the run number, a late or dropped run only slows the rotation and never skips a shard. A dispatch takes a run number too: a live dispatch on every active repo is just the next step, while a dry run (or a live run withreposset) leaves its shard for the next rotation.prHourlyLimitgoes from 4 to 1.prHourlyLimit,prCommitsPerRunLimitandschedule(its docs, andlib/workers/global/limits.tsandlib/workers/repository/update/branch/index.ts), so each visit opens every fix a repo needs. They wait at most one rotation for their repo's shard.Worst case for non-vulnerability PRs across the org (
repos.yaml: 7 core repos; batch 1 has 30, batch 2 27, batch 3 10):| Active batches | Active repos | Shards | PRs in one run | Two runs close together | Each repo visited every |
| --- | --- | --- | --- | --- | --- |
| none (today) | 7 | 1 | 7 | 7 (14 across the top of the hour) | 1 run |
| 1 | 37 | 3 | 13 | 25 | 3 runs |
| 1, 2 | 64 | 5 | 13 | 26 | 5 runs |
| 1, 2, 3 | 74 | 5 | 15 | 30 | 5 runs |
One run opens at most about 15, and a repo at most one per clock hour (
prHourlyLimit). Runs never overlap (therenovateconcurrency group queues the next one), but GitHub can start two close together (a late run then an on-time one, or a manual live dispatch next to a scheduled run). They take different shards, so a short window can see about two shards' worth, ~30 with every batch active. Vulnerability PRs come on top of these and are deliberately not capped. A side effect: Renovate's merge lag drops from up to a day to at most one rotation (5 runs, about 5 hours when runs are on time).ccf-bump sync:
--batch 10alone wasn't acceptable, so it changedTen PRs an hour is within the target, but with batches active the old single job would fail:
release: truerepos;timeout-minutes: 300.Now:
selectjob runsccf-bump list --chunk 10;syncmatrix job runs per chunk (max-parallel: 1,fail-fast: false), each with its own token scoped to its chunk;ccf-bump syncnow writesprs=<N>to$GITHUB_OUTPUT.Worst case is 10 PRs an hour for any number of batches. Live runs take about 3.5 h (batch 1), 5.5 h (1 and 2) or 6.5 h (all three) when every repo gets a PR.
ccf-bump-sync.ymlalso gains thereposdispatch input it lacked.Dry run before activation
renovate-config list|configpasses--dry-runtorenovate.SelectRepos, which callsmanifest.Select(names, dryRun != "off").ccf-bumppasses--dry-runtoselectRepos, which callsmanifest.Select(names, dryRun). Inactive repos stay in stage order: they are ordered on a copy of the manifest with their batch switched on.-
internal/renovate/batches_test.goandcmd/ccf-bump/batches_test.go: the selection tables;-
cmd/renovate-config/main_test.go:TestRunDryRunInactive, plus live rejections inTestRunErrors;-
cmd/ccf-bump/batches_test.go:TestRunDryRunInactive, wherelist/sync/merge/--repowithout--dry-runreject inactive repos.docs/manifest.md"Switching a batch on" gains step 5: dispatch both workflows as dry runs with the batch's repos, read the plans, then open the activation PR.Verified locally
go test -race ./...on macOS, and in agolang:1.26container with bash 5, jq and yq (no skipped step tests);go vet ./...andgofmt -l .(clean);go run ./cmd/manifestonrepos.yamlandrepos.mock.yaml;TestShardchecks that anynconsecutive run numbers take every shard exactly once, so each repo is visited exactly once pernruns, for 7, 37, 64 and 74 repos;repos.yaml. The batch 1 dry-run list splits into 3 chunks, the live list rejects batch 1, and the live Renovate list is today's 7 repos.I didn't run Renovate, ccf-bump or any workflow.
Open questions for reviewers
ccf-bump-sync'sselectjob readsvars.CCF_BUMP_SYNC_LIVEoutside thereleaseenvironment. The docs call it a repo variable, so nothing changes. If it were only an environment variable, scheduled runs would stay dry runs, which fails safe.Task: W3-S4-T01 (local-dev/docs/release-automation/workstream-3-plugins-in-train.md)
🤖 Generated with Claude Code