506e4a49d6
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
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
23 lines
805 B
Go
23 lines
805 B
Go
// Copyright 2026 Moko Consulting <hello@mokoconsulting.tech>
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
package setting
|
|
|
|
// Metadata holds instance-level settings for the repository metadata feature.
|
|
var Metadata = struct {
|
|
// PlatformOptions is the admin-configurable list of allowed values for the
|
|
// repo metadata "platform" field. Editable via Admin -> Metadata (persisted
|
|
// to app.ini [metadata] PLATFORM_OPTIONS) so changing the taxonomy needs no
|
|
// code change or redeploy. See issue #777.
|
|
PlatformOptions []string
|
|
}{
|
|
PlatformOptions: []string{"joomla", "dolibarr", "go", "npm", "generic"},
|
|
}
|
|
|
|
func loadMetadataFrom(rootCfg ConfigProvider) {
|
|
sec := rootCfg.Section("metadata")
|
|
if opts := sec.Key("PLATFORM_OPTIONS").Strings(","); len(opts) > 0 {
|
|
Metadata.PlatformOptions = opts
|
|
}
|
|
}
|