Skip to content

test: compatibility matrix of released clients before and after a renames table - #161

Merged
oesteban merged 3 commits into
feat/archive-2from
ci/compat-matrix
Dec 3, 2026
Merged

oesteban merged 3 commits into
feat/archive-2from
ci/compat-matrix

Conversation

@oesteban

@oesteban oesteban commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

Summary

WP3, part 2: the compatibility matrix for TemplateFlow 2.0. Stacked on #160, whose --migrate and alias resolution it exercises; GitHub retargets it to master when #160 merges.

tests/compat/test_compat.py            pytest; one uv environment per client
├── archive.py        fixture Archive from the bundled v2 skeleton (made-up content,
│                     MD5E annex symlinks); skeletons built by the real
│                     templateflow/.github/scripts/build-skeletons.py, before and after a table
├── datalad_archive.py  one-template git-annex Archive for DataLad homes
├── server.py         local S3 (S3's 404 body) + skeleton URLs; states:
│                     before | after | no-copies (control) | v2-as-legacy (control)
└── client processes: 25.0.4, 25.1.2, branch  ×  Python 3.13, 3.14, 3.15
    ├── runtime/sitecustomize.py  requests -> local server; any other URL fails
    └── runtime/scenario.py       get / update / files, API shared by all three
Scenario 25.0.4 25.1.2 branch
pinned, no update: old names download; purged names fail ✓ ✓ ✓
update(): one file per old name ✓ ✓ old queries resolve, FutureWarning when entities changed
shared home: download before the table, update, --migrate, reuse ✓ ✓ downloads move, nothing fetched again
DataLad home after datalad update renames keeping entities ✓; others lost (xfail) same resolves all
control: S3 lost the old keys misses misses misses
control: v2 skeleton at the legacy URL lists returned lists returned

.github/workflows/compat.yml (ubuntu-26.04) runs on pushes, PRs and nightly. "Run workflow" replays a proposed table: a raw URL to root rows, or to a template's .renames.tsv plus its name.

Decisions behind it:

  • Clients: released clients inside the SPEC 0 window (25.0.4, 25.1.2), on the SPEC 0 Pythons 3.13 to 3.15 (numpy, pandas, scipy and the other compiled dependencies already ship cp315 wheels).
  • DataLad break accepted: released clients in DataLad homes lose old names that changed entities, and removed files, after datalad update --merge. It's a strict xfail (raises=Break), so an unexpected pass or any other error fails the run. The 26.0 announcement documents it.

Evidence

  • Before: nothing ran a released client against a renamed Archive.
  • After: pytest -rxXs tests/compat against templateflow/templateflow master, locally on Python 3.13, 3.14 and 3.15, and in CI (run, 3.13 and 3.14):
    16 passed, 2 xfailed
    XFAIL test_released_datalad_break[25.0.4]
    XFAIL test_released_datalad_break[25.1.2]
    
    The expected failure is the intended one:
    Break: 25.1.2 lost [..._desc-SPM12_res-02_PET.nii.gz, ..._res-01_desc-head_mask.nii.gz,
                        ..._desc-SPM12_res-02_SPECT.nii.gz]
    
  • Controls: both pass, so the matrix notices a missing S3 copy (old keys gone: every client misses) and the wrong skeleton at the legacy URL (get() returns two files).
  • Replay: the sample as a template fragment (TEMPLATEFLOW_COMPAT_TEMPLATE=tpl-MNI152Lin) passes the same tests.
  • Found on the way: 25.0.4 has no status check in _s3_get, so a missing S3 key saves S3's XML error body as the file. That file is never downloaded again, because only empty files are; 25.1 added the check. The matrix counts it as a miss. It's one more reason the template action must keep the old keys.
  • ruff (repository settings) and codespell are clean.

Merge Danger

Door: two-way

Blast Radius: CI only

Only tests and a workflow are added; nothing ships in the wheel (packages = ["templateflow"]). Each CI run takes a few minutes per Python. The test process and every client get a scratch TEMPLATEFLOW_HOME, and scenario.py refuses any home the matrix did not make, so a local run cannot touch a real home.

oesteban and others added 3 commits December 3, 2026 16:37
…ames table

Runs templateflow 25.0.4, 25.1.2 and this branch (Python 3.13 and 3.14) against a
fixture Archive whose skeletons the real build-skeletons.py builds, before and after
a renames table, through a local S3 and skeleton server. Covers pinned clients,
update(), homes shared with --migrate, and DataLad homes; negative controls show the
matrix notices missing S3 copies and the v2 skeleton served at the legacy URL. The
accepted DataLad break of released clients is a strict expected failure.

The Compatibility workflow runs on pushes, pull requests and nightly, and replays a
proposed table (root rows or a template's .renames.tsv) on demand.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
numpy, pandas, scipy, SQLAlchemy, PyYAML and greenlet publish cp315 wheels; the
matrix passes locally on 3.15 (16 passed, 2 xfailed).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.02%. Comparing base (5db77cd) to head (da241ee).
⚠️ Report is 4 commits behind head on feat/archive-2.

Additional details and impacted files
@@               Coverage Diff               @@
##           feat/archive-2     #161   +/-   ##
===============================================
  Coverage           84.02%   84.02%           
===============================================
  Files                  10       10           
  Lines                 920      920           
  Branches              192      192           
===============================================
  Hits                  773      773           
  Misses                 83       83           
  Partials               64       64           
Flag Coverage Δ
api,datalad 44.89% <ø> (ø)
api,dls3 20.97% <ø> (ø)
api,s3 52.28% <ø> (ø)
config 81.95% <ø> (ø)

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.

@oesteban
oesteban marked this pull request as ready for review December 3, 2026 18:05
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-03T18:06:36.922542Z da241ee Draft marked ready
ℹ️ 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.

@oesteban
oesteban merged commit 839cb31 into feat/archive-2 Dec 3, 2026
8 checks passed
@oesteban
oesteban deleted the ci/compat-matrix branch December 3, 2026 18:05
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