Preserve repo_type on remote update #179
Reference in New Issue
Block a user
Delete Branch "benvin/fix-update-repo-type"
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?
PUT /api/v2/remotes/{name} decodes into a fresh struct without seeding repo_type, so terraform updates wipe it to "" on every non-local remote. Virtual repos then redirect member downloads to
/api/v1//<remote>/..., which 404s.remoteonly for a new row, reject invalid valuesremote, matching createlocal(no base_url) orremote"repo_type":""in the PUT body overwrites the seeded value, then defaults toremote, so a local repo can still be flipped to remote → default empty toexisting.RepoType(when oldKnown) instead ofRepoTypeRemote, or reject empty on update.remotealso mislabels any local repo that was wiped (locals have emptybase_url) → setrepo_type = CASE WHEN base_url = '' THEN 'local' ELSE 'remote' END, or confirm no local was ever wiped."repo_type":""on a local; add one alongside the fix above.repo_type: remotewith emptybase_url(e.g. PUT flipping a local to remote, or a new-row fallback to remote); create rejects this → apply the sameRepoTypeRemote && BaseURL == ""check to update after defaulting.repo_typechange; optionally seed an empty-repo_type row and assert the SQL.No findings.