fix(build): recompute a stale package snapshot, not just a missing one #190
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/snapshot-staleness"
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?
Motivation
arm64/alpine324reported nothing to build while thousands were missing:Both numbers come from the same pipeline. The same run's index step dropped 2407 packages as missing for 4.4 and 2436 for 4.6.
Cause
Existence is not freshness. The snapshot describes S3 and CRAN state when it was written, and the cache volume is per-agent — the file's own comment says so. An agent that ran an earlier pipeline keeps serving that pipeline's answer forever, and no later fix to how the snapshot is computed (#189) can reach it.
Change
Recompute when the snapshot is stale as well as when it is missing. Keyed on the pipeline when the CI exposes an identifier (
CI_PIPELINE_NUMBER,CI_BUILD_NUMBER,CI_PIPELINE_ID), so a new pipeline recomputes once per agent and its shards then share the result. Off CI, or when none is set, an age check with a two hour default (PACKAGE_SNAPSHOT_TTL_HOURS).Verification
I could not confirm which identifier Crow actually sets — none is referenced anywhere in this repo — so all three are tried and the age check backs them up. If none is present the behaviour is the age path, which is still correct, just coarser.