feat(repo-providers): initial code.storage backend support for clone/push#39
feat(repo-providers): initial code.storage backend support for clone/push#39
Conversation
yourbuddyconner
left a comment
There was a problem hiding this comment.
Overall clean and well-scoped. The bootstrap mode approach is pragmatic. A few items inline.
| import { githubRepoProvider as rp0 } from '@valet/plugin-github/repo'; | ||
| import { codestorageRepoProvider as rp0 } from '@valet/plugin-codestorage/repo'; | ||
| import { githubRepoProvider as rp1 } from '@valet/plugin-github/repo'; | ||
|
|
There was a problem hiding this comment.
This file is marked AUTO-GENERATED by scripts/generate-plugin-registry.ts — do not edit. Should be regenerated via make generate-registries rather than hand-edited. The change is correct, but editing auto-generated files directly is fragile and sets a bad precedent.
| "./repo": "./src/repo.ts" | ||
| }, | ||
| "scripts": { | ||
| "build": "tsc", |
There was a problem hiding this comment.
Missing tsconfig.json in this package. "build": "tsc" and "typecheck": "tsc --noEmit" will fail or pick up the root config unexpectedly. Every other code plugin has one — needs a tsconfig.json extending the root config, plus references in root tsconfig.json and packages/worker/tsconfig.json.
|
|
||
| async assembleSessionEnv(_credential: RepoCredential, opts) { | ||
| const parsed = parseCodeStorageRepoUrl(opts.repoUrl); | ||
| if (!parsed) { |
There was a problem hiding this comment.
assembleSessionEnv returns a t@ clone URL but doesn't set up a credential helper or GIT_ASKPASS to feed the minted token to git. The GitHub provider does the same, so I assume there's a session-layer mechanism that handles this — but a comment pointing to where/how that happens would help future readers.
|
|
||
| const apiBase = parseApiBase(credential); | ||
| const token = asToken(credential); | ||
|
|
There was a problem hiding this comment.
In bootstrap mode (no apiBase), this returns accessible: true based purely on URL syntax + token existence. A typo'd URL or revoked token will pass validation and only fail at clone time. Worth adding a code comment explaining why this is acceptable so future readers don't "fix" it.
- Add missing tsconfig.json and wire references in root + worker tsconfigs - Regenerate plugin registries instead of hand-editing auto-generated file - Add comments explaining bootstrap-mode validation tradeoffs - Add comments explaining credential helper flow (Runner git-setup.ts) - Remove redundant .git strip in parseCodeStorageRepoUrl
Summary
Adds a minimal
code.storagerepo provider implementation to unblock clone/push under the newRepoProviderarchitecture introduced in #38.Included (backend-first)
@valet/plugin-codestorageexportingcodestorageRepoProvider*.code.storageURLst@username form for code.storage Git-over-HTTPSvalidateRepoandlistReposbehavior:apiBase/issuermetadata if configured for richer validation/listingIntentionally deferred
Notes
This is intentionally narrow and backend-focused to keep risk low and unblock runtime git operations first.