feat(web): admin UI to edit and create application distribution config #64
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/bunyip-51-app-distribution-admin-ui"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Add a web admin UI to edit and create an application's Forgejo binary and OCI container distribution config. The bunyip-api backend already accepted these fields (validated by
DistributionConfig::validateon both create and update); the gap was entirely in bunyip-web, which only exposedis_active/maintenance_modetoggles, dropped the distribution fields from itsAdminApplicationDTO, and had no create-application form.Changes
GET /admin/applications/{id}/editrenders a distribution form prefilled from the current row;POST /admin/applications/{id}/distributionpersists via the existingPUT /admin/applications/{id}.GET /admin/applications/newplusPOST /admin/applications, capturing the required identity fields (name, slug, display_name, container_name) plus distribution config, via a newadmin_api::create_applicationclient.artifact_sourcerenders as a select (release|generic_package). Empty inputs are omitted so existing column values are kept, EXCEPTforgejo_package, which is always sent so an empty value clears it to NULL via the backend's documented sentinel.forgejo_packageon areleasesource, empty/whitespace values) are surfaced as an inline error banner with the submitted values preserved, instead of being silently swallowed.AdminApplicationDTO with the eight distribution fields for prefill.forgejo_packageclear-to-NULL sentinel.Verification
just check-containergreen: fmt, clippy-D warnings, and tests. bunyip-web is a binary crate, so its unit tests run undercargo test -p bunyip-web --bins(3 new tests pass alongside the existing 7).Issue
BUNYIP-51
The bunyip-api backend already accepts the full per-application distribution config (Forgejo binary coordinates artifact_source/forgejo_owner/forgejo_repo/forgejo_package/pinned_release_tag and OCI container coordinates oci_image_owner/oci_image_name/pinned_image_tag, validated by DistributionConfig::validate on both create and update), but the bunyip-web admin UI exposed none of it: the applications page had only is_active/maintenance_mode toggles, the AdminApplication DTO dropped the distribution fields, and there was no create-application form at all. Add an edit form (per-application Edit action, GET /admin/applications/{id}/edit, POST .../distribution) and a create form (New application action, GET /admin/applications/new, POST /admin/applications), both reusing the existing PUT/POST endpoints. The edit form scopes to distribution fields; the create form adds the required identity fields (name, slug, display_name, container_name). artifact_source renders as a select, the form prefills from the current row, and empty inputs are omitted so existing values are kept, EXCEPT forgejo_package which is always sent so an empty value clears it to NULL via the backend sentinel. Backend validation failures (partial OCI/release triples, forgejo_package on a release source, empty values) are now surfaced as an inline error banner with the submitted values preserved, instead of being silently swallowed. Extend the web AdminApplication DTO to deserialize the eight distribution fields for prefill, add an admin_api::create_application client, and unit-test the request-body builders for the omit-empty and forgejo_package clear-to-NULL semantics. #BUNYIP-51 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>