Skip to content

Commit 6e2c87e

Browse files
committed
Merge branch 'master' into constantinius/feat/dynamic-sampling/organization-settings
* master: (511 commits) docs(cloudflare): several semantic and stylistic fixes in code examples for cloudflare workers (#12482) chore(replay): Clarify network bandwidth and show how to reduce perf impact for mobile SDKs (#12479) chore(replay): Update product docs FAQ (#12474) ref: Drop remaining usage of `<Note>` (#12476) Update debugmeta.mdx (#12436) Fix queue_producer_transaction string termination error in example code (#12463) Adjust for sentry-ruby changes (#12455) Fixed incorrect instrument.mjs filename (#12454) Updating feature flags docs location (#12453) ref: Remove `<Note>` component in favor of using `<Alert>` (#12467) feat: send content feedback plausible events (#12400) docs(native): document how to set attribute on spans/transactions feat(express): Add warning about express v5 (#12465) chore(jira): Add instructions for installing Jira for self-hosted sentry users (#12433) chore: Update Codecov Bundler Plugin Version (#12459) Bump API schema to 421589ca (#12461) fix(platform): Enable scrolling via keyboard buttons (#12460) feat: Update `Expandable` style (#12457) Add Kotlin examples and fix typo in Java and Android Scopes docs (#12458) doc(js): Document how to set attribute on all spans (#12449) ...
2 parents be109c7 + f940420 commit 6e2c87e

File tree

1,731 files changed

+23431
-14003
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,731 files changed

+23431
-14003
lines changed

.env.example

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
# warning: variables prefixed with NEXT_PUBLIC_ will be made available to client-side code
44
# be careful not to expose sensitive data (in this case your Algolia admin key)
55

6-
NEXT_PUBLIC_ALGOLIA_APP_ID=OOK48W9UCL
7-
NEXT_PUBLIC_ALGOLIA_SEARCH_KEY=ca98597f559459c216891b75989832f8
6+
NEXT_PUBLIC_ALGOLIA_APP_ID=
7+
NEXT_PUBLIC_ALGOLIA_SEARCH_KEY=

.env.production

-3
This file was deleted.

.env.test

-5
This file was deleted.

.eslintrc.js

-14
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,10 @@
1-
/* eslint-env node */
2-
/* eslint import/no-nodejs-modules:0 */
3-
41
module.exports = {
52
extends: ['sentry-docs', 'plugin:@next/next/recommended'],
63
globals: {
7-
jest: true,
84
Atomics: 'readonly',
95
SharedArrayBuffer: 'readonly',
106
},
117
rules: {
128
'import/no-nodejs-modules': 'off',
139
},
14-
overrides: [
15-
{
16-
files: ['*.ts', '*.tsx'],
17-
rules: {
18-
// Reach is vendored into gatsby. They have their own webpack
19-
// resolution for it which this eslint plugin can't seem to detect
20-
'import/no-unresolved': ['error', {ignore: ['@reach']}],
21-
},
22-
},
23-
],
2410
};

.github/CODEOWNERS

+7-5
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@
3636
# /src/docs/product/discover-queries/ @getsentry/visibility
3737
# /src/docs/product/performance/ @getsentry/visibility
3838

39-
# /src/docs/product/cli/dif/ @getsentry/owners-native
39+
# /src/docs/cli/dif.mdx @getsentry/owners-native
4040

41-
# /.github/labels.yml @getsentry/open-source
42-
# /.github/workflows/react-to-product-owners-yml-changes.yml @getsentry/open-source
43-
# /bin/react-to-product-owners-yml-changes.py @getsentry/open-source
44-
# /bin/react-to-product-owners-yml-changes.sh @getsentry/open-source
41+
# /.github/labels.yml @getsentry/dev-infra
42+
# /.github/workflows/react-to-product-owners-yml-changes.yml @getsentry/dev-infra
43+
# /bin/react-to-product-owners-yml-changes.py @getsentry/dev-infra
44+
# /bin/react-to-product-owners-yml-changes.sh @getsentry/dev-infra
4545

4646
# ###### Replays #######
4747

@@ -51,4 +51,6 @@
5151
# /src/platforms/javascript/common/session-replay/ @getsentry/replay @getsentry/replay-sdk-web
5252
# /src/wizard/javascript/replay-onboarding/ @getsentry/replay @getsentry/replay-sdk-web
5353

54+
# /src/docs/product/dev-toolbar/ @getsentry/replay
55+
5456
# ###### End Replays #######

.github/workflows/algolia-index.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- 'develop-docs/**'
2626
- uses: oven-sh/setup-bun@v2
2727
with:
28-
bun-version: latest
28+
bun-version: '1.1.34'
2929

3030
- uses: actions/cache@v4
3131
id: cache

.github/workflows/bump-api-schema-sha.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,19 @@ jobs:
1212
name: 'Bump API Schema SHA'
1313
steps:
1414
- uses: actions/[email protected]
15+
- name: Get auth token
16+
id: token
17+
uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0
18+
with:
19+
app-id: ${{ vars.SENTRY_INTERNAL_APP_ID }}
20+
private-key: ${{ secrets.SENTRY_INTERNAL_APP_PRIVATE_KEY }}
1521
- name: 'Bump API Schema SHA'
1622
shell: bash
1723
env:
1824
# An elevated token is necessary because with plain github.token
1925
# GitHub does not recursively call workflows, which means CI does not
2026
# kick off for the PR we're about to create.
21-
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_PAT }}
27+
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
2228
run: |
2329
set -euo pipefail
2430

