Skip to content

feat(developer-hub): add Change Log page under Price Feeds#3674

Open
aditya520 wants to merge 9 commits into
mainfrom
feat/changelog-page
Open

feat(developer-hub): add Change Log page under Price Feeds#3674
aditya520 wants to merge 9 commits into
mainfrom
feat/changelog-page

Conversation

@aditya520
Copy link
Copy Markdown
Member

Summary

  • New page at /price-feeds/changelog listing daily status transitions (added / went live / removed) for Pyth price feeds.
  • Built on Fumadocs MDX with a client component (<ChangeLog />) that renders a week-summary callout, By-day and Stream views, filter chips, and a provenance footer.
  • Data is generated at build time from daily snapshots of pyth.dourolabs.app/v1/symbols committed under apps/developer-hub/data/changelog-snapshots/.
  • Daily GitHub Action (.github/workflows/changelog-snapshot.yml) runs at 00:30 UTC, fetches a fresh snapshot, and commits it to the repo.

Data flow

pyth.dourolabs.app/v1/symbols
     │ Action: pnpm snapshot:changelog
     ▼
data/changelog-snapshots/<date>.json   ← committed
     │ pnpm generate:changelog (turbo build dep)
     ▼
src/components/ChangeLog/generated-data.ts   ← gitignored, regenerated by turbo
     │
     ▼
<ChangeLog /> component

Diff rules in scripts/generate-changelog.ts:

From → To Maps to
missing → present (no DEPRECATED) added
present → missing removed
coming_soon → stable went_live
stable → inactive removed
description gains DEPRECATED removed

expiring_soon is 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)

  • Subscribe / RSS / Edit-on-GitHub links in the meta bar / footer → href="#" placeholders.
  • expiring_soon semantic — 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 mode visual: title, lede, meta bar, week summary, footer all render with theme tokens flipping correctly via 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).
  • Action runs at 00:30 UTC tomorrow and commits the next snapshot — needs to be observed once after merge.

🤖 Generated with Claude Code

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>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
api-reference Ready Ready Preview, Comment May 8, 2026 5:47pm
component-library Ready Ready Preview, Comment May 8, 2026 5:47pm
developer-hub Ready Ready Preview, Comment May 8, 2026 5:47pm
entropy-explorer Ready Ready Preview, Comment May 8, 2026 5:47pm
insights Ready Ready Preview, Comment May 8, 2026 5:47pm
proposals Ready Ready Preview, Comment May 8, 2026 5:47pm
staking Ready Ready Preview, Comment May 8, 2026 5:47pm

Request Review

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

🤖 llms.txt Content Review

Analyzed documentation changes — no updates to curated content required.

Products reviewed: llms-price-feeds.txt

Note: Product files contain curated content. Deep dive page URLs in each file link to individual .mdx pages for full detail.

Files analyzed
apps/developer-hub/content/docs/price-feeds/changelog.mdx

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>
@vercel vercel Bot temporarily deployed to Preview – proposals May 7, 2026 19:12 Inactive
@vercel vercel Bot temporarily deployed to Preview – entropy-explorer May 7, 2026 19:12 Inactive
@vercel vercel Bot temporarily deployed to Preview – insights May 7, 2026 19:12 Inactive
devin-ai-integration[bot]

This comment was marked as resolved.

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>
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 3 new potential issues.

View 9 additional findings in Devin Review.

Open in Devin Review

<div className={styles.root}>
<MetaBar mode={mode} setMode={setMode} lastUpdated={lastDay?.date} />

<WeekSummary rollup={log.weekRollup} />
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment thread .github/workflows/changelog-snapshot.yml Outdated
Comment thread .github/workflows/changelog-snapshot.yml Outdated
… 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>
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