Skip to content

feat(orgs): editable org slug + case-insensitive lookup#131

Merged
softberries merged 2 commits into
mainfrom
feat/editable-org-slug
Apr 29, 2026
Merged

feat(orgs): editable org slug + case-insensitive lookup#131
softberries merged 2 commits into
mainfrom
feat/editable-org-slug

Conversation

@softberries
Copy link
Copy Markdown
Member

Summary

  • tracevault init from a GitHub URL like github.com/VirtusLab/... no longer 404s when the stored slug is virtuslab — all org slug lookups now use LOWER(name) = LOWER($1).
  • Owners can rename the org slug from the settings page (e.g. virtuslabVirtusLab) without recreating the org and losing members. Wired through PUT /api/v1/orgs/{slug} with an optional name field.
  • Migration 020 replaces the old UNIQUE constraint on orgs.name with UNIQUE INDEX ON LOWER(name) so case-only collisions are still blocked at the DB level.
  • Slug validator now allows uppercase ASCII letters (was lowercase-only). Bootstrap signup path is unchanged and still forces lowercase.
  • Renames emit an org.rename audit entry and the UI redirects to the new slug URL on success.

Two commits: a chore lock-file refresh covering the recent enterprise dep bumps (sha2 0.11, reqwest 0.13), and the feature itself.

Test plan

  • cargo test -p tracevault-server (184 tests pass)
  • cargo clippy --workspace --all-targets -- -D warnings clean
  • cargo fmt --all -- --check clean
  • npm run check in web/ clean
  • Manually rename an org via the settings UI and confirm redirect + new URL works
  • Run tracevault init in a repo whose remote uses different casing than the stored slug and confirm registration succeeds

Caveats

  • Renaming changes URLs. Existing ~/.tracevault.toml files referencing the old slug still resolve thanks to the case-insensitive lookup, but anything that hardcodes the slug (webhook configs, bookmarks, manual API calls) will need updating.

Org slug lookups now use LOWER(name) = LOWER($1), so a CLI init from
github.com/VirtusLab resolves to a slug stored as "virtuslab" without
needing a rename. DB uniqueness is enforced via UNIQUE INDEX on
LOWER(name) (migration 020) so case-only collisions are blocked.

Owners can now rename the org slug via PUT /api/v1/orgs/{slug} with
{ "name": "..." } and the org settings page exposes an Edit control
next to the GitHub Organization field. Renames are validated, conflict
on duplicates, and emit an org.rename audit entry.
@softberries softberries merged commit 704d451 into main Apr 29, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant