Skip to content

Commit 9317697

Browse files
coolguyzoneAlex Krawiecgetsantry[bot]
authored
Add docs changelog (#15169)
<!-- Use this checklist to make sure your PR is ready for merge. You may delete any sections you don't need. --> ## DESCRIBE YOUR PR TLDR: A monitoring repo does a chron job that collects docs updates and summarizes them using chat GPT, then it's passed over to the Content Dashboard repo which generates an RSS feed, and the docs repo pings that RSS feed to populate the data on this page: https://sentry-docs-git-changelog.sentry.dev/changelog/ ## IS YOUR CHANGE URGENT? Help us prioritize incoming PRs by letting us know when the change needs to go live. - [ ] Urgent deadline (GA date, etc.): <!-- ENTER DATE HERE --> - [ ] Other deadline: <!-- ENTER DATE HERE --> - [ ] None: Not urgent, can wait up to 1 week+ ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it. Thanks in advance for your help! ## PRE-MERGE CHECKLIST *Make sure you've checked the following before merging your changes:* - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) ## LEGAL BOILERPLATE <!-- Sentry employees and contractors can delete or ignore this section. --> Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms. ## EXTRA RESOURCES - [Sentry Docs contributor guide](https://docs.sentry.io/contributing/) --------- Co-authored-by: Alex Krawiec <[email protected]> Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
1 parent c2571b5 commit 9317697

File tree

3 files changed

+202
-0
lines changed

3 files changed

+202
-0
lines changed

docs/changelog.mdx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
title: Documentation Changelog
3+
sidebar_order: 100
4+
description: Track recent updates to Sentry docs
5+
---
6+
7+
import {DocsChangelog} from 'sentry-docs/components/changelog/docsChangelog';
8+
9+
10+
## Recent Updates
11+
12+
<DocsChangelog />
13+
14+
## Alternative Views
15+
16+
- [Full Content Dashboard](https://sentry-content-dashboard.sentry.dev/) - View all Sentry content (blog, videos, docs, changelog)
17+
- [RSS Feed](https://sentry-content-dashboard.sentry.dev/api/docs/feed) - Subscribe to doc updates in your RSS reader
18+
- [JSON API](https://sentry-content-dashboard.sentry.dev/api/docs) - Programmatically access changelog data
19+
20+
<Alert level="info">
21+
The changelog updates automatically throughout the day. Summaries are generated by AI to provide quick, user-friendly insights into each update from the [getsentry/sentry-docs](https://github.com/getsentry/sentry-docs) repository.
22+
</Alert>
23+
Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
interface ChangelogEntry {
2+
author: string;
3+
description: string;
4+
id: string;
5+
publishedAt: string;
6+
title: string;
7+
url: string;
8+
filesChanged?: {
9+
added: string[];
10+
modified: string[];
11+
removed: string[];
12+
};
13+
}
14+
15+
async function getChangelogEntries(): Promise<ChangelogEntry[]> {
16+
try {
17+
const res = await fetch('https://sentry-content-dashboard.sentry.dev/api/docs', {
18+
next: {revalidate: 3600}, // Cache for 1 hour
19+
});
20+
21+
if (!res.ok) {
22+
throw new Error(`Failed to fetch changelog: ${res.status} ${res.statusText}`);
23+
}
24+
25+
return res.json();
26+
} catch (error) {
27+
// eslint-disable-next-line no-console
28+
console.error('Error fetching changelog:', error);
29+
// Error fetching changelog - return empty array
30+
return [];
31+
}
32+
}
33+
34+
export async function DocsChangelog() {
35+
const entries = await getChangelogEntries();
36+
37+
if (entries.length === 0) {
38+
return (
39+
<div className="rounded-lg border border-yellow-200 bg-yellow-50 p-4 text-yellow-800 dark:border-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-200">
40+
<p className="font-semibold">No changelog entries available</p>
41+
<p className="text-sm">Check back later for updates.</p>
42+
</div>
43+
);
44+
}
45+
46+
// Show only the 20 most recent entries
47+
const recentEntries = entries.slice(0, 20);
48+
49+
return (
50+
<div className="space-y-8">
51+
{recentEntries.map(entry => {
52+
const date = new Date(entry.publishedAt);
53+
const totalFiles =
54+
(entry.filesChanged?.added?.length || 0) +
55+
(entry.filesChanged?.modified?.length || 0) +
56+
(entry.filesChanged?.removed?.length || 0);
57+
58+
return (
59+
<article key={entry.id} className="border-b border-gray-200 pb-8 last:border-0">
60+
<header className="mb-3">
61+
<h3 className="mb-2 text-xl font-semibold">
62+
<a
63+
href={entry.url}
64+
target="_blank"
65+
rel="noopener noreferrer"
66+
className="text-primary hover:underline"
67+
>
68+
{entry.title.replace('Docs Update: ', '')}
69+
</a>
70+
</h3>
71+
<div className="flex flex-wrap items-center gap-3 text-sm text-gray-600 dark:[color:rgb(210,199,218)]">
72+
<time dateTime={entry.publishedAt}>
73+
{date.toLocaleDateString('en-US', {
74+
year: 'numeric',
75+
month: 'long',
76+
day: 'numeric',
77+
})}
78+
</time>
79+
{totalFiles > 0 && <span></span>}
80+
{totalFiles > 0 && (
81+
<span>
82+
{totalFiles} file{totalFiles !== 1 ? 's' : ''} changed
83+
</span>
84+
)}
85+
</div>
86+
</header>
87+
88+
<p className="mb-4 text-gray-700 dark:[color:rgb(210,199,218)]">
89+
{entry.description}
90+
</p>
91+
92+
{entry.filesChanged && totalFiles > 0 && (
93+
<details className="text-sm">
94+
<summary className="cursor-pointer text-gray-600 hover:text-gray-800 dark:text-gray-400 dark:hover:text-gray-200">
95+
View changed files
96+
</summary>
97+
<div className="mt-2 space-y-2 rounded-md bg-gray-50 p-3 dark:bg-gray-800">
98+
{entry.filesChanged.added && entry.filesChanged.added.length > 0 && (
99+
<div>
100+
<span className="font-semibold text-green-700 dark:text-green-400">
101+
Added:
102+
</span>
103+
<ul className="ml-4 mt-1 list-inside list-disc">
104+
{entry.filesChanged.added.map(file => (
105+
<li key={file} className="text-gray-700 dark:text-gray-300">
106+
{file}
107+
</li>
108+
))}
109+
</ul>
110+
</div>
111+
)}
112+
{entry.filesChanged.modified &&
113+
entry.filesChanged.modified.length > 0 && (
114+
<div>
115+
<span className="font-semibold text-blue-700 dark:text-blue-400">
116+
Modified:
117+
</span>
118+
<ul className="ml-4 mt-1 list-inside list-disc">
119+
{entry.filesChanged.modified.map(file => (
120+
<li key={file} className="text-gray-700 dark:text-gray-300">
121+
{file}
122+
</li>
123+
))}
124+
</ul>
125+
</div>
126+
)}
127+
{entry.filesChanged.removed &&
128+
entry.filesChanged.removed.length > 0 && (
129+
<div>
130+
<span className="font-semibold text-red-700 dark:text-red-400">
131+
Removed:
132+
</span>
133+
<ul className="ml-4 mt-1 list-inside list-disc">
134+
{entry.filesChanged.removed.map(file => (
135+
<li key={file} className="text-gray-700 dark:text-gray-300">
136+
{file}
137+
</li>
138+
))}
139+
</ul>
140+
</div>
141+
)}
142+
</div>
143+
</details>
144+
)}
145+
</article>
146+
);
147+
})}
148+
{entries.length > 20 && (
149+
<div className="mt-8 rounded-lg border border-gray-200 bg-gray-50 p-4 text-center dark:border-gray-700 dark:bg-gray-800">
150+
<p className="text-sm text-gray-600 dark:[color:rgb(210,199,218)]">
151+
Showing the 20 most recent updates. View the{' '}
152+
<a
153+
href="https://sentry-content-dashboard.sentry.dev/"
154+
target="_blank"
155+
rel="noopener noreferrer"
156+
className="text-primary hover:underline"
157+
>
158+
full content dashboard
159+
</a>{' '}
160+
or subscribe to the{' '}
161+
<a
162+
href="https://sentry-content-dashboard.sentry.dev/api/docs/feed"
163+
target="_blank"
164+
rel="noopener noreferrer"
165+
className="text-primary hover:underline"
166+
>
167+
RSS feed
168+
</a>
169+
.
170+
</p>
171+
</div>
172+
)}
173+
</div>
174+
);
175+
}

src/components/sidebar/sidebarNavigation.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ const productSidebarItems = [
4444
title: 'Concepts & Reference',
4545
root: 'concepts',
4646
},
47+
{
48+
title: 'Documentation Changelog',
49+
root: 'changelog',
50+
},
4751
];
4852

4953
export async function SidebarNavigation({path}: {path: string[]}) {

0 commit comments

Comments
 (0)