feat(api-docs): publish project releases list endpoint#116220
Open
cvxluo wants to merge 2 commits into
Open
Conversation
67d626a to
da14670
Compare
`release_details_types.Author` was a hand-rolled duplicate of the `UserSerializerResponse | NonMappableUser` union that `get_users_for_authors()` already returns from `models/release.py`. It declared `id: int` (runtime emits `str(obj.id)`) and made 8 fields required that the serializer omits for unmatched git committers. The published `OrganizationReleaseDetailsEndpoint` schema therefore advertised a shape never produced; clients codegen'd against it break on `authors[].id` typing or on any release with an external git committer. Move the canonical `Author` and `NonMappableUser` definitions from `models/release.py` into `release_details_types.py` (the type-only module `models/release.py` already imports `VersionInfo` from). `models/release.py`, `models/commit.py`, `models/pullrequest.py`, and `utils/committers.py` import them back from there. Single source of truth, no rename — the union is the same shape regardless of commit/PR/release context. Importing `UserSerializerResponse` here creates a cycle via `api/serializers/types.py`. Break it by moving `SerializedAvatarFields` out of `types.py` into `users/api/serializers/user.py`, where it's primarily used as `UserSerializerResponse.avatar`. Updates the `team`/`project`/`organization` serializer import paths and bumps the existing `RetrieveReleaseDetails` example (`authors[0].id` int → str) so the now-truthful schema validates. Co-authored-by: Claude <noreply@anthropic.com>
Promotes GET /api/0/projects/{org}/{proj}/releases/ from UNKNOWN to PUBLIC
and adds drf-spectacular OpenAPI documentation. Reuses the existing
ReleaseSerializerResponse TypedDict and adds a ReleaseExamples fixture
with a LIST_PROJECT_RELEASES example.
POST stays UNKNOWN for now since publishing a create endpoint needs its
own request-body schema and is a separate scope.
Co-authored-by: Claude <noreply@anthropic.com>
da14670 to
c1ac7b7
Compare
JoshFerge
approved these changes
May 28, 2026
Base automatically changed from
cvxluo/align-author-response-shape-with-runtime
to
master
May 29, 2026 21:37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update the docs for the project releases endpoint to use the modern drf-spec system. Adds an example + an API doc test. Stacked on #116358