Skip to content

[experiment] validate: stream annexed content with datalad-fuse's adapter when available - #1952

Draft
CodyCBakerPhD wants to merge 1 commit into
claude/brave-hamilton-ast647from
claude/validate-stream-datalad-fuse
Draft

CodyCBakerPhD wants to merge 1 commit into
claude/brave-hamilton-ast647from
claude/validate-stream-datalad-fuse

Conversation

@CodyCBakerPhD

Copy link
Copy Markdown
Contributor

Stacked on #1933. This tries the suggestion from #1933: use datalad-fuse with its fsspec adapter, not FUSE itself, tested against datalad/datalad-fuse#131. #1933 itself keeps its pure-fsspec reader.

What changes

  • dandi/support/datalad_fuse.py adds DataladFuseReadableFile, a Readable that opens an annexed file's missing content through datalad-fuse's RemoteFilesystemAdapter.
    • No FUSE mount is involved.
    • The adapter is created with caching=False, so nothing is written into the dataset's .git.
    • It uses datalad-fuse's default backend chain (remfile,fsspec), which can be changed with the datalad.fusefs.backends config.
    • Like AnnexReadableFile, its fingerprint is the annex key, so pynwb validation and metadata results are cached under the key.
  • get_datalad_fuse_readable(path) returns None, so the caller falls back to the git-only reader in dandi.support.annex, when:
    • datalad-fuse isn't installed;
    • the path isn't a locked, dropped annexed file;
    • git-annex isn't initialized in the repository (otherwise DataLad would run git annex init on it);
    • or git-annex knows no URL for the key.
  • validate --missing-file-content=stream tries datalad-fuse first and falls back to the git-only reader. The DANDI.FILE_CONTENT_STREAMED message names which one was used.
  • What datalad-fuse adds over the git-only reader: it asks git-annex itself (whereis), so it also finds content that is reachable through a remote but has no registered URL, such as Forgejo-aneksajo or S3 exporttree remotes.

Tests

  • make_git_annex_dandiset() builds a real git-annex repository: content is added, a URL is registered for it, and then it is dropped. A skipif.no_git_annex condition is added for these tests.
  • New tests:
    • dandi/support/tests/test_datalad_fuse.py: streaming over a local HTTP server with range support, plus the cases that return None.
    • test_validate_stream_datalad_fuse: content-dependent results match a local copy of the file.
  • A new CI job, mode: datalad-fuse (ubuntu, Python 3.12), installs git-annex from PyPI and datalad-fuse from refs/pull/131/head. Every other job runs without datalad-fuse, so they still exercise the fallback.

Open questions

🤖 Generated with Claude Code

https://claude.ai/code/session_01Qn5WBSiQgoZoL4fytF6nEr


Generated by Claude Code

For `validate --missing-file-content=stream`, use datalad-fuse's
RemoteFilesystemAdapter (without a FUSE mount) in repositories where
git-annex is initialized, falling back to the git-only URL reader of
`dandi.support.annex` otherwise.  datalad-fuse asks git-annex where the
content is, so it also finds content on remotes with no URL registered.

Tested against datalad/datalad-fuse#131 (installed from its PR ref in a
new `datalad-fuse` CI job, along with git-annex).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qn5WBSiQgoZoL4fytF6nEr
@CodyCBakerPhD CodyCBakerPhD self-assigned this Oct 6, 2026
@CodyCBakerPhD CodyCBakerPhD added cmd-validate enhancement New feature or request minor Increment the minor version when merged labels Oct 6, 2026
@codecov

codecov Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.04545% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.93%. Comparing base (d21b552) to head (25791fb).

Files with missing lines Patch % Lines
dandi/support/datalad_fuse.py 84.00% 12 Missing ⚠️
dandi/tests/fixtures.py 94.73% 1 Missing ⚠️
dandi/tests/skip.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@                       Coverage Diff                        @@
##           claude/brave-hamilton-ast647    #1952      +/-   ##
================================================================
+ Coverage                         78.78%   78.93%   +0.15%     
================================================================
  Files                                94       96       +2     
  Lines                             14727    14899     +172     
================================================================
+ Hits                              11603    11761     +158     
- Misses                             3124     3138      +14     
Flag Coverage Δ
unittests 78.93% <92.04%> (+0.15%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@CodyCBakerPhD CodyCBakerPhD changed the title validate: stream annexed content with datalad-fuse's adapter when available [experiment] validate: stream annexed content with datalad-fuse's adapter when available Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cmd-validate enhancement New feature or request minor Increment the minor version when merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants