Skip to content

fix(scripts): make sweep-cf-orphans MAX_DELETE_PCT env override actually work - #2062

Merged
HongmingWang-Rabbit merged 1 commit into
stagingfrom
fix/sweep-script-env-override
Apr 26, 2026
Merged

fix(scripts): make sweep-cf-orphans MAX_DELETE_PCT env override actually work#2062
HongmingWang-Rabbit merged 1 commit into
stagingfrom
fix/sweep-script-env-override

Conversation

@HongmingWang-Rabbit

Copy link
Copy Markdown
Contributor

The script's own help text documents `MAX_DELETE_PCT=62 ./sweep-cf-orphans.sh` as the way to relax the 50% safety gate, but the in-script assignment on line 35 was unconditional and clobbered any env value — so the override never worked and the script would always refuse above 50%.

Hit this today while clearing CF zone buildup that was wedging staging tenant provisions. With the env honored, swept 64 orphans (36 e2e-tenant + 28 ws), zone went 111 → 47 of 200 cap.

One-char fix: `MAX_DELETE_PCT=50` → `MAX_DELETE_PCT=${MAX_DELETE_PCT:-50}`.

Related: CP #255 (cache-collision recovery), CP #239 (zone quota).

The script's own help text documents \`MAX_DELETE_PCT=62 ./sweep-cf-orphans.sh\`
as the way to relax the safety gate, but the in-script assignment on line 35
was unconditional and overwrote any env value — so the override never worked.

During today's staging tenant-provision recovery (CP #255 context), hit the
57%-delete threshold and needed the documented override to clear 64 orphan
records. The one-char change to \`\${MAX_DELETE_PCT:-50}\` honors the env
while keeping the 50% default when no caller overrides.

Ran with MAX_DELETE_PCT=62 after the fix — deleted 64 records, CF zone 111→47.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@HongmingWang-Rabbit
HongmingWang-Rabbit added this pull request to the merge queue Apr 26, 2026
Merged via the queue into staging with commit 944ddcb Apr 26, 2026
13 checks passed
@molecule-ai
molecule-ai Bot deleted the fix/sweep-script-env-override branch May 20, 2026 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant