Skip to content

Commit

Permalink
feat(platforms): Add cloudflare platform to backend (#77769)
Browse files Browse the repository at this point in the history
ref getsentry/sentry-javascript#12620

Adds cloudflare as a backend platform.
  • Loading branch information
AbhiPrasad authored Sep 19, 2024
1 parent 5df303f commit f1b4b41
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 12 deletions.
34 changes: 22 additions & 12 deletions src/sentry/api/endpoints/source_map_debug_blue_thunder_edition.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,7 @@ def get_sdk_debug_id_support(event_data):
"sentry.javascript.browser",
"sentry.javascript.capacitor",
"sentry.javascript.cordova",
"sentry.javascript.cloudflare",
"sentry.javascript.electron",
"sentry.javascript.gatsby",
"sentry.javascript.nextjs",
Expand All @@ -660,32 +661,41 @@ def get_sdk_debug_id_support(event_data):

if sdk_name == "sentry.javascript.react-native":
return (
"full"
if Version(sdk_version) >= Version(MIN_REACT_NATIVE_SDK_VERSION_FOR_DEBUG_IDS)
else "needs-upgrade",
(
"full"
if Version(sdk_version) >= Version(MIN_REACT_NATIVE_SDK_VERSION_FOR_DEBUG_IDS)
else "needs-upgrade"
),
MIN_REACT_NATIVE_SDK_VERSION_FOR_DEBUG_IDS,
)

if sdk_name == "sentry.javascript.electron":
return (
"full"
if Version(sdk_version) >= Version(MIN_ELECTRON_SDK_VERSION_FOR_DEBUG_IDS)
else "needs-upgrade",
(
"full"
if Version(sdk_version) >= Version(MIN_ELECTRON_SDK_VERSION_FOR_DEBUG_IDS)
else "needs-upgrade"
),
MIN_ELECTRON_SDK_VERSION_FOR_DEBUG_IDS,
)

if sdk_name == "sentry.javascript.nextjs" or sdk_name == "sentry.javascript.sveltekit":
return (
"full"
if Version(sdk_version) >= Version(MIN_NEXTJS_AND_SVELTEKIT_SDK_VERSION_FOR_DEBUG_IDS)
else "needs-upgrade",
(
"full"
if Version(sdk_version)
>= Version(MIN_NEXTJS_AND_SVELTEKIT_SDK_VERSION_FOR_DEBUG_IDS)
else "needs-upgrade"
),
MIN_NEXTJS_AND_SVELTEKIT_SDK_VERSION_FOR_DEBUG_IDS,
)

return (
"full"
if Version(sdk_version) >= Version(MIN_JS_SDK_VERSION_FOR_DEBUG_IDS)
else "needs-upgrade",
(
"full"
if Version(sdk_version) >= Version(MIN_JS_SDK_VERSION_FOR_DEBUG_IDS)
else "needs-upgrade"
),
MIN_JS_SDK_VERSION_FOR_DEBUG_IDS,
)

Expand Down
1 change: 1 addition & 0 deletions src/sentry/models/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"javascript",
"javascript-angular",
"javascript-astro",
"javascript-cloudflare",
"javascript-ember",
"javascript-gatsby",
"javascript-nextjs",
Expand Down
1 change: 1 addition & 0 deletions src/sentry/utils/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ def is_event_from_browser_javascript_sdk(event: dict[str, Any]) -> bool:
return sdk_name.lower() in [
"sentry.javascript.astro",
"sentry.javascript.browser",
"sentry.javascript.cloudflare",
"sentry.javascript.react",
"sentry.javascript.gatsby",
"sentry.javascript.ember",
Expand Down
2 changes: 2 additions & 0 deletions src/sentry/utils/platform_categories.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"java-logging",
"java-spring-boot",
"java-spring",
"javascript-cloudflare",
"kotlin",
"native",
"node",
Expand Down Expand Up @@ -118,6 +119,7 @@
SERVERLESS = {
"dotnet-awslambda",
"dotnet-gcpfunctions",
"javascript-cloudflare",
"node-awslambda",
"node-azurefunctions",
"node-gcpfunctions",
Expand Down
1 change: 1 addition & 0 deletions src/sentry/utils/tag_normalization.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"sentry.javascript.browser",
"sentry.javascript.capacitor",
"sentry.javascript.cordova",
"sentry.javascript.cloudflare",
"sentry.javascript.deno",
"sentry.javascript.electron",
"sentry.javascript.ember",
Expand Down

0 comments on commit f1b4b41

Please sign in to comment.