Skip to content

feat(preprod): Expose installUrl and artifactUrl on assemble + build details#115225

Open
joshdholtz wants to merge 6 commits intogetsentry:masterfrom
joshdholtz:feat/preprod-assemble-install-url
Open

feat(preprod): Expose installUrl and artifactUrl on assemble + build details#115225
joshdholtz wants to merge 6 commits intogetsentry:masterfrom
joshdholtz:feat/preprod-assemble-install-url

Conversation

@joshdholtz
Copy link
Copy Markdown

@joshdholtz joshdholtz commented May 8, 2026

Summary

  • Assemble endpoint: add installUrl (alongside the existing artifactUrl) to the CREATED-state success response of ProjectPreprodArtifactAssembleEndpoint. Companion to sentry-cli #3292 — unblocks sentry-cli build upload surfacing the install URL.
  • Build details endpoint: add artifact_url and install_url to BuildDetailsApiResponse (also flowing through the builds list, PR comment adapters, and size-analysis compare endpoints that share the same transform). Until now, the assemble response was the only way to obtain these URLs — there was no GET endpoint to retrieve them for an existing artifact.
  • Helper: get_preprod_artifact_url now accepts an optional organization kwarg so callers building multiple URLs for the same artifact avoid repeated Organization cache lookups.

itms-services:// manifest URL is intentionally out of scope: it depends on InstallablePreprodArtifact.url_path, which is created by the async assemble_preprod_artifact_installable_app task after assemble returns.

Test plan

  • pytest tests/sentry/preprod/api/endpoints/test_organization_preprod_artifact_assemble.py -v
  • pytest tests/sentry/preprod/api/endpoints/test_project_preprod_build_details.py -v
  • Confirm installUrl matches /organizations/<slug>/preprod/install/<artifact_id> with the org's absolute URL prefix
  • Confirm artifactUrl and existing build details fields are unchanged

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label May 8, 2026
@joshdholtz joshdholtz marked this pull request as ready for review May 8, 2026 20:09
@joshdholtz joshdholtz requested a review from a team as a code owner May 8, 2026 20:09
Copilot AI review requested due to automatic review settings May 8, 2026 20:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an installUrl field to the successful (CREATED) response of the preprod artifact assemble endpoint so clients (e.g. sentry-cli) can immediately link to the install page without an extra request or scraping output.

Changes:

  • Return installUrl alongside artifactUrl when the assemble endpoint returns state=CREATED.
  • Extend assemble endpoint tests to assert the new installUrl is present and contains the expected /organizations/<slug>/preprod/install/<artifact_id> path.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/sentry/preprod/api/endpoints/organization_preprod_artifact_assemble.py Adds installUrl to the assemble success response by generating an install-view URL.
tests/sentry/preprod/api/endpoints/test_organization_preprod_artifact_assemble.py Updates tests to validate installUrl is returned and points at the expected install route.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

joshdholtz added a commit to joshdholtz/sentry that referenced this pull request May 8, 2026
Address Copilot review feedback on getsentry#115225. The assemble endpoint now
calls get_preprod_artifact_url twice (artifactUrl + installUrl), each
of which previously did its own Organization.objects.get_from_cache.
Add an optional organization kwarg so the caller can fetch once and
reuse it for both URLs.
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 88cdf84. Configure here.

Comment thread SPEC_installUrl.md Outdated
joshdholtz added 3 commits May 8, 2026 15:20
Adds an installUrl field to the CREATED-state success response of
ProjectPreprodArtifactAssembleEndpoint so sentry-cli build upload can
surface the install page directly without scraping stdout or making a
follow-up request.

Companion to sentry-cli getsentry#3292.
Address Copilot review feedback on getsentry#115225. The assemble endpoint now
calls get_preprod_artifact_url twice (artifactUrl + installUrl), each
of which previously did its own Organization.objects.get_from_cache.
Add an optional organization kwarg so the caller can fetch once and
reuse it for both URLs.
@joshdholtz joshdholtz force-pushed the feat/preprod-assemble-install-url branch from b2170f3 to f855f57 Compare May 8, 2026 20:20
Until now the only way to get the install page URL from the API was the
assemble response. Anyone who lost the response (or wanted to look up
an existing artifact) had no way to retrieve it.

Add artifact_url and install_url to BuildDetailsApiResponse so the
build details and builds list endpoints expose them to GET callers.
Both are derived from get_preprod_artifact_url, with a single
Organization cache lookup reused for both URLs.
@joshdholtz joshdholtz changed the title feat(preprod): Return installUrl from artifact assemble endpoint feat(preprod): Expose installUrl and artifactUrl on assemble + build details May 8, 2026
@joshdholtz joshdholtz changed the title feat(preprod): Expose installUrl and artifactUrl on assemble + build details feat(preprod): Expose installUrl and artifactUrl on assemble + build details May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants