Skip to content

fix(releases): Pass Environment objects to get_latest_release#115637

Merged
mrduncan merged 1 commit into
masterfrom
mrduncan/fix-latest-release-environment-objects
May 15, 2026
Merged

fix(releases): Pass Environment objects to get_latest_release#115637
mrduncan merged 1 commit into
masterfrom
mrduncan/fix-latest-release-environment-objects

Conversation

@mrduncan
Copy link
Copy Markdown
Member

The releases list endpoint passed filter_params["environment"] (a list of environment name strings) to get_latest_release when resolving release:latest filters. get_latest_release expects Sequence[Environment] and dereferences e.id on each item, raising AttributeError: 'str' object has no attribute 'id' whenever the request also specified an environment.

Switch to filter_params["environment_objects"], which is populated alongside environment and contains the resolved Environment objects. Other call sites in this file correctly pass name strings to APIs that accept names, so they are unchanged.

Fixes SENTRY-548A

The releases list endpoint passed `filter_params["environment"]` (a list
of environment name strings) to `get_latest_release` when resolving
`release:latest` filters. `get_latest_release` expects `Sequence[Environment]`
and dereferences `e.id` on each item, raising `AttributeError: 'str' object
has no attribute 'id'` whenever the request also specified an environment.

Switch to `filter_params["environment_objects"]`, which is populated
alongside `environment` and contains the resolved Environment objects.
Other call sites in this file correctly pass name strings to APIs that
accept names, so they are unchanged.

Fixes SENTRY-548A
Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label May 15, 2026
@mrduncan mrduncan marked this pull request as ready for review May 15, 2026 16:35
@mrduncan mrduncan requested review from a team as code owners May 15, 2026 16:35
@mrduncan mrduncan merged commit 2a87f2f into master May 15, 2026
63 checks passed
@mrduncan mrduncan deleted the mrduncan/fix-latest-release-environment-objects branch May 15, 2026 18:29
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