| … | … | @@ -0,0 +1,141 @@ | |
| 130 | + | run: | | |
| 131 | + | failed=0 | |
| 132 | + | for number in $(gh pr list --repo "$GITHUB_REPOSITORY" --state closed \ | |
| 133 | + | --label "relay:preview" --limit 200 --json number --jq '.[].number'); do | |
🟡 Medium workflows/relay-preview-cleanup.yml:132
When gh pr list fails, this job exits successfully without attempting any stage teardown, leaving closed relay:preview stages behind. The command substitution's failure is ignored in the for list, so failed stays 0; capture and check the PR list before iterating.
No longer relevant as of 554f4562287e6b13057cae6d780337992f53bfc4
| … | … | @@ -0,0 +1,141 @@ | |
| 130 | + | run: | | |
| 131 | + | failed=0 | |
| 132 | + | for number in $(gh pr list --repo "$GITHUB_REPOSITORY" --state closed \ | |
| 133 | + | --label "relay:preview" --limit 200 --json number --jq '.[].number'); do | |
🟡 Medium workflows/relay-preview-cleanup.yml:133
When more than 200 closed PRs carry the relay:preview label, this job never examines PRs beyond the first 200, so their failed teardowns can leave preview resources running indefinitely. --limit 200 caps the inventory on every nightly run; paginate through all eligible PRs or track outstanding stages instead.
No longer relevant as of 554f4562287e6b13057cae6d780337992f53bfc4
| … | … | @@ -0,0 +1,141 @@ | |
| 133 | + | --label "relay:preview" --limit 200 --json number --jq '.[].number'); do | |
| 134 | + | stage="pr-$number" | |
| 135 | + | echo "::group::$stage" | |
| 136 | + | vp run --filter t3code-relay destroy --stage "$stage" --yes --no-input \ | |
🟠 High workflows/relay-preview-cleanup.yml:136
The nightly sweep can destroy a newly redeployed preview for a reopened PR, including its database branch. It runs in the relay-preview-sweep concurrency group, which does not serialize with that PR’s deployment group, and the loop destroys the previously listed stage without rechecking whether the PR is still closed and labeled. Run each teardown under the same per-PR lock as deployments and recheck eligibility after acquiring it.
No longer relevant as of e06f4f7a812a8318fd958df07b9590b648f2c4a7