Skip to content

Commit bb9e34e

Browse files
committed
Merge remote-tracking branch 'origin/master' into potel-base
2 parents a545ec0 + 81b8063 commit bb9e34e

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

.github/workflows/release.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,20 @@ jobs:
1818
runs-on: ubuntu-latest
1919
name: "Release a new version"
2020
steps:
21+
- name: Get auth token
22+
id: token
23+
uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0
24+
with:
25+
app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }}
26+
private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }}
2127
- uses: actions/[email protected]
2228
with:
23-
token: ${{ secrets.GH_RELEASE_PAT }}
29+
token: ${{ steps.token.outputs.token }}
2430
fetch-depth: 0
2531
- name: Prepare release
2632
uses: getsentry/action-prepare-release@v1
2733
env:
28-
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_PAT }}
34+
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
2935
with:
3036
version: ${{ github.event.inputs.version }}
3137
force: ${{ github.event.inputs.force }}

sentry_sdk/spotlight.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ def capture_envelope(self, envelope):
6666

6767
SPOTLIGHT_JS_ENTRY_PATH = "/assets/main.js"
6868
SPOTLIGHT_JS_SNIPPET_PATTERN = (
69-
'<script type="module" crossorigin src="{}"></script>'
69+
"<script>window.__spotlight = {{ initOptions: {{ sidecarUrl: '{spotlight_url}', fullPage: false }} }};</script>\n"
70+
'<script type="module" crossorigin src="{spotlight_js_url}"></script>\n'
7071
)
7172
SPOTLIGHT_ERROR_PAGE_SNIPPET = (
7273
'<html><base href="{spotlight_url}">\n'
@@ -113,7 +114,8 @@ def spotlight_script(self):
113114
)
114115
urllib.request.urlopen(req)
115116
self._spotlight_script = SPOTLIGHT_JS_SNIPPET_PATTERN.format(
116-
spotlight_js_url
117+
spotlight_url=self._spotlight_url,
118+
spotlight_js_url=spotlight_js_url,
117119
)
118120
except urllib.error.URLError as err:
119121
sentry_logger.debug(
@@ -210,13 +212,13 @@ def setup_spotlight(options):
210212
if not isinstance(url, str):
211213
return None
212214

213-
if (
214-
settings is not None
215-
and settings.DEBUG
216-
and env_to_bool(os.environ.get("SENTRY_SPOTLIGHT_ON_ERROR", "1"))
217-
and env_to_bool(os.environ.get("SENTRY_SPOTLIGHT_MIDDLEWARE", "1"))
218-
):
219-
with capture_internal_exceptions():
215+
with capture_internal_exceptions():
216+
if (
217+
settings is not None
218+
and settings.DEBUG
219+
and env_to_bool(os.environ.get("SENTRY_SPOTLIGHT_ON_ERROR", "1"))
220+
and env_to_bool(os.environ.get("SENTRY_SPOTLIGHT_MIDDLEWARE", "1"))
221+
):
220222
middleware = settings.MIDDLEWARE
221223
if DJANGO_SPOTLIGHT_MIDDLEWARE_PATH not in middleware:
222224
settings.MIDDLEWARE = type(middleware)(

0 commit comments

Comments
 (0)