Skip to content

feature/globus - #251

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

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

Conversation

@bwalsh

@bwalsh bwalsh commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

This branch is a large feature/bugfix slice built on top of development, with the main themes being:

  • Globus integration and transfer workflow expansion

    • Added SDK-backed Globus auth, credential handling, transfer orchestration, and collection import support.
    • Includes new docs, integration tests, and support for checksum-less and wildcard-based Globus URL imports.
    • Notable files: internal/globusauth/*, internal/transfer/globus.go, cmd/addurl/globus_recursive.go, cmd/auth/globus.go.
  • DRS access-method and metadata robustness fixes

    • Better access method selection and fallback handling, including rejecting hostless HTTP URLs and continuing after failed AccessID resolution.
    • Improved metadata preservation for checksum-based lookup results.
    • Notable files: internal/resolver/resolver.go, internal/lookup/lookup.go, internal/transfer/access.go.
  • Shared remote / config safety

    • Added protections around shared remotes and config policy, preventing unsafe removals or unsafe override behavior.
    • Notable files: internal/config/*, cmd/remote/remove.go.
  • Documentation and test coverage

    • Many docs were added/updated around Globus, DRS access methods, and setup/troubleshooting.
    • Several integration and unit tests were added/updated for Globus and config behaviors.

The most relevant recent commits for your immediate review are:

  • dd4d5c9 — fix resolver fallback + metadata preservation + effective Globus status validation
  • 6bbb054 — reject removal of shared remotes
  • 4c1675a — preserve raw Globus question wildcards
  • 71e4720 — reject hostless HTTP access URLs

The branch also includes a commit that cleaned up the accidental syfon gitlink and ignored the local syfon working tree (8e53b7c), which is unrelated to runtime behavior.

Reviewer notes

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

Comment thread docs/access-method-selection-and-authentication.md Outdated
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?

Comment thread docs/access-method-selection-and-authentication.md Outdated
Comment thread docs/access-method-selection-and-authentication.md Outdated
Comment thread docs/access-method-selection-and-authentication.md Outdated
Comment thread docs/globus.md Outdated
Comment thread docs/globus.md Outdated
Comment thread internal/transfer/access.go Outdated
@bwalsh

bwalsh commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

Update for August 11, 2026

Implemented the Globus authentication and client access-method work discussed in this PR.

Globus authentication and transfer

  • Replaced the external Globus CLI dependency with globus-go-sdk.
  • Added git drs auth globus login, status, and logout.
  • Interactive login stores refreshable credentials with owner-only permissions.
  • Expiring stored access tokens refresh automatically and persist their replacements.
  • GIT_DRS_GLOBUS_TRANSFER_TOKEN remains available as a static automation override.
  • Globus Transfer API authentication, task submission, and task polling now use the SDK directly.

Client access-method policy

  • Added auto, prefer:<type>, and require:<type> selection modes.
  • Added deterministic precedence: strict pull option, environment override, remote Git configuration, then built-in automatic selection.
  • Added git drs pull --access-method <type> as a strict per-command requirement.
  • Added local ready, disabled, and broken readiness diagnostics.
  • Globus readiness recognizes both environment tokens and SDK-stored credentials.
  • Fallback is limited to planning; failures after /access resolution or transfer start do not silently switch providers.
  • Multi-object planning returns aggregate selection diagnostics.

Documentation and validation

  • Updated the ADR, command reference, getting-started guide, Globus guide, troubleshooting, README, and Pages navigation.
  • Added a user-driven integration test plan covering real Globus login, transfer, selection precedence, missing and rejected credentials, fallback boundaries, aggregate diagnostics, refresh, checksums, and cleanup.
  • go test ./... passes.
  • mkdocs build --strict passes.
  • git diff --check passes.

Commits:

  • 49875e4 feat: add SDK-backed Globus login
  • 8d5b42f docs: explain Globus credential setup
  • ec4839d feat: add DRS access method selection policy
  • f0e1c08 docs: explain access method selection
  • 894c8a0 docs: add Globus user integration test plan

@bwalsh

bwalsh commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

Today’s commits implement the issue #254 client-policy design:

  • 66bb7ff — implements shared, versioned .git-drs/drs-policies.yaml support; local-over-shared endpoint and access-method precedence; authenticated committed-endpoint trust confirmation; optional Globus source constraints; source-to-destination routing; repository-path validation; planning-time fallback; aggregate diagnostics; and associated tests.
  • 5036358 — updates access-method, command, getting-started, Globus, troubleshooting, and user-driven integration-test documentation for the shared/local policy split and credential setup.

Key ownership boundary:

  • committed policy: canonical endpoint, selection default, optional source constraints;
  • clone-local Git config: endpoint override and Globus destination routing/paths;
  • credential storage: tokens and secrets.

Verification completed:

  • go test ./...
  • mkdocs build --strict
  • git diff --check

The unrelated untracked syfon/ directory was not included.

Verify checksum-less add-url payloads hydrate successfully, persist the learned SHA-256 locally, and publish it to Syfon through an explicit push.
@bwalsh

bwalsh commented Aug 25, 2026

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: 298eb87819

ℹ️ 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/globusauth/auth.go Outdated
Comment thread cmd/pull/main.go
Follow offset pagination for recursive directory imports and submit only one Globus transfer item per cache destination.
bwalsh added 4 commits August 24, 2026 21:12
Keep authoritative remote metadata when cloned placeholders have no local sidecar, and recognize the placeholder checksum marker during single-file Globus verification.
Overlay clone-local endpoints onto shared generic remotes without discarding provider, authentication, scope, or selection policy.
Secure token files without chmodding caller-supplied parent directories.
Stage the Globus add-url page and generated presentation in MkDocs input so strict Pages builds resolve every published link.
bwalsh added 2 commits August 25, 2026 09:14
Require an HTTP host so access planning resolves a valid access ID or falls back to another advertised method.
Escape question marks in the Globus path before URL parsing so documented single-character wildcard patterns remain intact.
Track shared-policy provenance through local overlays and stop the remote remove command before it mutates configuration.
…ll DRS metadata fields from internal records; globus: validate effective credential in status\n\nFixes:\n- Treat per-method access resolution errors as non-fatal so later methods are tried (AnVIL gs:// then HTTPS fallback).\n- Map Description, Version, CreatedTime, UpdatedTime when converting internal records to DRS objects to avoid dropping metadata.\n- Check the effective Globus credential in 'globus status' by validating the environment or stored token (use Check with environment enabled).\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bwalsh

bwalsh commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

Commits

  • dd4d5c9 — resolver: continue fallback when GetAccess fails; lookup: preserve full DRS metadata fields from internal records; globus: validate effective credential in status
    Summary: Treat per-method access resolution failures as non-fatal (allow HTTPS fallbacks), preserve Description/Version/CreatedTime/UpdatedTime when converting internal records to DRS objects, and make globus status validate the effective credential path (environment token or stored token).
    Files changed:

    • cmd/auth/globus.go
    • internal/lookup/lookup.go
    • internal/resolver/resolver.go
    • syfon (gitlink / submodule entry)
  • 6bbb054 — fix: reject removal of shared remotes
    Summary: Stop removal of remotes that are shared by policy; track shared-policy provenance so remote remove refuses to mutate config when provenance indicates shared resources.
    Files changed:

    • cmd/remote/remote_test.go
    • cmd/remote/remove.go
    • internal/config/config.go
    • internal/config/config_test.go
    • internal/config/remote.go
  • 4c1675a — fix: preserve raw Globus question wildcards
    Summary: Escape ? in Globus paths before URL parsing so documented single-character wildcard semantics are preserved.
    Files changed:

    • cmd/addurl/globus_recursive.go
    • cmd/addurl/main_test.go
  • 71e4720 — fix: reject hostless HTTP access URLs
    Summary: Require an HTTP host for access URLs so access planning can resolve valid access IDs or fallback to other methods.
    Files changed:

    • internal/transfer/access.go
    • internal/transfer/access_test.go

…e\n\nStop tracking the accidental syfon submodule pointer and add syfon/ to .gitignore to avoid showing local modifications while keeping the working tree intact.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bwalsh

bwalsh commented Aug 26, 2026

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: 493974be27

ℹ️ 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 cmd/pull/main.go
Comment thread cmd/addurl/globus_recursive.go
Resolve review feedback on #251 by rejecting strict access methods the read-only AnVIL resolver cannot enforce, honoring policy precedence, and treating zero-byte cache entries as complete.
@bwalsh

bwalsh commented Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 5ba7e0a01d

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

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