Skip to content

fix: add production-compatible RSS feed for changelog#2998

Open
GANESH-NADKARNI wants to merge 4 commits into
langfuse:mainfrom
GANESH-NADKARNI:fix/rss-changelog-production
Open

fix: add production-compatible RSS feed for changelog#2998
GANESH-NADKARNI wants to merge 4 commits into
langfuse:mainfrom
GANESH-NADKARNI:fix/rss-changelog-production

Conversation

@GANESH-NADKARNI
Copy link
Copy Markdown

@GANESH-NADKARNI GANESH-NADKARNI commented May 24, 2026

What does this PR do?

Adds a working RSS feed at /api/changelog-rss.xml and an
RSS button on the changelog page.

Why?

PR #1688 was reverted because it used Pages Router style
(pages/api/changelog-rss.xml.ts) but the project has since
migrated to App Router. This fix uses App Router convention
(app/api/changelog-rss.xml/route.ts) with getChangelogIndexItems()
for build-time data loading — no filesystem access at runtime.

How to test?

  1. Run pnpm dev
  2. Visit http://127.0.0.1:3333/api/changelog-rss.xml — valid XML feed
  3. Visit http://127.0.0.1:3333/changelog — RSS button visible

Fixes #1614

Note: First-time contributor, happy to adjust based on feedback!

Greptile Summary

This PR adds a working RSS feed endpoint at /api/changelog-rss.xml using the App Router convention and wires up an RSS button on the changelog page, replacing the previously reverted Pages Router implementation.

  • app/api/changelog-rss.xml/route.ts — generates a valid RSS 2.0 feed from getChangelogIndexItems() at request time; item links and the Atom self-reference URL are hardcoded to https://langfuse.com, which will produce live-site URLs when running locally or on staging.
  • app/changelog/page.tsx — adds an outlined RSS button in the page header; the button label is OpenRSS (single word) which appears to be a typo for "RSS Feed".

Confidence Score: 4/5

Safe to merge; the feed works correctly in production, and the two issues (hardcoded base URL, button label typo) only affect developer experience and UI copy.

The route correctly builds and returns valid RSS XML using build-time data with no runtime filesystem access. The hardcoded https://langfuse.com in item links and the atom:link self-reference is harmless in production but will mislead when testing locally or on staging. The button label 'OpenRSS' is a cosmetic typo visible to all changelog visitors.

app/api/changelog-rss.xml/route.ts — hardcoded base URL on lines 14 and 32; app/changelog/page.tsx — button label typo on line 81.

Sequence Diagram

sequenceDiagram
    participant Client as RSS Reader / Browser
    participant Route as GET /api/changelog-rss.xml
    participant Lib as getChangelogIndexItems()
    participant Source as changelogSource (build-time data)

    Client->>Route: GET /api/changelog-rss.xml
    Route->>Lib: getChangelogIndexItems()
    Lib->>Source: changelogSource.getPages()
    Source-->>Lib: raw page list
    Lib-->>Route: sorted ChangelogPageItem[]
    Route->>Route: map items to RSS XML strings
    Route->>Route: compose full RSS 2.0 document
    Route-->>Client: "200 application/xml (Cache-Control: max-age=3600)"
Loading
Prompt To Fix All With AI
Fix the following 3 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 3
app/changelog/page.tsx:81
The button label `OpenRSS` is a single concatenated word — it looks like a typo where "Open" and "RSS" were joined. Standard convention is "RSS Feed" or just "RSS".

```suggestion
                <span>RSS Feed</span>
```

### Issue 2 of 3
app/api/changelog-rss.xml/route.ts:14
The base URL is hardcoded to `https://langfuse.com`. This works in production but means local and staging builds emit item links pointing at the live site, which can cause confusion when testing. Pulling from an env var (with a sensible fallback) is a common pattern here.

```suggestion
        const baseUrl = process.env.NEXT_PUBLIC_BASE_URL ?? "https://langfuse.com";
        const url = `${baseUrl}${item.route}`;
```

### Issue 3 of 3
app/api/changelog-rss.xml/route.ts:32
The `atom:link` self-referencing URL is also hardcoded. It should use the same base URL as item links so the feed validates correctly in non-production environments.

```suggestion
    <atom:link href="${process.env.NEXT_PUBLIC_BASE_URL ?? "https://langfuse.com"}/api/changelog-rss.xml" rel="self" type="application/rss+xml"/>
```

Reviews (1): Last reviewed commit: "fix: add RSS button to changelog page UI" | Re-trigger Greptile

Greptile also left 2 inline comments on this PR.

Uses getChangelogIndexItems() with build-time data instead of
fs.readdirSync, so the feed works on Vercel production.

Fixes langfuse#1614
- Adds /api/changelog-rss.xml endpoint using getChangelogIndexItems()
  instead of fs.readdirSync so it works on Vercel production
- Adds RSS Feed link to changelog page UI

Fixes langfuse#1614
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 24, 2026

@GANESH-NADKARNI is attempting to deploy a commit to the langfuse Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label May 24, 2026
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 24, 2026

CLA assistant check
All committers have signed the CLA.

@dosubot dosubot Bot added the docs label May 24, 2026
Comment thread app/api/changelog-rss.xml/route.ts Outdated
Comment thread app/api/changelog-rss.xml/route.ts Outdated
Signed-off-by: GANESH NADKARNI <ganeshnadkarni369@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add RSS feed for changelog

2 participants