Repository navigation
refactor: archive collector, GitTree and run_git for generate and migrate - #18
Merged
Merged
Conversation
…rate Groundwork for `tfmgr generate` and `tfmgr migrate` (WP4), with no change in what the checks report: - generate.collect_archive() gathers the template descriptions, atlas labels and transform targets that check_archive used to collect inline; templates.tsv and the TF801/TF803 checks now share it with the coming generators. - validate.archive.renames_problems() checks a root renames table from its text, given exists/installed callbacks, so a migration plan can check a simulated Archive. check_renames() wraps it. - io.run_git() runs git without a shell and keeps its output binary. - tree.GitTree reads a template from a commit without checking it out, under the same rules as DirectoryTree (only annex symlinks count, submodules and other symlinks are left out, annexed content is never read). check_archive() gives identical issues on master and on this branch for the Archive superdataset (all 30 templates installed). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
oesteban
marked this pull request as ready for review
December 4, 2026 08:13
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3ba4919dc3
ℹ️ 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".
A GitTree read every git blob of up to MAX_TEXT_BYTES into its cache at the first read_bytes, so a commit with many files in git (a submission that puts images in git rather than in the annex) could take gigabytes. - The smallest blobs are read ahead, in one git call, up to MAX_CACHE_BYTES (32 MiB); any other blob is read when asked and not kept. Validating a template of the Archive still takes one call: the largest keeps 0.93 MiB in git. - Only link targets of up to MAX_LINK_BYTES (4 KiB) are read: annex links are about 140 bytes, so a longer link is not an annexed file. - Only files of up to that size are opened to look for git-annex pointers. Reported by the Codex review of #18. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
First of seven PRs for WP4 of Archive 2.0 (
tfmgr generateandtfmgr migrate). No change in what the validator reports: this moves code the coming generators and the migration engine share, and adds two readers they need.GitTreereads a template from a commit without checking it out (ls-tree+ onecat-file --batch), under the same rules asDirectoryTree: only symlinks into the annex count, submodules and other symlinks are left out, and annexed content is never read.tfmgr migrate applywill validate the commits it builds before checking them out.Evidence
check_archive()on the Archive superdataset (30 templates installed), strict and legacy, gives byte-identical issue lists (676 bytes of JSON each; TF801 and TF803 as before).GitTreeagainst a real temporary repository (text, an executable, locked and unlocked annexed files, a plain symlink, a submodule), equal toDirectoryTreeon the same checkout for every file;collect_archive;renames_problems(including uninstalled templates);run_giterrors.pytest -o addopts="" --doctest-modules tfmanager: 185 passed on Python 3.13 (178 on master).ruff check .clean.Merge Danger
Door: two-way
Blast Radius: none
Internal APIs only; no CLI or rule changes. The new
gittest fixture isolates git from the user's and system configuration (no signing prompts, fixed identity).