-
Notifications
You must be signed in to change notification settings - Fork 62
Open
Labels
Technical DebtTechnical DebtTechnical Debt
Milestone
Description
Summary
All feature branch builds are now pushed to SauceLabs (SL), causing build accumulation. We need a script to prune stale PR builds once they've been superseded by a release candidate on main.
Background
Our CI (ship-to-saucelabs action) uploads builds to SauceLabs with the following tagging scheme:
- PR builds: tagged
pr,pr-<number> - Main branch builds: tagged
rc
Build names include github.run_number (e.g. BCWallet-1234.ipa). Uploads target both iOS and Android across two build types (bc-wallet, single-app), so there are 4 artifacts per CI run.
API endpoint: https://api.us-west-1.saucelabs.com/v1/storage/ (auth via SAUCE_USERNAME + SAUCE_ACCESS_KEY).
Requirements
Pruning Logic
- Query SauceLabs storage API for all files tagged
rc - Extract the greatest build number (from the filename, e.g.
BCWallet-1234.ipa→1234) - Query all files tagged
pr - Delete any
pr-tagged file whose build number is less than the maxrcbuild number
Script
- Language: Node.js
- Location:
scripts/prune-saucelabs/(with its ownpackage.json) - Auth: Read
SAUCE_USERNAMEandSAUCE_ACCESS_KEYfrom environment variables - Dry-run by default: The script should default to dry-run mode (list what would be deleted). Require an explicit
--executeflag to actually delete. - Logging: Print a summary of what was found and what was (or would be) deleted
- Platforms: Prune both iOS (
.ipa) and Android (.aab) builds
Future Work (out of scope for this issue)
- Add a scheduled GitHub Action to run this script periodically
Acceptance Criteria
- Script lives at
scripts/prune-saucelabs/ - Defaults to dry-run;
--executeflag performs actual deletion - Correctly identifies max
rcbuild number and prunes olderprbuilds - Handles both iOS and Android artifacts
- Works with SauceLabs v1 storage API
- Logs clearly what it finds and what it deletes (or would delete)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Technical DebtTechnical DebtTechnical Debt