feat(orgs): editable org slug + case-insensitive lookup#131
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tracevault initfrom a GitHub URL likegithub.com/VirtusLab/...no longer 404s when the stored slug isvirtuslab— all org slug lookups now useLOWER(name) = LOWER($1).virtuslab→VirtusLab) without recreating the org and losing members. Wired throughPUT /api/v1/orgs/{slug}with an optionalnamefield.020replaces the oldUNIQUEconstraint onorgs.namewithUNIQUE INDEX ON LOWER(name)so case-only collisions are still blocked at the DB level.org.renameaudit entry and the UI redirects to the new slug URL on success.Two commits: a
chorelock-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 warningscleancargo fmt --all -- --checkcleannpm run checkinweb/cleantracevault initin a repo whose remote uses different casing than the stored slug and confirm registration succeedsCaveats
~/.tracevault.tomlfiles 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.