Skip to content

Rework push OID checks and align Syfon APIs - #250

Open
matthewpeterkort wants to merge 26 commits into
developmentfrom
feature/rework-push-oid-checking
Open

matthewpeterkort wants to merge 26 commits into
developmentfrom
feature/rework-push-oid-checking

Conversation

@matthewpeterkort

@matthewpeterkort matthewpeterkort commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Replace push's bulk metadata fetch with project-scoped SHA-256 existence checks. Fetch full records only for missing OIDs that may be reusable and for explicit add-url metadata updates. Keep the legacy lookup for older Syfon servers.
  • Update the client and commands for Syfon's current generated APIs, including pull access URL refresh and copy-records behavior. Pin the Docker E2E tests to the tested Syfon commit.
  • Remove dormant transfer and delete reconciliation code, generated coverage files, and audit work products. git drs rm removes Git pointers; it does not delete remote records or payloads.

Verification

  • go test -race ./...
  • go vet ./...
  • go test ./internal/transfer -run '^TestPushLookupFindsReusableRecordOutsideTargetScope$' -count=1
  • GitHub Actions runs build, lint, coverage, and Syfon Docker E2E checks on this PR.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 09886249d2

ℹ️ 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".

Comment thread internal/transfer/push.go
@matthewpeterkort
matthewpeterkort force-pushed the feature/rework-push-oid-checking branch from 91d2f44 to e0e5e4e Compare September 16, 2026 22:55
@matthewpeterkort matthewpeterkort changed the title Feature/rework push oid checking Rework push OID checks and align Syfon APIs Sep 23, 2026
@matthewpeterkort

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0e5bd271fb

ℹ️ 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".

Comment thread client/client.go
return fmt.Errorf("size must not be negative for %q", file.Path)
}

dst := filepath.Join(root, rel)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Reject symlinked parents before downloading

When a component beneath PullOptions.Root is a symlink, a lexically safe path such as link/file.bin passes safeRelativePath, but MkdirAll and the download then follow root/link and write outside the requested root. This defeats the API's root-containment check and can overwrite arbitrary writable files when the output tree is shared or attacker-controlled; resolve the destination with component-wise symlink rejection immediately before opening it.

Useful? React with 👍 / 👎.

Comment thread internal/transfer/push.go
Comment on lines +188 to +190
localObj, err := localdrsobject.ReadObject(gitrepo.DRSObjectsPath, oid)
if err == nil && localObj != nil && firstAccessURL(localObj) != "" {
urlOIDs = append(urlOIDs, oid)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Fetch scoped records before forced uploads

When --force-upload is used and the existence endpoint reports an ordinary OID as present, this selection fetches the scoped record only if a local sidecar has an access URL. In a normal clone existingByHash therefore remains empty, so ensureMetadataRegistered retains a newly generated deterministic object ID and uploadFileForObject passes that ID to syupload.Upload; if the existing scoped record was imported under a different DID, the forced upload targets an unrelated DID and can fail or leave the existing record unmodified. Include all present OIDs in the targeted lookup when force-upload is enabled.

Useful? React with 👍 / 👎.

Comment thread cmd/copyrecords/scan.go
Comment on lines +139 to +141
oid := strings.ToLower(strings.TrimSpace(strings.TrimPrefix(info.Oid, "sha256:")))
if oid != "" {
hashes[oid] = struct{}{}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use the content checksum when filtering DRS pointers

For a path containing a DRS-URI pointer created by add-ref, info.Oid is the URI while info.SHA256 contains the optional content checksum. Adding the URI to this filter means copyRecordMatchesIncludedSHA256 cannot match any source record's SHA-256, so copy-records --include-path silently copies zero records even when the selected pointer has a valid checksum; use info.SHA256 for DRS pointers and reject entries that have no usable SHA-256.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-23T19:09:40.151774Z 0e5bd27 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Pin the published Syfon audit-fix commit for backend E2E. Port the Calypr kind suite to build git-drs from the current checkout and Syfon from the shared pin.

This branch has not been deployed

No deployments
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