Skip to content

feature/globus - #251

Open
bwalsh wants to merge 15 commits into
developmentfrom
feature/globus
Open

feature/globus#251
bwalsh wants to merge 15 commits into
developmentfrom
feature/globus

Conversation

@bwalsh

@bwalsh bwalsh commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds Globus Transfer support for hydrating DRS objects into the Git LFS cache.

  • Selects usable Globus access methods while falling back per object when unavailable.
  • Resolves DRS access_id values correctly.
  • Authenticates with the Globus Transfer API.
  • Submits checksum-synchronized transfers using valid Transfer API payloads.
  • Writes directly to the repository’s .git/lfs/objects cache path.
  • Polls recoverable INACTIVE tasks until completion or cancellation.
  • Verifies downloaded size and SHA-256 before exposing cached content.
  • Rejects unsupported Globus remote-auth configuration.
  • Updates user and developer documentation.

Configuration

The destination Globus collection must expose the repository root.

  export GIT_DRS_GLOBUS_TRANSFER_TOKEN='<token>'
  export GIT_DRS_GLOBUS_DESTINATION_COLLECTION='<collection-id>'

To prefer Globus when available:

  export GIT_DRS_ACCESS_METHOD=globus

Testing

  go test ./...

All tests pass.

Reviewer note

Please pay particular attention to the documentation changes:

  • ADR: docs/access-method-selection-and-authentication.md

    • Per-object access-method selection
    • Preference and fallback behavior
    • Separation of transfer selection from authentication
    • Mixed Globus and non-Globus pulls
  • Developer architecture: docs/globus-notes-high-level.md

    • Globus ownership boundaries
    • Destination collection and LFS cache mapping
    • Client-managed transfer workflow
  • User documentation: docs/globus.md

    • Required environment variables
    • Destination collection setup
    • Globus preference behavior
    • Authentication and troubleshooting
  • Troubleshooting: docs/troubleshooting.md

    • Globus token and collection checks
    • LFS cache visibility requirements

@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: f8af218063

ℹ️ 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/download.go Outdated
Comment on lines +74 to +75
if method.AccessUrl != nil && strings.TrimSpace(method.AccessUrl.Url) != "" {
return &drsapi.AccessURL{Headers: method.AccessUrl.Headers, Url: strings.TrimSpace(method.AccessUrl.Url)}, nil

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 Keep resolving provider access URLs through DRS

When a record was created by add-url/push with an inline provider URL, this branch returns the raw s3:///gs:// value stored in AccessMethod.AccessUrl (see internal/drsobject/object.go:125-130 and docs/adding-s3-files.md:7-11). DownloadResolvedToPath then hands that URL to Syfon's GenericDownload, whose implementation only treats file paths specially and otherwise performs an HTTP GET (https://github.com/calypr/syfon/blob/development/client/transfer/http.go#L676-L804), so normal provider-backed pulls fail with an unsupported protocol scheme instead of asking the DRS server for a presigned URL. Restrict direct returns to schemes the downloader handles, or continue resolving storage-provider URLs through DRS.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@bwalsh

bwalsh commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

@chatgpt-codex-connector 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: fe920e3e84

ℹ️ 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/download.go Outdated

@matthewpeterkort matthewpeterkort left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This PR introduces alot of engineering choices to overengineer around a fundamentally lacking DRS schema. Instead of overengineering, DRS should be changed to support this new multiple auth multiple access methods real world use case.

Below is an attempt at finding faults and proposing solutions to the current DRS schema. This is a first attempt that probably needs some refining.
#253

1. a single `DrsObject` with several possible access methods, such as `https`, `s3`, and `globus`; and
2. a collection of `DrsObject` values whose available access methods and authorization requirements differ from object to object.

DRS does not define a priority among access method types. An access method `type` identifies how the bytes can be transferred; it does **not** uniquely identify how the transfer must be authenticated.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this does not really flow. You go from taling about basic drs concepts into this "access method" concept. Perhaps a paragraph talking about access methods first is needed here.


| Interaction | DRS mechanism |
| --- | --- |
| Retrieve `DrsObject` metadata | Authorization discovery for the object endpoint, including `OPTIONS /objects/{object_id}` |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

yeah like this section probably goes before the paragraphs above it

4. select the highest-priority usable method according to client configuration; and
5. allow the user to override automatic selection explicitly.

Each transfer handler owns the protocol-specific logic needed to resolve and execute its transfer. Authentication is determined from the DRS authorization information and the selected handler's capabilities, not inferred solely from `AccessMethod.type`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

maybe give an example here?? "Authentication is determined from the DRS authorization information and the selected handler's capabilities, not inferred solely from AccessMethod.type" this is pretty important and appears to be glossed over here.

DRS defines no preferred ordering, so git-drs will provide a configurable client-side priority. For example:

```yaml
access_method_priority:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this only matters if there is more than 1 access method provided right?

GIT_DRS_ACCESS_METHOD=globus git drs pull
```

The preference is evaluated per object. If an object does not advertise the

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If an access method is configured then it should be useable. If it cannot be used to create a download/upload then it should not be tried. Like having globus at the top of the priority and then the access method doesn't produce a object, can quickly lead to performance losses from repeatedly trying access methods that do not lead to a successful result.


For Globus in particular, objects that resolve to compatible Globus endpoints and authorization contexts should be grouped into one batch transfer where possible.

DRS bulk-access authorization imposes an additional constraint: a bulk request may require a common passport or bearer token for the requested objects. git-drs must therefore partition heterogeneous objects into authorization-compatible groups or resolve them individually rather than assuming a single credential applies to the entire collection.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

well a dynamic mapping would fix this problem. This quickly becomes more complexity than anyone wants to deal with.

You say drs doesn't support a fixed mapping but this is because it assumes that one auth will be used for all the data sources. This is not the case in the real world. I suspect this a DRS shortcoming and folllowing the drs spec here will prove to be a detriment in the long run.


### Positive

- Adding Globus does not require special authentication semantics in the DRS core.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sure. but Globus has its own auth. I'm not sure if an auth abstraction is really what is needed here.

Comment thread docs/globus.md
Export these environment variables before running `git drs pull`:

```bash
export GIT_DRS_GLOBUS_TRANSFER_TOKEN='<globus-transfer-api-access-token>'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just use globus login command and then read from the globus config file? Messing with env vars is making it more difficult for the user than it needs to be. This is not a script, this is a CLI.

Comment thread docs/globus.md
Verify the token before pulling:

```bash
git drs auth globus

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this is good

return nil
}
methods := *obj.AccessMethods
preferred := strings.TrimSpace(strings.ToLower(os.Getenv("GIT_DRS_ACCESS_METHOD")))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this is pretty hackish. This needs to be scallable across more than just a CLI. There should be a default access method that is intelligently configured depending on if there is more than one access method specified. Like ideally the files on Globus eventually make it to synapse aws s3 bucket once the paper is published, etc so certain access methods would have higher priority over others ,etc.

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.

2 participants