feat(metadata): admin-configurable platform dropdown options (#777) #782

Merged
jmiller merged 1 commits from feature/metadata-platform-configurable into dev 2026-07-14 03:28:54 +00:00
Owner

Closes #777.

The repo metadata platform field was a hardcoded enum (and the list had drifted: it still had wordpress/mcp/a stray platform, missing npm). This makes it admin-configurable so taxonomy changes need no code change or redeploy.

Changes

  • modules/setting/metadata.go (new): [metadata] PLATFORM_OPTIONS setting, default joomla,dolibarr,go,npm,generic, loaded in loadCommonSettingsFrom.
  • Admin -> Metadata page (routers/web/admin/metadata.go + templates/admin/metadata.tmpl): edit the list (comma/newline input, normalized lowercase/dedupe), persisted to app.ini, applied in-memory immediately. New route + nav entry.
  • Repo Settings -> Metadata: platform dropdown now reads from the setting; a repo's current value stays selectable even if later removed from the list (no silent drop on save).
  • CHANGELOG updated.

Acceptance criteria

  • Options defined in a setting (admin UI + app.ini), not source
  • Dropdown populated from the setting
  • Add/remove/rename with no code change or redeploy
  • Existing repo values preserved (current value kept selectable)
  • Default seed joomla,dolibarr,go,npm,generic
  • REST API already accepts any configured value (no enum enforcement) — unchanged

Verification

  • go build of modules/setting, routers/web/admin, routers/web/repo/setting, routers/web: pass
  • gofmt clean

Note: package-type could get the same treatment later (issue notes this).

Closes #777. The repo metadata `platform` field was a hardcoded enum (and the list had drifted: it still had `wordpress`/`mcp`/a stray `platform`, missing `npm`). This makes it **admin-configurable** so taxonomy changes need no code change or redeploy. ### Changes - **`modules/setting/metadata.go`** (new): `[metadata] PLATFORM_OPTIONS` setting, default `joomla,dolibarr,go,npm,generic`, loaded in `loadCommonSettingsFrom`. - **Admin -> Metadata page** (`routers/web/admin/metadata.go` + `templates/admin/metadata.tmpl`): edit the list (comma/newline input, normalized lowercase/dedupe), persisted to `app.ini`, applied in-memory immediately. New route + nav entry. - **Repo Settings -> Metadata**: platform dropdown now reads from the setting; a repo's current value stays selectable even if later removed from the list (no silent drop on save). - CHANGELOG updated. ### Acceptance criteria - [x] Options defined in a setting (admin UI + `app.ini`), not source - [x] Dropdown populated from the setting - [x] Add/remove/rename with no code change or redeploy - [x] Existing repo values preserved (current value kept selectable) - [x] Default seed `joomla,dolibarr,go,npm,generic` - REST API already accepts any configured value (no enum enforcement) — unchanged ### Verification - `go build` of `modules/setting`, `routers/web/admin`, `routers/web/repo/setting`, `routers/web`: pass - `gofmt` clean Note: `package-type` could get the same treatment later (issue notes this).
jmiller added 1 commit 2026-07-13 22:27:48 +00:00
feat(metadata): admin-configurable platform dropdown options
Universal: Auto Version Bump / Version Bump (push) Successful in 11s
PR RC Release / Build RC Release (pull_request) Successful in 2s
Universal: PR Check / Branch Policy (pull_request) Successful in 2s
Universal: PR Check / Require Docs Update (pull_request) Has been skipped
Universal: PR Check / Wiki Update Reminder (pull_request) Has been skipped
Generic: Project CI / Lint & Validate (pull_request) Successful in 29s
Generic: Project CI / Tests (pull_request) Successful in 29s
Universal: PR Check / Validate PR (pull_request) Successful in 7s
Universal: PR Check / Secret Scan (pull_request) Successful in 44s
Universal: PR Check / Build RC Package (pull_request) Has been cancelled
Universal: PR Check / Report Issues (pull_request) Has been cancelled
Branch Cleanup / Delete merged branch (pull_request) Has been cancelled
RC Revert / Rename rc/ back to dev/ (pull_request) Has been cancelled
506e4a49d6
The repo metadata 'platform' field was a hardcoded enum; changing the
taxonomy meant a code change + redeploy. Make it admin-configurable:

- modules/setting/metadata.go: new [metadata] PLATFORM_OPTIONS setting
  (default joomla,dolibarr,go,npm,generic), loaded in loadCommonSettingsFrom
- routers/web/admin/metadata.go + templates/admin/metadata.tmpl: new
  Admin -> Metadata page to edit the list (persisted to app.ini), with a
  nav entry and route
- routers/web/repo/setting/metadata.go + template: platform dropdown now
  reads from the setting; a repo's current value stays selectable even if
  removed from the list (no silent drop)

Closes #777
jmiller merged commit 4b5cadfd79 into dev 2026-07-14 03:28:54 +00:00
jmiller deleted branch feature/metadata-platform-configurable 2026-07-14 03:28:55 +00:00
Sign in to join this conversation.