Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,15 +323,7 @@ const config: Config.InitialOptions = {
'<rootDir>/tests/js/setupFramework.ts',
],
testMatch: testMatch || ['<rootDir>/(static|tests/js)/**/?(*.)+(spec|test).[jt]s?(x)'],
testPathIgnorePatterns: [
'<rootDir>/tests/sentry/lang/javascript/',
// ESM-style helper scripts (e.g. scripts/genPlatformProductInfo.ts use
// `const __dirname = path.dirname(fileURLToPath(import.meta.url))`) that
// SWC's CJS transform redeclares — collides with Node's module wrapper.
// None of these are tests; keep them out of Jest's discovery entirely.
'<rootDir>/scripts/',
],
modulePathIgnorePatterns: ['<rootDir>/scripts/'],
testPathIgnorePatterns: ['<rootDir>/tests/sentry/lang/javascript/'],

unmockedModulePathPatterns: [
'<rootDir>/node_modules/react',
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ dependencies = [
"sentry-ophio>=1.1.3",
# sentry-options is only used in getsentry for now
"sentry-options>=1.0.13",
"sentry-protos>=0.16.1",
"sentry-protos>=0.17.0",
"sentry-redis-tools>=0.5.0",
"sentry-relay>=0.9.27",
"sentry-scm==0.16.0",
Expand Down
14 changes: 10 additions & 4 deletions scripts/extractFormFields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,14 @@ import {fileURLToPath} from 'node:url';

import * as ts from 'typescript';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
// Named THIS_FILE / THIS_DIR rather than the conventional __filename /
// __dirname so SWC's CJS transform (used by Jest) doesn't emit a
// `const __dirname = ...` that collides with the wrapper-provided
// binding and crashes the frontend test run with a SyntaxError.
// Behavior-equivalent at runtime — the originals only shadowed the
// wrapper inside this module.
const THIS_FILE = fileURLToPath(import.meta.url);
const THIS_DIR = path.dirname(THIS_FILE);

interface ExtractedField {
formId: string;
Expand Down Expand Up @@ -480,14 +486,14 @@ ${registryEntries}

// Main execution
try {
const configPath = path.join(__dirname, '../tsconfig.json');
const configPath = path.join(THIS_DIR, '../tsconfig.json');
const extractor = new FormFieldExtractor(configPath);

console.log('🔍 Extracting form fields from TypeScript files...');
const fields = extractor.extractAllFields();

const outputPath = path.join(
__dirname,
THIS_DIR,
'../static/app/components/core/form/generatedFieldRegistry.ts'
);

Expand Down
9 changes: 7 additions & 2 deletions scripts/genPlatformProductInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,13 @@ import {fileURLToPath} from 'node:url';
import * as ts from 'typescript';
import {parse as parseYaml} from 'yaml';

const __dirname = path.dirname(fileURLToPath(import.meta.url));
const SENTRY_ROOT = path.resolve(__dirname, '..');
// Named THIS_DIR rather than __dirname so SWC's CJS transform (used by Jest)
// doesn't emit a `const __dirname = ...` that collides with the wrapper-
// provided binding and crashes the whole frontend test run with a
// SyntaxError. The original `__dirname` only shadowed the wrapper inside
// this module anyway, so the rename is behavior-equivalent at runtime.
const THIS_DIR = path.dirname(fileURLToPath(import.meta.url));
const SENTRY_ROOT = path.resolve(THIS_DIR, '..');
const DOCS_ROOT = process.env.SENTRY_DOCS_PATH
? path.resolve(process.env.SENTRY_DOCS_PATH)
: path.resolve(SENTRY_ROOT, '..', 'sentry-docs');
Expand Down
2 changes: 1 addition & 1 deletion src/sentry/api/endpoints/organization_project_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class OrganizationProjectKeysEndpoint(OrganizationEndpoint):
),
],
)
def get(self, request: Request, organization) -> Response:
def get(self, request: Request, organization) -> Response[list[ProjectKeySerializerResponse]]:
"""
Return a list of client keys (DSNs) for all projects in an organization.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ class OrganizationSamplingEffectiveSampleRateEndpoint(OrganizationEndpoint):
404: RESPONSE_NOT_FOUND,
},
)
def get(self, request: Request, organization: Organization) -> Response:
def get(
self, request: Request, organization: Organization
) -> Response[OrganizationSamplingEffectiveSampleRateResponse]:
if not features.has("organizations:dynamic-sampling", organization, actor=request.user):
raise ResourceDoesNotExist

Expand Down
2 changes: 1 addition & 1 deletion src/sentry/api/endpoints/organization_sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class OrganizationSessionsEndpoint(OrganizationEndpoint):
},
examples=SessionExamples.QUERY_SESSIONS,
)
def get(self, request: Request, organization: Organization) -> Response:
def get(self, request: Request, organization: Organization) -> Response[SessionsQueryResult]:
"""
Returns a time series of release health session statistics for projects bound to an organization.

Expand Down
2 changes: 1 addition & 1 deletion src/sentry/api/endpoints/project_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@ class ProjectRulesEndpoint(ProjectEndpoint):
@deprecated(
ALERTS_API_DEPRECATION_DATE, suggested_api="sentry-api-0-organization-workflow-index"
)
def get(self, request: Request, project: Project) -> Response:
def get(self, request: Request, project: Project) -> Response[list[RuleSerializerResponse]]:
"""
## Deprecated
🚧 Use [Fetch an Organization's Monitors](/api/monitors/fetch-an-organizations-monitors) and [Fetch Alerts](/api/monitors/fetch-alerts) instead.
Expand Down
2 changes: 1 addition & 1 deletion src/sentry/core/endpoints/organization_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class OrganizationIndexEndpoint(Endpoint):
},
examples=UserExamples.LIST_ORGANIZATIONS,
)
def get(self, request: Request) -> Response:
def get(self, request: Request) -> Response[list[OrganizationSummarySerializerResponse]]:
"""
Return a list of organizations available to the authenticated session in a region.
This is particularly useful for requests with a user bound context. For API key-based requests this will only return the organization that belongs to the key.
Expand Down
4 changes: 3 additions & 1 deletion src/sentry/core/endpoints/organization_member_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,9 @@ class OrganizationMemberIndexEndpoint(OrganizationEndpoint):
},
examples=OrganizationMemberExamples.LIST_ORG_MEMBERS,
)
def get(self, request: Request, organization: Organization) -> Response:
def get(
self, request: Request, organization: Organization
) -> Response[list[OrganizationMemberResponse]]:
"""
List all organization members.

Expand Down
4 changes: 3 additions & 1 deletion src/sentry/core/endpoints/organization_teams.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ def team_serializer_for_post(self):
},
examples=TeamExamples.LIST_ORG_TEAMS,
)
def get(self, request: Request, organization: Organization) -> Response:
def get(
self, request: Request, organization: Organization
) -> Response[list[TeamSerializerResponse]]:
"""
Returns a list of teams bound to a organization.
"""
Expand Down
2 changes: 1 addition & 1 deletion src/sentry/core/endpoints/project_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class ProjectKeysEndpoint(ProjectEndpoint):
},
examples=ProjectExamples.LIST_CLIENT_KEYS,
)
def get(self, request: Request, project) -> Response:
def get(self, request: Request, project) -> Response[list[ProjectKeySerializerResponse]]:
"""
Return a list of client keys bound to a project.
"""
Expand Down
2 changes: 1 addition & 1 deletion src/sentry/core/endpoints/project_teams.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ProjectTeamsEndpoint(ProjectEndpoint):
},
examples=TeamExamples.LIST_PROJECT_TEAMS,
)
def get(self, request: Request, project) -> Response:
def get(self, request: Request, project) -> Response[list[BaseTeamSerializerResponse]]:
"""
Return a list of teams that have access to this project.
"""
Expand Down
4 changes: 3 additions & 1 deletion src/sentry/core/endpoints/scim/members.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,9 @@ class OrganizationSCIMMemberIndex(SCIMEndpoint):
},
examples=SCIMExamples.LIST_ORG_MEMBERS,
)
def get(self, request: Request, organization: Organization) -> Response:
def get(
self, request: Request, organization: Organization
) -> Response[SCIMListMembersResponse]:
"""
Returns a paginated list of members bound to a organization with a SCIM Users GET Request.
"""
Expand Down
4 changes: 3 additions & 1 deletion src/sentry/core/endpoints/scim/teams.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,9 @@ class OrganizationSCIMTeamIndex(SCIMEndpoint):
},
examples=SCIMExamples.LIST_ORG_PAGINATED_TEAMS,
)
def get(self, request: Request, organization: Organization, **kwds: Any) -> Response:
def get(
self, request: Request, organization: Organization, **kwds: Any
) -> Response[SCIMListTeamsResponse]:
"""
Returns a paginated list of teams bound to a organization with a SCIM Groups GET Request.

