Feat/viz prefix - #104
Conversation
Centralize applyVizablyRepoPrefix so create and availability checks share one idempotent naming convention.
StorageService now normalizes create-path names through applyVizablyRepoPrefix so lookups and creates target the same Vizably-namespaced repository.
Surface the naming convention in the input, apply it before create, and default the suggested suffix to scans.
Record the create-path naming convention in the auth/storage guide so Connect UI and API behavior stay aligned with the contract.
ieliofficial
left a comment
There was a problem hiding this comment.
I think the availability check and the create call disagree about the name now.
checkGitHubRepoNameAvailability normalizes but doesn't prefix, so it looks up owner/scans. createGitHubRepository calls applyVizablyRepoPrefix, so it creates owner/viz_scans. ConnectView sends the unprefixed suffix to the check.
Two ways that bites, and the default name is now "scans" so it's easy to hit:
- someone already has a repo called "scans" and gets told the name is taken, even though viz_scans is free
- someone already has viz_scans from an earlier run, gets told it's available, then create fails with a 422
Interesting bit is that findRepoByName in that same effect does check both the prefixed and unprefixed name, so the client side already handles it. It's just the server round trip that misses.
Could we apply the prefix inside checkGitHubRepoNameAvailability? That way the endpoint is consistent by itself instead of relying on the frontend to prefix first.
The prefix helper itself looks right, I checked the idempotency and casing paths.
|
Both check and create already share _normalizeGitHubRepoName → applyVizablyRepoPrefix (b850685), so the availability lookup targets owner/viz_scans for an unprefixed scans input — same as create. Tests cover that. |
|
Should I proceed with implementing #116 (Use One GitHub Repository Per User) as part of this change before completing #104? The latest feedback on #104 moves toward the same architecture described in #116 — a per-user repository, automatic repository discovery, and removing the manual repository/name selection flow. I want to avoid completing the current #104 implementation and then immediately reworking the same code for #116. Would you prefer that I implement #116 first and then update/rebase this PR, or incorporate the #116 requirements directly into #104? |
Good call, but don't fold it into #104 or rebase it. Close #104 and #99 and start fresh on #116. Only thing worth carrying over is shared/githubRepoName.js I believe. One heads up: #116 as written says to handle selection through the existing flow, which keeps the picker. That's the opposite of what we want. I've put the decisions on #116, update the issue to match before you start. |

closes #99