.github/workflows/lint-404s.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- 'platform-includes/**'
2626
dev-docs:
2727
- 'develop-docs/**'
28-
- uses: oven-sh/setup-bun@v1
28+
- uses: oven-sh/setup-bun@v2
2929
with:
3030
bun-version: latest
3131

.github/workflows/prepare-release.yml

+8-2
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,20 @@ jobs:
1313
runs-on: ubuntu-latest
1414
name: "Release a new version"
1515
steps:
16+
- name: Get auth token
17+
id: token
18+
uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0
19+
with:
20+
app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }}
21+
private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }}
1622
- uses: actions/[email protected]
1723
with:
18-
token: ${{ secrets.GH_RELEASE_PAT }}
24+
token: ${{ steps.token.outputs.token }}
1925
fetch-depth: 0
2026
- name: Prepare release
2127
uses: getsentry/action-prepare-release@v1
2228
env:
23-
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_PAT }}
29+
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
2430
with:
2531
version: ${{ github.event.inputs.version }}
2632
force: ${{ github.event.inputs.force }}

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ repos:
1313
- id: detect-private-key
1414
exclude: |
1515
(?x)^(
16-
develop-docs/application/config.mdx|
16+
develop-docs/backend/config.mdx|
1717
develop-docs/integrations/github.mdx|
1818
develop-docs/self-hosted/sso.mdx
1919
)$

.vscode/settings.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,8 @@
1212
"git.ignoreLimitWarning": true,
1313
"search.exclude": {
1414
"**/src/wizard/**": true
15-
}
15+
},
16+
"cSpell.words": [
17+
"laravel"
18+
]
1619
}

CONTRIBUTING.md

+5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ We use Next.js, `yarn` and `volta` to manage the environment.
1111
```
1212
cp .env.example .env.development
1313
yarn
14+
15+
# Start dev server for user docs
1416
yarn dev
17+
18+
# Start dev server for developer docs
19+
yarn dev:developer-docs
1520
```
1621

1722
With that, the repo is fully set up and you are ready to open local docs under http://localhost:3000

app/[[...path]]/page.tsx

+12-6
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ function MDXLayoutRenderer({mdxSource, ...rest}) {
5858
return <MDXLayout components={mdxComponentsWithWrapper} {...rest} />;
5959
}
6060

