-
Notifications
You must be signed in to change notification settings - Fork 11
73 lines (63 loc) · 3.11 KB
/
Copy pathe2e-cleanup.yml
File metadata and controls
73 lines (63 loc) · 3.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: E2E Cleanup
on:
schedule:
- cron: "0 4 * * 0" # Sunday 04:00 UTC, after the nightly window
workflow_dispatch:
permissions:
contents: read
issues: write # for filing if cleanup fails
jobs:
sweep:
name: Sweep rotating E2E state
runs-on: ${{ github.repository_owner == 'paritytech' && 'parity-default' || 'ubuntu-latest' }}
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Sweep rotating moddable repos
shell: bash
env:
# Same PAT as the nightly-deploy-moddable cell — it has
# delete_repo scope. Rotate "Playground CLI cold start test"
# before 2026-08-20.
GH_TOKEN: ${{ secrets.E2E_GH_PAT }}
run: |
set -euo pipefail
# 7-day retention (spec called for 14; tightening surfaces
# cleanup-cron regressions sooner while Summit is close).
# `date -u -d` only works on GNU coreutils (Linux); we never
# run this on macOS, so no need for portable date arithmetic.
cutoff=$(date -u -d '7 days ago' +%Y-%m-%dT%H:%M:%SZ)
echo "::group::Sweep plan"
echo "Cutoff (delete repos created before this):"
echo " ${cutoff}"
echo "Filter: paritytech/* repos tagged 'e2e-test-fixture'"
echo " (set by tests at e2e/cli/helpers/moddable-setup.ts)"
echo "::endgroup::"
# `gh repo list` paginates implicitly via --limit; 200 is
# generous for the daily-nightly + 7-day cadence (max ~7
# repos in flight before cleanup runs). Bump if we ever
# add more per-run rotating repos.
candidates=$(gh repo list paritytech \
--topic e2e-test-fixture \
--limit 200 \
--json name,createdAt \
--jq ".[] | select(.createdAt < \"${cutoff}\") | .name")
if [ -z "${candidates}" ]; then
echo "no repos to sweep"
exit 0
fi
echo "::group::Deleting"
while read -r name; do
[ -n "${name}" ] || continue
echo " paritytech/${name}"
gh repo delete "paritytech/${name}" --yes
done <<< "${candidates}"
echo "::endgroup::"
# Known limitation: this sweep only handles GH repos. The
# on-chain registry entry at e2emoddab00.dot accumulates
# cumulative re-publishes (same domain, same owner, so the
# registry-side keeps growing CIDs over time) — that's
# bounded (one fixed domain) and benign. A future
# tools/sweep-moddable-domains.ts could prune historical
# CIDs, but we don't have a public DotNS-side delete API
# today and adding one is out of scope for Phase 5e.