Skip to content

refactor(fetch): diff roster against previous git revision instead of embedded snapshot#33

Open
howlsome wants to merge 2 commits into
mainfrom
issue-7-drop-prev-roster-snapshot
Open

refactor(fetch): diff roster against previous git revision instead of embedded snapshot#33
howlsome wants to merge 2 commits into
mainfrom
issue-7-drop-prev-roster-snapshot

Conversation

@howlsome

Copy link
Copy Markdown
Owner

Summary

Closes #7

changelog.json previously embedded a full copy of the roster (~13 KB) as prev_roster_snapshot to diff against on the next fetch run. This copy was committed twice a day alongside every data snapshot, inflating repo size significantly over time.

  • scripts/fetch.ts: Added a loadPrevRosterFromGit() helper that runs git show HEAD:data/roster.json and parses the result, returning null if unavailable (e.g. on the very first run, where no entries would be generated anyway). The changelog diff now uses this instead of the embedded snapshot. Removed prev_roster_snapshot from both the write path (changed roster) and the no-change pass-through write.
  • data/changelog.json: Removed the now-redundant prev_roster_snapshot field from the file (~1,056 lines / ~13 KB gone).

The ChangelogFile type in src/lib/types/changelog.ts already did not include prev_roster_snapshot, so no type changes were needed.

Test plan

  • pnpm lint passes
  • pnpm test:unit passes (325 tests)
  • Verify next scheduled fetch generates changelog entries correctly when the roster changes

j-mes added 2 commits June 18, 2026 09:33
… embedded snapshot

Removes `prev_roster_snapshot` from changelog.json — previously a ~13 KB
copy of the full roster committed twice daily. Changelog generation now diffs
the current roster against `git show HEAD:data/roster.json`, falling back to
null (no entries generated) on the first ever run.

Closes #7
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying relentless with  Cloudflare Pages  Cloudflare Pages

Latest commit: 38cd4f8
Status: ✅  Deploy successful!
Preview URL: https://b00d3cec.relentless-2cp.pages.dev
Branch Preview URL: https://issue-7-drop-prev-roster-sna.relentless-2cp.pages.dev

View logs

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.

Drop prev_roster_snapshot from changelog.json

2 participants