Skip to content

Commit 79d8ecf

Browse files
feat(perforce,SCM): Remove beta flag, document on-demand source context fetching (#17498)
## 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 --> - [x] 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:* - [x] Checked Vercel preview for correctness, including links - [x] 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) --------- Co-authored-by: Bruno Garcia <bruno@brunogarcia.com>
1 parent f8d01d5 commit 79d8ecf

8 files changed

Lines changed: 86 additions & 9 deletions

File tree

docs/integrations/source-code-mgmt/azure-devops/index.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,10 @@ For best results, we recommend always providing a non-empty value for the **Stac
157157

158158
<Include name="common-imgs/code-mappings-configure-modal" />
159159

160+
### Source Context
161+
162+
If your events don't carry inline source context (for example, native crashes or releases built without source maps), you can have Sentry fetch the surrounding lines from your repository on demand and render them in the issue stack trace. See [SCM Source Context](/integrations/source-code-mgmt/source-context/) for setup and access details.
163+
160164
## Troubleshooting
161165

162166
### No accounts during installation

docs/integrations/source-code-mgmt/bitbucket/index.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,10 @@ For best results, we recommend always providing a non-empty value for the **Stac
224224

225225
<Include name="common-imgs/code-mappings-configure-modal" />
226226

227+
### Source Context
228+
229+
If your events don't carry inline source context (for example, native crashes or releases built without source maps), you can have Sentry fetch the surrounding lines from your repository on demand and render them in the issue stack trace. See [SCM Source Context](/integrations/source-code-mgmt/source-context/) for setup and access details.
230+
227231
## Troubleshooting
228232

229233
If you're having trouble setting up Sentry with your on-premises integration, verify the following:

docs/integrations/source-code-mgmt/github/index.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,10 @@ For best results, we recommend always providing a non-empty value for the **Stac
428428

429429
<Include name="common-imgs/code-mappings-configure-modal" />
430430

431+
### Source Context
432+
433+
If your events don't carry inline source context (for example, native crashes or releases built without source maps), you can have Sentry fetch the surrounding lines from your repository on demand and render them in the issue stack trace. See [SCM Source Context](/integrations/source-code-mgmt/source-context/) for setup and access details.
434+
431435
### Code Owners
432436

433437
<Include name="feature-available-for-plan-business.mdx" />

docs/integrations/source-code-mgmt/gitlab/index.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,10 @@ For best results, we recommend always providing a non-empty value for the **Stac
171171

172172
<Include name="common-imgs/code-mappings-configure-modal" />
173173

174+
### Source Context
175+
176+
If your events don't carry inline source context (for example, native crashes or releases built without source maps), you can have Sentry fetch the surrounding lines from your repository on demand and render them in the issue stack trace. See [SCM Source Context](/integrations/source-code-mgmt/source-context/) for setup and access details.
177+
174178
### Suspect Commits
175179

176180
Once you've set up stack trace linking, Sentry can use information from your source code provider to suggest the commit that likely introduced the error. The first frame in the stack trace is considered suspect when looking at them top-down. If the first frame is not in-app, the next frame is considered suspect.

docs/integrations/source-code-mgmt/index.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,8 @@ description: "Learn more about Sentry's source code management integrations."
99
- [Continue](/integrations/source-code-mgmt/continuedev/)
1010
- [GitHub/GitHub Enterprise](/integrations/source-code-mgmt/github/)
1111
- [GitLab](/integrations/source-code-mgmt/gitlab/)
12-
- [Perforce](/integrations/source-code-mgmt/perforce/) (Beta)
12+
- [Perforce](/integrations/source-code-mgmt/perforce/)
13+
14+
## Features
15+
16+
- [SCM Source Context](/integrations/source-code-mgmt/source-context/) — render source lines around each stack-trace frame on demand from your SCM provider, for events that don't carry inline source context.

docs/integrations/source-code-mgmt/perforce/index.mdx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,6 @@ description: >-
66
resolve bugs faster by using data from your Perforce changelists.
77
---
88

9-
<Alert title="Beta — Request-Only Access">
10-
11-
The Perforce integration is currently in **beta** and available by **request only**. To get access, contact your Sentry account team or reach out to [Sentry support](https://sentry.io/support/).
12-
13-
Functionality and UX may change during the beta period.
14-
15-
</Alert>
16-
179
Sentry's Perforce integration connects your P4 Core server to Sentry, enabling stack trace linking, commit tracking, and suspect commit detection for teams using Perforce Helix Core for version control.
1810

1911
## Features
@@ -125,6 +117,10 @@ If the stack trace shows `src/main.cpp` and the depot path is `//depot/project/s
125117

126118
This tells Sentry to replace `src/` with `project/src/` when locating source files in your depot.
127119

120+
### Source Context
121+
122+
If your events don't carry inline source context (for example, native crashes or releases built without source maps), you can have Sentry fetch the surrounding lines from your Perforce depot on demand and render them in the issue stack trace. See [SCM Source Context](/integrations/source-code-mgmt/source-context/) for setup and access details.
123+
128124
### Updating Configuration
129125

130126
You can update your Perforce server credentials and settings at any time by navigating to **Settings > Integrations > Perforce > Configurations** and clicking the gear icon next to your instance. Changes take effect immediately.
170 KB
Loading
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
title: SCM Source Context Fetching
3+
sidebar_order: 100
4+
description: >-
5+
Display the lines of source code surrounding each frame of a stack trace by
6+
fetching them on demand from your connected SCM integration.
7+
---
8+
9+
When an event reaches Sentry without inline source context — for example, a release built without source maps, a native crash, or any platform that doesn't ship source with the event — Sentry can fetch the source on demand from your connected SCM integration and render the surrounding lines next to each stack-trace frame.
10+
11+
This is the same context view you see on events that *do* carry inline source, but populated from the file in your repository at the time of the error. Expand a frame using the chevron on the right to view the fetched source.
12+
13+
![SCM source context shown inline in an issue stack-trace frame, with the chevron to expand the frame highlighted on the right](./img/source-context-frame.png)
14+
15+
## Prerequisites
16+
17+
- An installed SCM integration that supports stack-trace linking. The following providers are supported:
18+
- [Azure DevOps](/integrations/source-code-mgmt/azure-devops/)
19+
- [Bitbucket](/integrations/source-code-mgmt/bitbucket/)
20+
- [GitHub / GitHub Enterprise](/integrations/source-code-mgmt/github/)
21+
- [GitLab](/integrations/source-code-mgmt/gitlab/)
22+
- [Perforce](/integrations/source-code-mgmt/perforce/)
23+
- A code mapping configured for each project where you want SCM source context. See the **Stack Trace Linking** section of your provider's page for setup instructions.
24+
25+
## Enable
26+
27+
Source context fetching is opt-in per project. To enable it:
28+
29+
1. Open your project's [General Settings](https://sentry.io/orgredirect/organizations/:orgslug/settings/projects/:projectId/) page.
30+
2. Under **Client Security**, turn on **Enable SCM Source Context**.
31+
3. Confirm the prompt.
32+
33+
The toggle requires `project:write` permission.
34+
35+
## How It Works
36+
37+
When a frame in the issue stack trace lacks inline source context, Sentry:
38+
39+
1. Resolves the frame's file path to a repository path using the project's code mappings.
40+
2. Calls the SCM integration with the resolved path and the commit SHA of the release (falling back to the code mapping's default branch if no commit is associated).
41+
3. Returns the lines surrounding the frame's `lineno` and renders them inline.
42+
43+
Files are fetched lazily as you expand frames, and cached for the life of the request — there's no background indexing or long-term storage of your source on Sentry's side.
44+
45+
## Access
46+
47+
Once enabled, **any project member who can view the project can view fetched source for any file matched by the project's code mappings**. Effectively, this gives access to the contents of code-mapped paths in the connected repository to anyone with `project:read` on the Sentry project.
48+
49+
The SCM integration's own access scope still applies — Sentry can only return files that the configured integration token can read.
50+
51+
If your repository contains code that should not be visible to all project members, scope the integration's token narrowly, restrict code mappings to the directories you want exposed, or leave SCM Source Context disabled for that project.
52+
53+
## Disable
54+
55+
To turn the feature off for a project, flip the same toggle off. New requests stop fetching from your SCM immediately. Frames continue to display inline source context (where the event already carries it) as before.
56+
57+
## Limitations
58+
59+
- Each frame's source is fetched at request time. Pages with many frames lacking inline context will incur additional latency proportional to the number of unique files.
60+
- The integration's API rate limits apply. Sentry stops fetching for the rest of the request once a rate-limit response is returned by the provider.
61+
- Source is fetched at the commit SHA associated with the release, when available, and otherwise at the default branch — content may differ from the exact revision running in production if no release is associated with the event.

0 commit comments

Comments
 (0)