ci(migrations): confine snapshot cache lookup to a 3-day date window#285
Merged
Conversation
An unbounded prefix restore searches the PR's own ref scope before the base branch, so one stale PR-scoped snapshot shadows fresh dev-scoped ones forever (daily CI use keeps it from evicting). PR #280 was pinned to a 2026-07-10 previewnet snapshot that predates the on-chain DeregisterAnnouncementPeriod fix and permanently failed the try_state timing invariant added in #276. Both jobs now look up snapshots only under explicit dated keys (today/yesterday/day-before, UTC), so a restored snapshot is at most two days old regardless of cache scope; the nightly 5AM refresh keeps PRs from regenerating in practice. Stale branch-scoped entries become unreachable and evict naturally.
bkontur
reviewed
Jul 14, 2026
| # to regenerate. `cache-matched-key` is empty iff nothing was found, which | ||
| # is also the case on the daily `schedule` (lookup skipped) so the | ||
| # snapshot is force-refreshed nightly. | ||
| # Snapshot lookup is confined to an explicit 3-day key window (today, |
Collaborator
There was a problem hiding this comment.
@danielbui12 please tell you assistant to minimalize docs
Collaborator
|
@danielbui12 if we have a problem with outdated snapshot, we can just remove the snapshot from https://github.com/paritytech/web3-storage/actions/caches |
Member
Author
|
@bkontur yep, I use gh cli to kill stale cache |
bkontur
reviewed
Jul 14, 2026
| shell: bash | ||
| run: | | ||
| echo "today=$(/bin/date -u '+%Y%m%d')" >> "$GITHUB_OUTPUT" | ||
| echo "yesterday=$(/bin/date -u -d '1 day ago' '+%Y%m%d')" >> "$GITHUB_OUTPUT" |
Collaborator
There was a problem hiding this comment.
just out of curiosity, what if prepare-snapshots: runs before midnight and check-migrations after midnight?
bkontur
approved these changes
Jul 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
CI restored try-runtime snapshots via an unbounded prefix key (
try-runtime-snapshot-<name>-). GitHub Actions cache prefers the PR's own ref scope over the base branch, so one stale PR-scoped snapshot shadows fresh dev-scoped ones indefinitely - daily use keeps it from evicting.Example: PR #280 was pinned to a 2026-07-10 previewnet snapshot predating the
DeregisterAnnouncementPeriodfix (10 -> 15), so itscheck-migration (web3-storage-paseo)job always failed theDeregisterAnnouncementPeriod > ChallengeTimeouttry_state invariant from #276, while the same code passed ondev.Changes
Both
prepare-snapshotsandcheck-migrationsnow look up snapshots only under explicit dated keys (today / yesterday / day-before, UTC):Get Datestep is folded into the newdatesstep.Since we are changing the runtime pretty frequently so keeping the cache period in short time would be better
Issue
Diagnosed while verifying the failing runtime-migration check on #280.