Conversation
… git-drs command based workflow
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a7092ce0a8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| func (cl *GitDrsClient) DeleteRecord(ctx context.Context, oid string) error { | ||
| // Note: cl.G3.DRSClient().DeleteRecord takes DID, but git-drs often passes OID | ||
| // We should probably keep the hash-based delete logic here or move it to core | ||
| return cl.G3.DRSClient().DeleteRecord(ctx, oid) |
There was a problem hiding this comment.
Delete records by DID in the DRS client wrapper
DeleteRecord forwards the provided value directly to cl.G3.DRSClient().DeleteRecord, but this call path is fed SHA256 OIDs by callers (and the comment here already notes the DID/OID mismatch). In the DRS backend, delete is DID-scoped, so deletes triggered from OID-based flows can fail with not-found and leave stale metadata behind; this affects both explicit delete operations and upsert conflict handling that tries to delete before re-registering.
Useful? React with 👍 / 👎.
| if prefix != "" { | ||
| configs[projectBucketKey(org, project, "prefix")] = prefix |
There was a problem hiding this comment.
Clear stale prefix when updating bucket mappings
When updating an existing mapping with an empty prefix (for example, overwrite without --path), this function writes only the bucket key and never clears the previously stored prefix key. As a result, GetBucketMapping continues returning the old prefix and routing still uses the outdated subpath, which is inconsistent with the new mapping input.
Useful? React with 👍 / 👎.
ADR 0003: Local pre-push metadata staging for DRS/LFS objectsStatusProposed Date2026-03-30 ContextThe branch Historically, metadata and object state were primarily derived from direct remote interactions and ad-hoc discovery at push time. That approach made behavior harder to reason about when local state, cache state, and remote records diverged. This branch introduces three connected changes:
This design reduces ambiguity in pre-push behavior and allows controlled server-assisted metadata registration while preserving fallback behavior. DecisionAdopt a local-first metadata staging pipeline at pre-push time, with cache-aware discovery and server submission as an explicit step. 1) Pre-push stages metadata explicitly
2) Cache is a shared contract across add-url, pre-commit, and pre-pushThe
3) Remote URL-backed objects are modeled explicitlyObjects that are authoritative in remote storage are marked using alias/metadata semantics (for example ConsequencesPositive
Negative / Tradeoffs
Alternatives considered
Implementation notesKey implementation areas introduced or updated in this branch:
Known follow-up risksFrom current review, follow-up hardening is recommended:
|
PR Review:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f7455f03bd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| uploadReq := common.FileUploadRequestObject{ | ||
| SourcePath: filePath, | ||
| ObjectKey: filepath.Base(filePath), | ||
| GUID: obj.Id, |
There was a problem hiding this comment.
Skip uploading pointer payloads in local RegisterFile
This path always uploads filePath directly when a bucket is configured, but BatchSyncForPush calls RegisterFile for LFS pointer entries too. In local-server flows that use add-url sentinel pointers (or any pointer-only working-tree file), this uploads the pointer text instead of the real object bytes, so the stored payload can be incorrect even though registration succeeds. Add pointer/sentinel source resolution (like the DRS client’s resolveUploadSourcePath) before building the upload request.
Useful? React with 👍 / 👎.
| if input.sha256 != "" { | ||
| return input.sha256, nil |
There was a problem hiding this comment.
Normalize user SHA input before returning it as OID
When --sha256 is provided, this returns the raw flag value without normalization/validation. If users pass a common prefixed value like sha256:<hex> (or any malformed token), the pointer writer later prefixes again (oid sha256:%s), producing invalid LFS OIDs (e.g. sha256:sha256:<hex>) that downstream LFS parsing will not treat as valid object hashes. Normalize to plain 64-hex and reject invalid input before returning.
Useful? React with 👍 / 👎.
|
I believe I have addressed feedbacks |
PR Summary (Reviewer Guide)
This PR is a large architectural migration of
git-drsfrom older indexd-centric and transfer-style paths to a newer DRS/data-client-based flow with local-server support, stronger command/test coverage, and scoped bucket behavior.See integration tests for use case details:
tests are run with an env file that looks like this
Broad Strokes of What Changed
1) Client architecture shift (core change)
Primary areas:
client/drs/*client/local/*client/client.go2) Command workflow updates
Primary areas:
cmd/addurl/*cmd/prepush/*cmd/precommit/*cmd/delete/*cmd/remote/*3) Bucket scoping/mapping support
Primary areas:
gitrepo/bucket_map.gogitrepo/bucket_scope.gogitrepo/*_test.go4) LFS dry-run and parsing reliability
Primary areas:
lfs/lfs.golfs/*_test.go5) Recent PR feedback + CI fixes
Key commits near tip:
e7849503(delete API split + merge preservation)f7455f03(lint/race-test fixes)Suggested Review Order (fastest to highest signal)
client/client.goclient/drs/client.goclient/local/local_client.gocmd/addurl/main.gocmd/prepush/main.gocmd/delete/main.gocmd/remote/add/*gitrepo/bucket_map.gogitrepo/bucket_scope.golfs/lfs.golfs/lfs_parse_test.golfs/lfs_dryrun_test.goHow to Test
CI-equivalent lint + tests