feat(preprod): Add public install-details endpoint and shared utilities#109583
feat(preprod): Add public install-details endpoint and shared utilities#109583
Conversation
- Add organization-scoped public install-details endpoint - Add platform property to PreprodArtifact model - Add ArtifactInstallInfo and get_artifact_install_info utility - Refactor existing install-details endpoint to use shared utility - Refactor size_analysis tasks to use model platform property - Add install info response models and OpenAPI examples
|
🚨 Warning: This pull request contains Frontend and Backend changes! It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently. Have questions? Please ask in the |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
src/sentry/preprod/api/endpoints/project_preprod_artifact_install_details.py
Show resolved
Hide resolved
8d99752 to
12b6f00
Compare
Compare against Platform.APPLE and Platform.ANDROID enum members instead of raw string literals for consistency and type safety. Co-Authored-By: Claude <noreply@anthropic.com>
Uppercase the platform enum value in public endpoint responses for consistency with other enum fields like artifactType. Internal endpoints are unchanged. Co-Authored-By: Claude <noreply@anthropic.com>
Consolidate public build distribution response models into a single file, consistent with how size_analysis.py is organized.
| "install_groups": info.install_groups, | ||
| } | ||
|
|
||
| # Only include iOS-specific fields for iOS apps |
There was a problem hiding this comment.
Why remove this comment?
There was a problem hiding this comment.
No strong reason, I removed some other comments earlier in the file and this one also seemed like an obvious comment based on the if head_artifact.artifact_type == PreprodArtifact.ArtifactType.XCARCHIVE: code.
…ept-encoding * origin/master: (63 commits) fix(api): Add missing cursor query parameter to paginated endpoint OpenAPI schemas (#109642) docs(sentry-apps): Add sentryAppId to sentry-app-installations API schema (#109628) feat(occurrences on eap): Implement double reads from EAP in organization events trace API endpoint (#109391) feat(occurrences on eap): Implement double reads from EAP for reprocessing2 flow (#109345) feat(ci): report backend test fails (#109543) feat(seer): Add signed viewer context header to Seer API requests (#109626) devenv: cleanup devenv-managed uv (#109617) feat(seer): Iterate on the instructions at the top of seer settings pages (#109586) ref(seer): Add typed wrappers for remaining Seer API callsites (#109607) feat(preprod): Make snapshots endpoint org scoped (#109575) chore: capture exception (#109620) fix(formatting): run ruff format (#109618) feat(preprod): Create admin gated recompare snapshots endpoint (#109546) feat(cells): expand locality/cell distinction (#109538) feat(cells): add db migration for synapse (#109615) feat(preprod): Add public install-details endpoint and shared utilities (#109583) fix(tests): Fix flaky test_cross_trace_query_with_spans_and_logs (#109572) fix(grouping): Resolve mypy possibly-undefined errors in grouphash caching (#109602) fix(dashboards): Default axisRange to auto for existing widgets in builder (#109598) fix(billing): Fix category display names in pending changes (#109612) ...
Summary
Split from #109377. Adds the install-details public endpoint and the shared utilities that the
/latestendpoint also depends on.GET /api/0/organizations/{org}/preprodartifacts/{artifact_id}/install-details/Returns distribution and installation details for a specific artifact: installability state, download URL, download count, release notes, install groups, and iOS-specific code signing info (signature validity, profile name, codesigning type). Always returns 200 with the install state rather than 404 when not installable.
ArtifactInstallInfodataclass inbuild_distribution_utils.pyso the new public install info endpoint and the existing experimentalProjectPreprodInstallDetailsEndpointshare install-state computation logic without duplicating it.platformproperty toPreprodArtifactmodel and consolidates platform mapping.Testing locally: