[Bug] Metadata org field should be derived from the org profile, not stored/editable
#771
Reference in New Issue
Block a user
Delete Branch "%!s()"
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?
Summary
The repository metadata
Organizationfield (RepoMetadata.Org, DB columnrepo_manifest.org) is a manually-entered, stored value that can silently drift from the actual organization (the repository owner / org profile). It should instead be derived from the org profile wherever it is consumed, including the update-server feed.Current behavior
Orgis a first-class stored column (models/repo/repo_manifest.go).orgas input and persist a snapshot of the owner name:routers/api/v1/repo/manifest.go(setStr("org", &m.Org), defaults toOwnerName).routers/web/repo/setting/metadata.go(Org: ctx.FormString("org")).mcp-mokogitea-apimetadata_updateexposesorgas settable.services/updateserver/joomla.go) never readsOrgat all — it already derives the maintainer fromrepo.Owner. The storedOrgis therefore redundant and a drift hazard: rename the org and every repo's storedorgis stale.Expected behavior
Organizationis derived from the org profile (the repo owner) on every read and is read-only across all surfaces:repo.Owner.FullName, falling back torepo.Owner.Namewhen blank (same rule the update-server maintainer already uses).display_name).Fix (approved approach)
orgcolumn fromrepo_manifestvia a new DB migration.Orgfrom theRepoMetadatastruct.orgfrom the owner in the API response, the web view, and the update-server metadata resolution.mcp-mokogitea-apito markorgserver-derived / read-only inmetadata_update.Affected files
models/repo/repo_manifest.gomodels/migrations/…(new migration to droprepo_manifest.org)routers/api/v1/repo/manifest.gorouters/web/repo/setting/metadata.go+templates/repo/settings/metadata.tmplservices/updateserver/joomla.gomcp-mokogitea-api(separate repo):src/index.tsmetadata_update/kind bug