61-
export default async function Page({params}: {params: {path?: string[]}}) {
61+
export default async function Page(props: {params: Promise<{path?: string[]}>}) {
62+
const params = await props.params;
6263
// get frontmatter of all docs in tree
6364
const rootNode = await getDocsRootNode();
6465

@@ -172,9 +173,9 @@ export default async function Page({params}: {params: {path?: string[]}}) {
172173
}
173174

174175
type MetadataProps = {
175-
params: {
176+
params: Promise<{
176177
path?: string[];
177-
};
178+
}>;
178179
};
179180

180181
// Helper function to clean up canonical tags missing leading or trailing slash
@@ -188,7 +189,8 @@ function formatCanonicalTag(tag: string) {
188189
return tag;
189190
}
190191

191-
export async function generateMetadata({params}: MetadataProps): Promise<Metadata> {
192+
export async function generateMetadata(props: MetadataProps): Promise<Metadata> {
193+
const params = await props.params;
192194
const domain = isDeveloperDocs
193195
? 'https://develop.sentry.dev'
194196
: 'https://docs.sentry.io';
@@ -198,10 +200,14 @@ export async function generateMetadata({params}: MetadataProps): Promise<Metadat
198200
: domain;
199201
let title =
200202
'Sentry Docs | Application Performance Monitoring &amp; Error Tracking Software';
201-
let customCanonicalTag;
203+
let customCanonicalTag: string = '';
202204
let description =
203205
'Self-hosted and cloud-based application performance monitoring &amp; error tracking that helps software teams see clearer, solve quicker, &amp; learn continuously.';
204-
const images = [{url: `${previewDomain ?? domain}/meta.jpg`, width: 1200, height: 822}];
206+
// show og image on the home page only
207+
const images =
208+
((await props.params).path ?? []).length === 0
209+
? [{url: `${previewDomain ?? domain}/og.png`, width: 1200, height: 630}]
210+
: [];
205211

206212
const rootNode = await getDocsRootNode();
207213

app/globals.css

+6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
--accent: var(--accent-purple);
1414
--foreground: var(--gray-12);
1515
--cursor-checkbox: pointer;
16+
--default-font-family: var(--font-rubik) !important;
1617
::selection {
1718
background-color: var(--accent-a7);
1819
}
@@ -159,3 +160,8 @@ body {
159160
opacity: 1;
160161
}
161162
}
163+
164+
#kapa-widget-portal a[href="https://sentry.io/privacy/"]
165+
{
166+
color: rgb(134, 142, 150) !important;
167+
}

app/layout.tsx

+19-8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {Theme} from '@radix-ui/themes';
44
import type {Metadata} from 'next';
55
import {Rubik} from 'next/font/google';
66
import Script from 'next/script';
7+
import PlausibleProvider from 'next-plausible';
78

89
import {ThemeProvider} from 'sentry-docs/components/theme-provider';
910

@@ -30,8 +31,11 @@ export const metadata: Metadata = {
3031

3132
export default function RootLayout({children}: {children: React.ReactNode}) {
3233
return (
33-
<html lang="en">
34-
<body className={`${rubik.variable}`}>
34+
<html lang="en" suppressHydrationWarning>
35+
<head>
36+
<PlausibleProvider domain="docs.sentry.io,rollup.sentry.io" />
37+
</head>
38+
<body className={rubik.variable} suppressHydrationWarning>
3539
<ThemeProvider
3640
attribute="class"
3741
defaultTheme="system"
@@ -42,13 +46,20 @@ export default function RootLayout({children}: {children: React.ReactNode}) {
4246
{children}
4347
</Theme>
4448
</ThemeProvider>
49+
<Script
50+
async
51+
src="https://widget.kapa.ai/kapa-widget.bundle.js"
52+
data-website-id="cac7cc70-969e-4bc1-a968-55534a839be4"
53+
data-button-hide // do not render kapa ai button
54+
data-modal-override-open-class="kapa-ai-class" // all elements with this class will open the kapa ai modal
55+
data-project-name="Sentry"
56+
data-project-color="#6A5FC1"
57+
data-project-logo="https://avatars.githubusercontent.com/u/1396951?s=280&v=4"
58+
data-font-family="var(--font-rubik)"
59+
data-modal-disclaimer="Please note: This is a tool that searches publicly available sources. Do not include any sensitive or personal information in your queries. For more on how Sentry handles your data, see our [Privacy Policy](https://sentry.io/privacy/)."
60+
data-modal-example-questions="How to set up Sentry for Next.js?,What are tracePropagationTargets?"
61+
/>
4562
</body>
46-
<Script
47-
defer
48-
data-domain="docs.sentry.io,rollup.sentry.io"
49-
data-api="https://plausible.io/api/event"
50-
src="https://plausible.io/js/script.tagged-events.js"
51-
/>
5263
</html>
5364
);
5465
}

app/platform-redirect/page.tsx

+21-9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import {Metadata} from 'next';
12
import {redirect} from 'next/navigation';
23

34
import {Alert} from 'sentry-docs/components/alert';
@@ -7,17 +8,28 @@ import {SmartLink} from 'sentry-docs/components/smartLink';
78
import {extractPlatforms, getDocsRootNode, nodeForPath} from 'sentry-docs/docTree';
89
import {setServerContext} from 'sentry-docs/serverContext';
910

10-
export default async function Page({
11-
searchParams: {next = '', platform},
12-
}: {
13-
searchParams: {[key: string]: string | string[] | undefined};
11+
import {sanitizeNext} from './utils';
12+
13+
export const metadata: Metadata = {
14+
robots: 'noindex',
15+
title: 'Platform Specific Content',
16+
description:
17+
'The page you are looking for is customized for each platform. Select your platform below and we’ll direct you to the most specific documentation on it.',
18+
};
19+
20+
export default async function Page(props: {
21+
searchParams: Promise<{[key: string]: string | string[] | undefined}>;
1422
}) {
23+
const searchParams = await props.searchParams;
24+
25+
let next = searchParams.next || '';
26+
const platform = searchParams.platform;
27+
1528
if (Array.isArray(next)) {
1629
next = next[0];
1730
}
1831

19-
// discard the hash
20-
const [pathname, _] = next.split('#');
32+
const pathname = sanitizeNext(next);
2133
const rootNode = await getDocsRootNode();
2234
const defaultTitle = 'Platform Specific Content';
2335
let description = '';
@@ -53,7 +65,7 @@ export default async function Page({
5365
p => p.key === requestedPlatform?.toLowerCase()
5466
);
5567
if (isValidPlatform) {
56-
return redirect(`/platforms/${requestedPlatform}${next}`);
68+
return redirect(`/platforms/${requestedPlatform}${pathname}`);
5769
}
5870
}
5971

@@ -67,12 +79,12 @@ export default async function Page({
6779

6880
return (
6981
<DocPage frontMatter={frontMatter}>
70-
<Alert level="info">{platformInfo}</Alert>
82+
<Alert>{platformInfo}</Alert>
7183

7284
<ul>
7385
{platformList.map(p => (
7486
<li key={p.key}>
75-
<SmartLink to={`/platforms/${p.key}${next}`}>
87+
<SmartLink to={`/platforms/${p.key}${pathname}`}>
7688
<PlatformIcon
7789
size={16}
7890
platform={p.icon ?? p.key}

app/platform-redirect/utils.spec.ts

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import {describe, expect, it} from 'vitest';
2+
3+
import {sanitizeNext} from './utils';
4+
5+
describe('sanitizeNext', () => {
6+
it('should return an empty string for external URLs', () => {
7+
expect(sanitizeNext('http://example.com')).toBe('');
8+
expect(sanitizeNext('https://example.com')).toBe('');
9+
expect(sanitizeNext('//example.com')).toBe('');
10+
});
11+
12+
it('should prepend a slash if missing', () => {
13+
expect(sanitizeNext('path/to/resource')).toBe('/path/to/resource');
14+
});
15+
16+
it('should not modify a valid internal path', () => {
17+
expect(sanitizeNext('/path/to/resource')).toBe('/path/to/resource');
18+
});
19+
20+
it('should remove unsafe characters', () => {
21+
expect(sanitizeNext('/path/to/resource?query=1')).toBe('/path/to/resource');
22+
expect(sanitizeNext('/path/to/resource#hash')).toBe('/path/to/resource');
23+
});
24+
25+
it('should allow alphanumeric and hyphens', () => {
26+
expect(sanitizeNext('/path-to/resource123')).toBe('/path-to/resource123');
27+
});
28+
29+
it('should return an empty string for paths with colons', () => {
30+
expect(sanitizeNext('/path:to/resource')).toBe('');
31+
});
32+
33+
it('should return an empty string for the root path', () => {
34+
expect(sanitizeNext('/')).toBe('');
35+
});
36+
37+
it('should decode URL encoded characters', () => {
38+
expect(sanitizeNext('/path%2Fwith%2Fslashes')).toBe('/path/with/slashes');
39+
});
40+
41+
it('should return an empty string for a malformed URI component', () => {
42+
const input = '%E0%A4%A'; // Malformed URI
43+
const expectedOutput = '';
44+
expect(sanitizeNext(input)).toBe(expectedOutput);
45+
});
46+
});

0 commit comments

Comments
 (0)