Skip to content

Commit

Permalink
feat: Allow to select v8 in Loader Script (#73835)
Browse files Browse the repository at this point in the history
This adds a feature flag `organizations:js-sdj-loader-v8` that can be
set that will add `8.x` to the selectable options for the Loader Script.

Part of getsentry/sentry-javascript#12187
  • Loading branch information
mydea authored Jul 9, 2024
1 parent f3af800 commit 12daf60
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/sentry/features/temporary.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ def register_temporary_features(manager: FeatureManager):
# Enable the new issue stream search bar UI
manager.add("organizations:issue-stream-search-query-builder", OrganizationFeature, FeatureHandlerStrategy.REMOTE)
manager.add("organizations:large-debug-files", OrganizationFeature, FeatureHandlerStrategy.INTERNAL)
# Enable v8 support for the Loader Script
manager.add("organizations:js-sdk-loader-v8", OrganizationFeature, FeatureHandlerStrategy.REMOTE)
# Enabled latest adopted release filter for issue alerts
manager.add("organizations:latest-adopted-release-filter", OrganizationFeature, FeatureHandlerStrategy.REMOTE)
manager.add("organizations:mep-rollout-flag", OrganizationFeature, FeatureHandlerStrategy.REMOTE)
Expand Down
11 changes: 8 additions & 3 deletions src/sentry/loader/browsersdkversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from packaging.version import Version

import sentry
from sentry import features

logger = logging.getLogger("sentry")

Expand Down Expand Up @@ -37,8 +38,7 @@ def get_highest_browser_sdk_version(versions):


def get_all_browser_sdk_version_versions():
# todo: v8 add version
return ["latest", "7.x", "6.x", "5.x", "4.x"]
return ["latest", "8.x", "7.x", "6.x", "5.x", "4.x"]


def get_all_browser_sdk_version_choices():
Expand Down Expand Up @@ -98,4 +98,9 @@ def get_default_sdk_version_for_project(project):


def get_available_sdk_versions_for_project(project):
return project.get_option("sentry:loader_available_sdk_versions")
versions = project.get_option("sentry:loader_available_sdk_versions")

if features.has("organizations:js-sdk-loader-v8", project.organization, actor=None):
return versions + ["8.x"]

return versions

0 comments on commit 12daf60

Please sign in to comment.