fix(ci): actually purge BunnyCDN cache in purge_cdn_cache.sh #78

Merged
pat-s merged 1 commit from pr/purge-cdn-cache-fixes into main 2026-06-08 08:31:03 +00:00
Owner

Summary

While cleaning this up I noticed the script defined purge_cdn_cache() but never called it. Every CI run only declared the helper and exited cleanly without issuing a single curl. The PACKAGES freshness on cran.devxy.io / cran.rpkgs.com has been carried entirely by R's Cache-Control: no-cache header on the index files.

Fixes in one shot:

  1. Actually run the purge. The shifted args (api_key, arch, os_id, domain…) are now consumed inline and a curl POST is issued per (domain × resource).
  2. Drop set -x — leaked the AccessKey: header into job logs.
  3. Drop the Python URL-encoder. curl -G --data-urlencode "url=…" --data "async=false" https://api.bunny.net/purge does the same with no Python. The workflow purge steps can later switch from alpine:3.23 + apk add bash curl to a slimmer curl-only image.
  4. Add src/contrib/Meta/archive.rds to the purged resource list. It's rewritten on every process_cran_updates run (see README) and was being served stale.

Risks

  • This is the first time the script actually purges anything. If anything else (e.g. a downstream service) relied on the no-op behavior, this PR is the moment it stops being silent. I don't see any such caller.
  • Edge cache miss right after a purge means an origin S3 fetch — minor latency uptick on the first request per region per resource.
## Summary While cleaning this up I noticed the script **defined** `purge_cdn_cache()` but never **called** it. Every CI run only declared the helper and exited cleanly without issuing a single curl. The PACKAGES freshness on cran.devxy.io / cran.rpkgs.com has been carried entirely by R's `Cache-Control: no-cache` header on the index files. Fixes in one shot: 1. **Actually run the purge.** The shifted args (`api_key`, `arch`, `os_id`, `domain…`) are now consumed inline and a curl POST is issued per (domain × resource). 2. **Drop `set -x`** — leaked the `AccessKey:` header into job logs. 3. **Drop the Python URL-encoder.** `curl -G --data-urlencode "url=…" --data "async=false" https://api.bunny.net/purge` does the same with no Python. The workflow purge steps can later switch from `alpine:3.23 + apk add bash curl` to a slimmer curl-only image. 4. **Add `src/contrib/Meta/archive.rds`** to the purged resource list. It's rewritten on every `process_cran_updates` run (see README) and was being served stale. ## Risks - This is the **first time** the script actually purges anything. If anything else (e.g. a downstream service) relied on the no-op behavior, this PR is the moment it stops being silent. I don't see any such caller. - Edge cache miss right after a purge means an origin S3 fetch — minor latency uptick on the first request per region per resource.
The script defined a purge_cdn_cache() function but never invoked it,
so every CI run only declared the helper and exited cleanly without
issuing a single curl. The CDN had been relying entirely on the
Cache-Control: no-cache headers R writes onto PACKAGES* objects.

Rewrite to call the purge inline; while here:
- drop `set -x` (leaked the AccessKey header into logs)
- drop the python3 urlencoder; `curl --data-urlencode` does the
  same with no Python dep, so the workflow purge step no longer
  needs `apk add bash curl` over `curl --data-urlencode`-capable
  curl alone
- add `src/contrib/Meta/archive.rds` to the resource list - it
  changes during process-updates and was being served stale
pat-s merged commit 228459c0ba into main 2026-06-08 08:31:03 +00:00
pat-s deleted branch pr/purge-cdn-cache-fixes 2026-06-08 08:31:04 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
devxy/build-cran-binaries!78
No description provided.