feat(admin): show Hub/Binary/OCI surface tags on applications #142
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/bunyip-99-admin-surface-tags"
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
Admins could not tell at a glance which distribution surfaces an application reaches. This adds three derived badges (Hub, Binary, OCI) to each app on the admin Applications list and at the top of the edit form: colored when the app is served in that surface, a muted "No X" outline when it is not.
How
A new
SurfaceVisibilityhelper inbunyip-web/src/handlers/admin.rsderives the three predicates fromAdminApplication, mirroring the canonical bunyip-domain rules so the badges cannot silently disagree with what users actually see:is_active && is_hosted(matchesApplicationRepository::list_active_hosted).forgejo_owner+pinned_release_tag+ repo-or-package depending onartifact_source(mirrorsApplication::download_source/is_downloadable).is_active+ all three OCI fields set (mirrorsApplication::is_pullable).The helper carries a doc comment pointing at those domain sources so a future change has a breadcrumb.
Noneand empty/whitespace fields count as absent. Badges reuse the existingbadge()component. The sharedapplication_formgains anOption<&SurfaceVisibility>arg: the edit-GET path of a persisted app passesSome; create and error re-renders passNone.Web-only: no bunyip-api, DTO wire, or database/migration change.
Verification
just check-container(fmt + clippy-D warnings+ workspace lib tests) is green on the change: fmt clean, clippy clean, 185 tests pass.One pre-existing, unrelated failure surfaced locally:
bunyip-domainconfig::tests::test_config_defaults. It doesenv::remove_var("RUST_LOG")then asserts the default, butConfig::from_env()callsdotenvy::dotenv()which reloads the developer's gitignored.env(RUST_LOG=info,bunyip_api=debug), overriding the removal. It is green in CI (clean checkout, no.env) and is untouched by this PR (web-only). Worth a separate tracking issue.#BUNYIP-99