Metadata: make the platform dropdown editable via settings (not hardcoded) #777

Closed
opened 2026-07-13 16:34:04 +00:00 by jmiller · 0 comments
Owner

Summary

The repository Metadata feature renders the platform field as a hardcoded dropdown (enum) in the MokoGitea fork. The option list lives in code, so changing it requires editing the fork and redeploying.

Motivation

We just consolidated the platform taxonomy — node + mcp were merged into a single npm type. Current values are now:

joomla, dolibarr, go, npm, generic

Every taxonomy change (add/remove/rename a platform) currently means a code change + rebuild + redeploy of the fork, plus keeping it in sync with mokocli and the MANIFEST-STANDARD docs. That is brittle and slow.

Request

Make the platform dropdown options configurable through settings rather than hardcoded:

  • An admin/instance-level setting (or org-level config) that defines the allowed platform values, and
  • The Metadata platform dropdown reads its options from that setting.

Acceptance criteria

  • Platform options are defined in a setting (admin UI and/or config), not in source.
  • Settings -> Metadata platform dropdown is populated from that setting.
  • Adding/removing/renaming a platform needs no code change or redeploy.
  • Existing repo metadata values are preserved (migration/validation for values no longer in the list).
  • Default seed list: joomla, dolibarr, go, npm, generic.

Notes

  • Related: the package-type field may warrant the same treatment for consistency.
  • Keep the REST API (GET/PUT /api/v1/repos/{owner}/{repo}/manifest) accepting the configured values.
### Summary The repository **Metadata** feature renders the `platform` field as a **hardcoded dropdown** (enum) in the MokoGitea fork. The option list lives in code, so changing it requires editing the fork and redeploying. ### Motivation We just consolidated the platform taxonomy — `node` + `mcp` were merged into a single **`npm`** type. Current values are now: `joomla`, `dolibarr`, `go`, `npm`, `generic` Every taxonomy change (add/remove/rename a platform) currently means a code change + rebuild + redeploy of the fork, plus keeping it in sync with `mokocli` and the `MANIFEST-STANDARD` docs. That is brittle and slow. ### Request Make the `platform` dropdown options **configurable through settings** rather than hardcoded: - An **admin/instance-level setting** (or org-level config) that defines the allowed `platform` values, and - The Metadata `platform` dropdown reads its options from that setting. ### Acceptance criteria - [ ] Platform options are defined in a setting (admin UI and/or config), not in source. - [ ] Settings -> Metadata `platform` dropdown is populated from that setting. - [ ] Adding/removing/renaming a platform needs no code change or redeploy. - [ ] Existing repo metadata values are preserved (migration/validation for values no longer in the list). - [ ] Default seed list: `joomla`, `dolibarr`, `go`, `npm`, `generic`. ### Notes - Related: the `package-type` field may warrant the same treatment for consistency. - Keep the REST API (`GET/PUT /api/v1/repos/{owner}/{repo}/manifest`) accepting the configured values.
Sign in to join this conversation.