fix(rebuild): re-index and purge the CDN after a rebuild #160
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/rebuild-reindex-and-purge"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The rebuild now works —
AATtools 0.0.3was detected as a source fallback, built, and published:But clients still get the source, and will for about a year:
Two causes, both specific to a rebuild:
weekly-rebuild-missinghas noupload_package_indexstep, so the index keeps the old MD5 and — for anything that had been served from source — noBuiltstamp. This one self-heals at the nextprocess-updatesrun.purge_cdn_cache.shonly needs the five index files. A rebuild replaces an object in place, and the zone caches tarballs forcache_expiration_time = 31919000(~370 days). This does not self-heal.Nothing about a stale package looks wrong from the outside, which is what makes it worth fixing rather than documenting.
What this changes
Re-index at the end of a rebuild, flat and per-minor, mirroring the tail of
process-updates. The codename is detected from the image's/etc/os-release(aslocal/packages-to-build.Ralready does) rather than addingOS_IDto all 18 matrix rows.Purge the zone afterwards, via a new
scripts/purge_cdn_zone.sh. One call toPOST /pullzone/{id}/purgeCachecovers every replaced object, and all three hostnames —cran.devxy.io,cran.allianceswisspass.devxy.io,cran.rpkgs.com— share pull zone3857050, confirmed from thecdn-pullzoneresponse header.Purging per URL was the alternative and is worse here: ~13.5k rate-limited calls per arch, where a single missed call leaves a package silently stale. The cost of the zone purge is a cold cache for everything else, which is why it stays out of the daily update path —
purge_cdn_cache.shis untouched.The purge runs on failure too (
when: status: [success, failure]): a rebuild that died part-way still replaced objects, and those are exactly the ones a stale edge keeps hiding.Verification
crow lint .crow/reports all ten configs valid;bash -non the new script passes; prek hooks pass.Not yet exercised against Bunny — it needs
BUNNYNET_API_KEY, which is a CI secret. The failure mode is explicit rather than silent: any status other than 200/204 prints the response body and exits non-zero.