Browse Source

set full list without nuget

Simon Hellmayr 22 hours ago
parent
commit
0c7748fe9c

+ 2 - 5
src/sentry/api/endpoints/team_projects.py

@@ -22,7 +22,6 @@ from sentry.apidocs.examples.team_examples import TeamExamples
 from sentry.apidocs.parameters import CursorQueryParam, GlobalParams
 from sentry.apidocs.parameters import CursorQueryParam, GlobalParams
 from sentry.apidocs.utils import inline_sentry_response_serializer
 from sentry.apidocs.utils import inline_sentry_response_serializer
 from sentry.constants import PROJECT_SLUG_MAX_LENGTH, RESERVED_PROJECT_SLUGS, ObjectStatus
 from sentry.constants import PROJECT_SLUG_MAX_LENGTH, RESERVED_PROJECT_SLUGS, ObjectStatus
-from sentry.models.options.project_option import ProjectOption
 from sentry.models.project import Project
 from sentry.models.project import Project
 from sentry.models.team import Team
 from sentry.models.team import Team
 from sentry.seer.similarity.utils import project_is_seer_eligible
 from sentry.seer.similarity.utils import project_is_seer_eligible
@@ -225,10 +224,8 @@ class TeamProjectsEndpoint(TeamEndpoint, EnvironmentMixin):
 
 
             # Add electron symbol server by default to both electron and javascript-electron projects
             # Add electron symbol server by default to both electron and javascript-electron projects
             if project.platform and project.platform.endswith("electron"):
             if project.platform and project.platform.endswith("electron"):
-                symbol_sources = ProjectOption.objects.get_value(
-                    project=project, key="sentry:builtin_symbol_sources"
+                project.update_option(
+                    "sentry:builtin_symbol_sources", ["ios", "microsoft", "electron"]
                 )
                 )
-                symbol_sources.append("electron")
-                project.update_option("sentry:builtin_symbol_sources", symbol_sources)
 
 
         return Response(serialize(project, request.user), status=201)
         return Response(serialize(project, request.user), status=201)

+ 3 - 5
src/sentry/projects/services/project/impl.py

@@ -133,12 +133,10 @@ class DatabaseBackedProjectService(ProjectService):
                 user_id=user_id,
                 user_id=user_id,
             )
             )
             # Add electron symbol server by default to both electron and javascript-electron projects
             # Add electron symbol server by default to both electron and javascript-electron projects
-            if platform and platform.endswith("electron"):
-                symbol_sources = ProjectOption.objects.get_value(
-                    project=project, key="sentry:builtin_symbol_sources"
+            if project.platform and project.platform.endswith("electron"):
+                project.update_option(
+                    "sentry:builtin_symbol_sources", ["ios", "microsoft", "electron"]
                 )
                 )
-                symbol_sources.append("electron")
-                project.update_option("sentry:builtin_symbol_sources", symbol_sources)
 
 
             return serialize_project(project)
             return serialize_project(project)
 
 

+ 1 - 1
tests/sentry/api/endpoints/test_team_projects.py

@@ -305,7 +305,7 @@ class TeamProjectsCreateTest(APITestCase, TestCase):
         symbol_sources = ProjectOption.objects.get_value(
         symbol_sources = ProjectOption.objects.get_value(
             project=electron_project, key="sentry:builtin_symbol_sources"
             project=electron_project, key="sentry:builtin_symbol_sources"
         )
         )
-        assert "electron" in symbol_sources
+        assert symbol_sources == ["ios", "microsoft", "electron"]
 
 
     def test_builtin_symbol_sources_not_electron(self):
     def test_builtin_symbol_sources_not_electron(self):
         # Test non-Electron project (e.g. Python)
         # Test non-Electron project (e.g. Python)