Skip to content

fix(ci): bound sync-issues re-sync on cache miss - #981

Merged
c-vigo merged 1 commit into
devfrom
bugfix/980-sync-issues-cache-miss
Jul 11, 2026
Merged

c-vigo merged 1 commit into
devfrom
bugfix/980-sync-issues-cache-miss

Conversation

@c-vigo

@c-vigo c-vigo commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #980: the scaffolded sync-issues workflow re-synced the entire issue/PR history from epoch on any cache miss, exhausting the GitHub API rate limit and failing every run. Hit in production right after the vig-os/devcontainer → vig-os/devkit rename (#781) orphaned the repo-name-keyed state cache.

Fix

On a cache miss, compute a bounded 14-day look-back and pass it as updated-since instead of epoch:

  • Sync stays small → completes under the rate limit → saves state → self-heals to incremental thereafter.
  • Covers the 7-day cache-eviction gap with margin; older items already live in the committed archives.
  • Cache hit → still reads the restored state file (unchanged). force-update → still a full rebuild (unchanged).

Applied to both .github/workflows/sync-issues.yml and the scaffold template assets/workspace/.github/workflows/sync-issues.yml, so every consumer gets it (this is a general cache-miss fragility, not rename-specific).

Not in scope

Defense-in-depth rate-limit-aware checkpointing belongs in vig-os/sync-issues-action — a separate, lower-priority issue there.

Testing

just precommit (full suite incl. actionlint / yamllint) — green. Logic: force-update ? epoch : (cache-hit ? '' (use state file) : 14d-lookback).

Refs: #980

The scaffolded sync-issues workflow keyed its incremental-state cache by
repository name and passed updated-since='' to the sync action when no state was
restored, so any cache miss (a repo rename, or the routine 7-day cache eviction)
made the action re-fetch the entire issue/PR history from epoch. On a large
archive that exhausts the GitHub API rate limit before state is saved, so the
workflow fails every run and never self-heals.

On a cache miss, compute a bounded 14-day look-back cutoff and pass it as
updated-since instead of epoch: the sync stays small, completes under the rate
limit, saves state, and self-heals to incremental. Cache hits still read the
restored state file; force-update still forces a full rebuild. Applied to this
repo's workflow and the scaffold template so every consumer gets the fix.

Refs: #980
@c-vigo
c-vigo merged commit 9a35b19 into dev Jul 11, 2026
13 checks passed
@c-vigo
c-vigo deleted the bugfix/980-sync-issues-cache-miss branch July 11, 2026 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant