fix(metadata): derive org from org profile instead of storing it (#771) #772
Reference in New Issue
Block a user
Delete Branch "fix/metadata-org-derived-from-profile"
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?
Fixes #771.
The repo metadata
orgfield was a stored, editable value that snapshotted the owner name and could silently drift when an organization was renamed. It is now derived from the org profile (repository owner) on read and is read-only everywhere.Changes
models/repo/repo.go: newRepository.DerivedOrgName(ctx)— ownerFullName, falling back to the handle (Name), then the denormalizedOwnerName.models/repo/repo_manifest.go: drop theOrgstruct field.models/migrations/v1_27/v369.go+migrations.go: migration #368 drops therepo_manifest.orgcolumn (portablebase.DropTableColumns).routers/api/v1/repo/manifest.go: response derivesorg;PUTignores it on write (read-only, like the already-deriveddisplay_name).routers/web/repo/setting/metadata.go+templates/repo/settings/metadata.tmpl: Organization field shown read-only with the derived value.services/updateserver/joomla.go: feed maintainer/organization now usesDerivedOrgName(single source of truth).Companion
orgas a settablemetadata_updateparam.Verification
go buildof all changed packages: pass (models/repo, models/migrations/..., routers/api/v1/repo, routers/web/repo/setting, services/updateserver).Code review (targeting
main): clean — approve on correctness.Repository.DerivedOrgName: safe fallbackFullName -> Name -> OwnerName, self-loads owner, never empty/erroring.manifest.go: all three response sites deriveorg;setStr("org")and the create-default removed (write is a no-op). Body still decodes into a raw map, so dropping the struct write is safe.metadata.go+ template:DerivedOrgexposed; form no longer readsorg; input isreadonlywith nonameattribute.v369.go): portablebase.DropTableColumns, registered exactly once.joomla.go: maintainer unified ontoDerivedOrgName(superset of priorFullName->Name).Verified
go buildpasses for all changed packages. No code blockers.⚠️ Do not merge yet — CI is red only because all
ubuntu-latestrunners are offline (jobs cancel at 0s); this diff is unrelated. Merge once a runner is back and checks are green.Wiki reminder: docs are wiki-first -- if this PR changes behavior, usage, config, or standards, please update the repo wiki before/after merge. (non-blocking)