Skip to content

Expose every release a build has been put into - #1255

Merged
anfimovdm merged 1 commit into
AlmaLinux:masterfrom
eabdullin1:master
Sep 1, 2026
Merged

Expose every release a build has been put into#1255
anfimovdm merged 1 commit into
AlmaLinux:masterfrom
eabdullin1:master

Conversation

@eabdullin1

Copy link
Copy Markdown
Contributor

Summary

builds.release_id only keeps the release a build got into last — commit_release() overwrites it for every build in the plan — so a build released more than once has no way of telling about its earlier releases. Build 77924 is released both to almalinux10-beta (51142) and to AlmaLinux Kitten 10 (50862), and the API reports only the former.

The build-to-releases link lives on the other side, in build_releases.build_ids, and nothing exposes it: GET /releases/ takes no build_id, and every release it returns carries the whole release plan — release 51142 alone serializes to 2.3 MB — so walking the release feed is not an option for a caller either.

Changes

  • GET /builds/{build_id}/releases/ on the public router, since the build page is public. Returns id, status, created_at, platform_name and product_name per release, newest first.
  • build_crud.get_build_releases() looks the history up from the releases side with :build_id = ANY(build_releases.build_ids), joins platform and product, and selects columns explicitly so plan stays out of both the query and the response. Answers are hundreds of bytes.
  • build_schema.BuildRelease for the returned rows.
  • Reverted releases are returned along with the rest, each carrying its status. What to show is left to the caller — the frontend hides the reverted ones.

Testing

  • tests/test_api/test_releases.py::test_get_build_releases, placed before the revert tests so the release it looks up is still COMPLETED.
  • The suite was not run here (needs the docker test stand); the change is py_compile clean and the array containment compiles to the expected :id = ANY (build_releases.build_ids).
  • build_releases holds ~8.4k rows, so the sequential scan behind = ANY(...) is cheap. A GIN index on build_ids can be added later if the table grows.

Frontend counterpart: AlmaLinux/albs-frontend#605

builds.release_id only keeps the release a build got into last, so a
build released more than once, to different products or platforms, has
no way to tell about the earlier releases. The build to releases link
lives on the other side, in build_releases.build_ids, and there is no
way to query it: GET /releases/ takes no build_id, and every release it
returns carries the whole release plan, megabytes of it.

Add GET /builds/{build_id}/releases/, which looks the history up from
the releases side with :build_id = ANY(build_ids). Columns are selected
explicitly so the plan stays out of both the query and the response.
Reverted releases are returned along with the rest, each with its
status, and it is up to the caller to decide what to show.
@anfimovdm
anfimovdm merged commit a6cc8f6 into AlmaLinux:master Sep 1, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants