feat(developer-hub): add Change Log page under Price Feeds#3674
feat(developer-hub): add Change Log page under Price Feeds#3674aditya520 wants to merge 9 commits into
Conversation
Renders a daily record of price-feed status transitions
(added / went live / removed) at /price-feeds/changelog.
The page is a Fumadocs MDX entry that mounts a client
component supplying a week-summary callout, By-day and
Stream views, filter chips, and a provenance footer.
Data flow:
pyth.dourolabs.app/v1/symbols
│ daily GitHub Action @ 00:30 UTC
▼
apps/developer-hub/data/changelog-snapshots/<date>.json
│ scripts/generate-changelog.ts (turbo build dep)
▼
apps/developer-hub/src/components/ChangeLog/generated-data.ts
│ imported by data.ts → getChangeLog()
▼
<ChangeLog/> client component
The generated module is gitignored and rebuilt by turbo from
the committed snapshot files. Today (only one snapshot exists)
the page shows an honest empty-state callout; day-2 onwards
each pairwise diff renders as a day section.
`expiring_soon` events are not synthesizable from the symbols
API alone (no scheduled deactivation date is exposed) — they
stay at zero until a richer upstream signal exists.
Subscribe / RSS / Edit-on-GitHub links in the page chrome are
visual placeholders pending real targets.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🤖 llms.txt Content ReviewAnalyzed documentation changes — no updates to curated content required. Products reviewed:
Files analyzed |
Replace the three-note "Source · UTC times · Daily snapshots" strip with a single attribution line linking to the Symbols API docs. Drops .footerSep (unused) and adds .footerLink. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Drop the RSS placeholder from the meta bar. No backend route existed yet — this just removes the unwired UI button + its phosphor icon import. Sharing/distribution gets revisited as a separate piece. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Drop the Subscribe placeholder along with its phosphor icon import and the now-unused .metaButton + .spacer SCSS classes. Sharing/distribution will be revisited as a separate piece of work — not coding it as a TODO stub here. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replaces the unbounded `data/changelog-snapshots/<date>.json` write pattern with a rolling baseline + per-day diffs: data/latest-snapshot.json single ~3 MB file, overwritten daily data/changelog-diffs/<date>.json small (< 50 KB), one per day, committed `scripts/snapshot-and-diff.ts` (replaces `snapshot-symbols.ts`) performs the atomic read-baseline / fetch-API / write-diff / overwrite-baseline sequence; idempotent within a UTC day. `scripts/generate-changelog.ts` no longer diffs — it just bundles the most recent N diff files into the rendered TS module. Shared types + diff logic moved to `scripts/changelog-lib.ts`. Annual repo growth bounded at ~10 MB (small diff files + delta- compressed baseline overwrites), down from ~1 GB if we kept full snapshots indefinitely. Diff files are also human-readable — `git log apps/developer-hub/data/changelog-diffs/` becomes a free audit trail. The daily Action workflow is updated to commit both the new diff file and the rolling baseline. Addresses Devin review comment on PR #3674 (#3674 (comment)). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
| <div className={styles.root}> | ||
| <MetaBar mode={mode} setMode={setMode} lastUpdated={lastDay?.date} /> | ||
|
|
||
| <WeekSummary rollup={log.weekRollup} /> |
There was a problem hiding this comment.
🟡 WeekSummary renders "Invalid Date" when no diff files exist
WeekSummary is rendered unconditionally at index.tsx:58, but when there are zero diff files, generate-changelog.ts:65-66 sets start and end to "". This causes fmtDateShort("") at index.tsx:128 to create new Date("T00:00:00Z") — an Invalid Date — resulting in "Invalid Date – Invalid Date" being displayed in the week range. The component should either not be rendered when there are no days, or fmtDateShort should guard against empty strings.
Prompt for agents
In apps/developer-hub/src/components/ChangeLog/index.tsx, the WeekSummary component is rendered unconditionally on line 58, even when log.days is empty. When there are no days, log.weekRollup.start and log.weekRollup.end are both empty strings (set in scripts/generate-changelog.ts lines 65-66). The fmtDateShort helper in data.ts creates new Date("T00:00:00Z") which is an Invalid Date.
Fix options:
1. Move the WeekSummary rendering inside the log.days.length > 0 branch (after the empty state check on line 60), so it only renders when there's data.
2. Guard fmtDateShort in data.ts to return a fallback (e.g. empty string or dash) when the input is empty or produces an invalid date.
3. Add a guard in the WeekSummary component to skip rendering the date range when start/end are empty.
Was this helpful? React with 👍 or 👎 to provide feedback.
… git
The 3 MB rolling baseline (`data/latest-snapshot.json`) was being
overwritten and committed daily by the workflow, growing git
history despite delta compression. Per REVIEW.md's "No accidental
file commits" rule, generated files should not live in the repo.
Switch to GitHub Actions cache:
- actions/cache/restore reads the previous baseline at the start
of each run (key: changelog-baseline; falls back via
restore-keys for the latest available entry).
- actions/cache/save writes today's baseline back under a unique
per-run key; old entries age out via GitHub's 7-day inactivity
eviction.
- Cache miss is graceful — the snapshot script bootstraps a
fresh baseline when the file is absent.
The daily diff JSONs in data/changelog-diffs/ remain committed
(they're small, reviewable, and serve as the audit log).
Addresses Devin review comment on PR #3674
(#3674 (comment)).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The daily snapshot workflow's bare `git push` could fail
silently if another commit lands on the default branch between
checkout and push, or if branch protection rejects the push.
Add explicit handling:
- `set -euo pipefail` so any bash failure is loud
- Retry up to 3 times: on rejection, fetch + rebase against
`origin/<branch>` and try again
- After 3 failed attempts, emit `::error::` and exit non-zero
so the workflow run shows red
The cron is non-blocking — a missed day still self-heals on the
next run (the next-day diff just spans 2 days against the older
cached baseline), but loud failures surface in the Actions UI
rather than going unnoticed.
Addresses Devin review comment on PR #3674
(#3674 (comment)).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
/price-feeds/changeloglisting daily status transitions (added / went live / removed) for Pyth price feeds.<ChangeLog />) that renders a week-summary callout, By-day and Stream views, filter chips, and a provenance footer.pyth.dourolabs.app/v1/symbolscommitted underapps/developer-hub/data/changelog-snapshots/..github/workflows/changelog-snapshot.yml) runs at 00:30 UTC, fetches a fresh snapshot, and commits it to the repo.Data flow
Diff rules in
scripts/generate-changelog.ts:expiring_soonis not synthesizable from the symbols API alone (no scheduled deactivation date is exposed) and stays at zero until a richer upstream signal exists.Day-1 state
Only one snapshot exists today, so the page renders an honest empty-state callout: "No transitions yet — daily snapshots are accumulating. Check back tomorrow." From day 2 onward each pairwise diff renders as a day section, building up to ~13 days of history (we keep the last 14 snapshots in the rendered window).
Open TODOs (intentional, called out in code)
href="#"placeholders.expiring_soonsemantic — needs a deprecation-date signal from the API or a side-channel.Test plan
pnpm turbo run build test:types test:lint test:format test:lint:stylelint --filter=@pythnetwork/developer-hub— 42/42 green.light-dark().pnpm snapshot:changelog(verified end-to-end: writes 3194-symbol JSON for today).pnpm generate:changelog(verified: produces zero-day generated module with one snapshot, well-formed TS).🤖 Generated with Claude Code