[Pages] Add PowerShell deployment cleanup script example#32273
Open
MattieTK wants to merge 4 commits into
Open
[Pages] Add PowerShell deployment cleanup script example#32273MattieTK wants to merge 4 commits into
MattieTK wants to merge 4 commits into
Conversation
Replace both the macOS/Linux and Windows PowerShell examples with versions that take the project name as an argument, detect the production deployment via its Environment field, and delete preview deployments in parallel.
When no production deployment exists, the cleanup scripts now explain that one is required and point to deploying to the production branch (with an example wrangler command) instead of failing with a bare abort message.
Contributor
|
This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:
|
Contributor
|
Preview URL: https://465f04d1.preview.developers.cloudflare.com Files with changes (up to 15) |
MattieTK
marked this pull request as ready for review
July 23, 2026 16:34
MattieTK
requested review from
a team,
GregBrimble,
WalshyDev,
aninibread and
irvinebroque
as code owners
July 23, 2026 16:34
Contributor
Review
👉 Fix in your agent 👈Fix the following review findings in PR #32273 (https://github.com/cloudflare/cloudflare-docs/pull/32273).
Before making changes, review each finding and present a brief summary table:
- For each finding, state whether you agree, disagree, or need clarification
- If you disagree (e.g. the fix requires disproportionate effort for minimal benefit,
or the finding is factually incorrect), explain why
- If you need clarification before deciding, ask those questions
- Then share your plan for which issues to tackle and in what order
After triaging, follow this order:
1. Post a comment on this PR for any findings you are skipping, with the finding ID and your reasoning.
2. Then commit the fixes for the legitimate findings.
The comment must come before the commit — the bot reads PR comments when a new
push triggers a review, so skip comments posted after the push will be missed.
---
## Code Review
### Warnings (2)
#### CR-516ee9ab1f3f · PowerShell version mismatch
- **File:** `src/content/docs/pages/platform/known-issues.mdx` line 178
- **Issue:** ForEach-Object -Parallel and -ThrottleLimit are PowerShell 7+ only, but the tab is labeled 'Windows PowerShell' (the legacy 5.1 runtime), so users on that runtime will get a parameter binding error and the script will not run.
- **Fix:** Rename the tab to 'PowerShell 7+' or rewrite the script to use Start-Job/RunspacePool so it works in Windows PowerShell 5.1.
#### CR-47ad1532eea0 · Deletion failures silently ignored
- **File:** `src/content/docs/pages/platform/known-issues.mdx` line 144
- **Issue:** The inner sh -c uses `... || echo 'FAILED: $1'`. Because echo succeeds, the inner shell exits 0, so xargs exits 0 and the script prints 'Done.' even if every deletion failed.
- **Fix:** Aggregate failed IDs and exit non-zero when any deletion fails, matching the PowerShell script's failure handling.
---
## Style Guide Review
### Suggestions (1)
#### SG-74bbeb747de4 · Remove LLM-filler phrase
- **File:** `src/content/docs/pages/platform/known-issues.mdx` line 198
- **Issue:** Line begins with "Note that" before stating a fact.
- **Fix:** State the fact directly: "These scripts will not delete the active production deployment if one exists."
Code ReviewThis code review is in beta and may not always be helpful — use your judgment. Warnings (2)
ConventionsNo convention issues found. Style Guide ReviewSuggestions (1)
CommandsOnly codeowners can run commands. Post a comment with the command to trigger it.
|
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
Adds a Windows PowerShell version of the Pages deployment cleanup script alongside the existing macOS/Linux shell version (now in tabs), and improves both scripts to detect the production deployment by environment rather than by ID matching, run deletions in parallel, and print explicit guidance to create a production deployment first if none exists.
Continues the work from #31756 (opened by @AlexMnrs), moved here since I don't have push access to that branch's fork. Closes #31753.
Documentation checklist