Skip to content

feat(api-docs): publish project releases list endpoint#116220

Open
cvxluo wants to merge 2 commits into
masterfrom
cvxluo/publish-project-releases-list-endpoint
Open

feat(api-docs): publish project releases list endpoint#116220
cvxluo wants to merge 2 commits into
masterfrom
cvxluo/publish-project-releases-list-endpoint

Conversation

@cvxluo
Copy link
Copy Markdown
Contributor

@cvxluo cvxluo commented May 26, 2026

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

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label May 26, 2026
@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 26, 2026

ID-1540

ID-1569

@cvxluo cvxluo force-pushed the cvxluo/publish-project-releases-list-endpoint branch 4 times, most recently from 67d626a to da14670 Compare May 28, 2026 05:16
cvxluo and others added 2 commits May 28, 2026 09:20
`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>
@cvxluo cvxluo force-pushed the cvxluo/publish-project-releases-list-endpoint branch from da14670 to c1ac7b7 Compare May 28, 2026 16:23
@cvxluo cvxluo changed the base branch from master to cvxluo/align-author-response-shape-with-runtime May 28, 2026 20:54
@cvxluo cvxluo marked this pull request as ready for review May 28, 2026 20:55
@cvxluo cvxluo requested review from a team as code owners May 28, 2026 20:55
@cvxluo cvxluo requested a review from a team May 28, 2026 20:55
Base automatically changed from cvxluo/align-author-response-shape-with-runtime to master May 29, 2026 21:37
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