Expand Down
2 changes: 1 addition & 1 deletion src/sentry/core/endpoints/team_members.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class TeamMembersEndpoint(TeamEndpoint):
},
examples=TeamExamples.LIST_TEAM_MEMBERS,
)
def get(self, request: Request, team) -> Response:
def get(self, request: Request, team) -> Response[list[OrganizationMemberOnTeamResponse]]:
"""
List all members on a team.

Expand Down
4 changes: 3 additions & 1 deletion src/sentry/dashboards/endpoints/organization_dashboards.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,9 @@ class OrganizationDashboardsEndpoint(OrganizationEndpoint):
},
examples=DashboardExamples.DASHBOARDS_QUERY_RESPONSE,
)
def get(self, request: Request, organization: Organization) -> Response:
def get(
self, request: Request, organization: Organization
) -> Response[list[DashboardListResponse]]:
"""
Retrieve a list of custom dashboards that are associated with the given organization.
"""
Expand Down
4 changes: 3 additions & 1 deletion src/sentry/explore/endpoints/explore_saved_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,9 @@ def has_feature(self, organization, request):
},
examples=ExploreExamples.EXPLORE_SAVED_QUERIES_QUERY_RESPONSE,
)
def get(self, request: Request, organization: Organization) -> Response:
def get(
self, request: Request, organization: Organization
) -> Response[list[ExploreSavedQueryResponse]]:
"""
Retrieve a list of saved queries that are associated with the given organization.
"""
Expand Down
1 change: 0 additions & 1 deletion src/sentry/features/temporary.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,6 @@ def register_temporary_features(manager: FeatureManager) -> None:
manager.add("organizations:search-query-attribute-validation", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True)
# Enable search query builder raw search replacement
manager.add("organizations:search-query-builder-raw-search-replacement", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True)
manager.add("organizations:seer-agent-pr-consolidation", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True)
# Disables the enableSeerCoding setting, preventing orgs from changing code generation behavior
manager.add("organizations:seer-disable-coding-setting", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True)
# Enable GitLab as a supported SCM provider for Seer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def _update_single_project_configuration(
)
def put(
self, request: Request, organization: Organization, data_forwarder: DataForwarder
) -> Response:
) -> Response[DataForwarderResponse]:
"""
Updates a data forwarder for an organization or update a project-specific override.
Updates to the data forwarder's configuration require `org:write` permissions, and the entire
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class DataForwardingIndexEndpoint(OrganizationEndpoint):
)
@set_referrer_policy("strict-origin-when-cross-origin")
@method_decorator(never_cache)
def get(self, request: Request, organization) -> Response:
def get(self, request: Request, organization) -> Response[list[DataForwarderResponse]]:
"""
Returns a list of data forwarders for an organization.
"""
Expand All @@ -79,7 +79,7 @@ def get(self, request: Request, organization) -> Response:
)
@set_referrer_policy("strict-origin-when-cross-origin")
@method_decorator(never_cache)
def post(self, request: Request, organization) -> Response:
def post(self, request: Request, organization) -> Response[DataForwarderResponse]:
"""
Creates a new data forwarder for an organization.
Only one data forwarder can be created per provider for a given organization.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def get(
organization_context: RpcUserOrganizationContext,
integration_id: int,
**kwds: Any,
) -> Response:
) -> Response[OrganizationIntegrationResponse]:
org_integration = self.get_organization_integration(
organization_context.organization.id, integration_id
)
Expand Down Expand Up @@ -153,7 +153,7 @@ def post(
installation.update_organization_config(request.data)
except (IntegrationError, ApiError) as e:
sentry_sdk.capture_exception(e)
return self.respond({"detail": [str(e)]}, status=400)
return self.respond({"detail": str(e)}, status=400)

self.create_audit_entry(
request=request,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ class OrganizationRepositoryCommitsEndpoint(OrganizationEndpoint):
),
],
)
def get(self, request: Request, organization, repo_id) -> Response:
def get(
self, request: Request, organization, repo_id
) -> Response[list[CommitSerializerResponse]]:
"""
List a Repository's Commits
"""
Expand Down
2 changes: 1 addition & 1 deletion src/sentry/issues/endpoints/group_tagkey_values.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class GroupTagKeyValuesEndpoint(GroupEndpoint):
examples=[TagsExamples.GROUP_TAGKEY_VALUES],
)
@deprecated(CELL_API_DEPRECATION_DATE, url_names=["sentry-api-0-group-tag-key-values"])
def get(self, request: Request, group, key) -> Response:
def get(self, request: Request, group, key) -> Response[list[TagValueSerializerResponse]]:
"""
List a Tag's Values
"""
Expand Down
2 changes: 1 addition & 1 deletion src/sentry/issues/endpoints/organization_shortid.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class ShortIdLookupEndpoint(GroupEndpoint):
)
],
)
def get(self, request: Request, group: Group) -> Response:
def get(self, request: Request, group: Group) -> Response[ShortIdLookupResponse]:
"""
Resolve a short ID to the project slug and group details.
"""
Expand Down
4 changes: 3 additions & 1 deletion src/sentry/issues/endpoints/project_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ class ProjectEventsEndpoint(ProjectEndpoint):
},
examples=EventExamples.PROJECT_EVENTS_SIMPLE,
)
def get(self, request: Request, project: Project) -> Response:
def get(
self, request: Request, project: Project
) -> Response[list[SimpleEventSerializerResponse]]:
"""
Return a list of events bound to a project.
"""
Expand Down
4 changes: 3 additions & 1 deletion src/sentry/issues/endpoints/source_map_debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ class SourceMapDebugEndpoint(ProjectEndpoint):
404: RESPONSE_NOT_FOUND,
},
)
def get(self, request: Request, project: Project, event_id: str) -> Response:
def get(
self, request: Request, project: Project, event_id: str
) -> Response[SourceMapProcessingResponse]:
"""
Return a list of source map errors for a given event.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ class OrganizationMonitorCheckInIndexEndpoint(MonitorEndpoint, MonitorCheckInMix
404: RESPONSE_NOT_FOUND,
},
)
def get(self, request: Request, organization, project, monitor) -> Response:
def get(
self, request: Request, organization, project, monitor
) -> Response[list[MonitorCheckInSerializerResponse]]:
"""
Retrieve a list of check-ins for a monitor
"""
Expand Down
8 changes: 6 additions & 2 deletions src/sentry/monitors/endpoints/organization_monitor_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ class OrganizationMonitorIndexEndpoint(OrganizationAlertRuleBaseEndpoint):
404: RESPONSE_NOT_FOUND,
},
)
def get(self, request: AuthenticatedHttpRequest, organization: Organization) -> Response:
def get(
self, request: AuthenticatedHttpRequest, organization: Organization
) -> Response[list[MonitorSerializerResponse]]:
"""
Lists monitors, including nested monitor environments. May be filtered to a project or environment.
"""
Expand Down Expand Up @@ -309,7 +311,9 @@ def post(self, request: AuthenticatedHttpRequest, organization) -> Response:
404: RESPONSE_NOT_FOUND,
},
)
def put(self, request: AuthenticatedHttpRequest, organization) -> Response:
def put(
self, request: AuthenticatedHttpRequest, organization
) -> Response[MonitorBulkEditResponse]:
"""
Bulk edit the muted and disabled status of a list of monitors determined by slug
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ class OrganizationMonitorProcessingErrorsIndexEndpoint(OrganizationEndpoint):
404: RESPONSE_NOT_FOUND,
},
)
def get(self, request: AuthenticatedHttpRequest, organization: Organization) -> Response:
def get(
self, request: AuthenticatedHttpRequest, organization: Organization
) -> Response[list[CheckinProcessingErrorData]]:
"""
Retrieves checkin processing errors for an organization
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ class ProjectMonitorCheckInIndexEndpoint(ProjectMonitorEndpoint, MonitorCheckInM
404: RESPONSE_NOT_FOUND,
},
)
def get(self, request: Request, project, monitor) -> Response:
def get(
self, request: Request, project, monitor
) -> Response[list[MonitorCheckInSerializerResponse]]:
"""
Retrieve a list of check-ins for a monitor
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ class ProjectMonitorProcessingErrorsIndexEndpoint(ProjectMonitorEndpoint):
404: RESPONSE_NOT_FOUND,
},
)
def get(self, request: AuthenticatedHttpRequest, project, monitor) -> Response:
def get(
self, request: AuthenticatedHttpRequest, project, monitor
) -> Response[list[CheckinProcessingErrorData]]:
"""
Retrieves checkin processing errors for a monitor
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def get(
self,
request: Request,
project: Project,
) -> Response:
) -> Response[LatestInstallableBuildResponseDict]:
"""
Get the latest installable build for a project.

Expand Down
Loading
Loading