feat(validation): add oold meta vendor command - #146
Merged
Conversation
Contributor
Release previewMerging this PR would release v0.19.0 (current: Changelog preview (truncated)## v0.19.0 (2026-08-31)
### Features
- **validation**: Add oold meta vendor command
([`8663489`](https://github.com/OO-LD/oold-python/commit/8663489d7b587e86bb04c0140b033eaf7e792de4))
### Testing
- **parity**: Compare against oold-js instead of oold-schema's scripts
([#144](https://github.com/OO-LD/oold-python/pull/144),
[`42d0d74`](https://github.com/OO-LD/oold-python/commit/42d0d740fec4285ca6c3b9bd9c0c028a9368b601))
Preview via python-semantic-release and conventional commits. |
Contributor
📊 Benchmark ResultsClick to see benchmark comparisonThreshold: 1.3x (30% slower triggers a regression warning) Note: Benchmarks are informational only and won't fail the build. 💡 Tip: Download the |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
19 tasks
- reads the file set a release tag actually ships instead of a hand-run bash loop, so the wrong-file-set trap cannot recur - extracts with git cat-file blob and writes bytes verbatim, closing the CRLF-on-Windows trap by construction - records tag, commit, commit date, id_base and sha256 per file in meta/index.json, refusing to overwrite a tracked version without --force - refreshes tests/data/oold/ from the same tag and sets fixtures.tag in one call, so the two can no longer drift apart - points docs/maintaining-meta-schemas.md at the command in place of the bash procedure it replaces
LukasGold
force-pushed
the
feat/meta-vendor-command
branch
from
August 31, 2026 13:19
57b9d05 to
8663489
Compare
Contributor
📊 Benchmark ResultsClick to see benchmark comparisonThreshold: 1.3x (30% slower triggers a regression warning) Note: Benchmarks are informational only and won't fail the build. 💡 Tip: Download the |
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.
Closes #123.
Vendoring a meta-schema version was a hand-run bash loop in
docs/maintaining-meta-schemas.md. Every trap in it was one the documentation had to warn about, and each had been hit at least once. A command removes all three by construction instead:git showapplies the checkout's autocrlf filter, writing CRLF on Windows, changing every digest and failing only on Linux CIgit cat-file blobstraight off the subprocess pipe intowrite_bytes, with no text mode anywhere on the pathmeta/tree, and recorded as that version'sfilesoverride only when it differs from the shared defaultfixtures.tagThe command
oold meta vendor <version> --from <path-to-oold-schema>, wired into the existingmetagroup besidelistandfetch. It writes the files, records tag, commit, commit date and a sha256 per file intoindex.json, derivesid_basefrom the vendored wrapper's own$id, refreshestests/data/oold/from the same tag, and refuses to overwrite a tracked version without--force.The same trap, found in review, one level up
index.jsonis the one file the command writes as text rather than bytes, and it was going throughPath.write_text, whose defaultnewline=Nonetranslates toos.linesepand would author CRLF on Windows. It is harmless on a machine withcore.autocrlf=true, which normalizes it back, and the committed blob is LF today. It would not be harmless for a contributor with autocrlf off, which is the default on Linux.Fixed by passing
newline="\n"explicitly, withtest_the_written_index_json_has_no_crlfasserting on the bytes rather than the text, since that is the form of the check that travels across platforms..gitattributesis deliberately not changed:meta/index.jsonis legitimately CRLF in a Windows working tree, and the existing line-ending test reads the working tree.Acceptance
The issue names three existing tests as the acceptance criteria, and they pass unchanged:
test_recorded_checksums_match_the_shipped_files,test_the_vendored_files_are_stored_with_unix_line_endings,test_the_fixture_slice_records_the_release_it_came_from.New coverage builds real throwaway git repositories rather than mocking git, including the CRLF case directly: a source whose working tree holds CRLF after the commit must still vendor LF bytes identical to the committed blob.
Limits, recorded in the docs rather than hidden
notes,prereleaseandrules_sourceare not generated; the doc now says sov<version>, matching every existingindex.jsonentry; there is no--refoverride1.0.0-rc.1, stays manualVerification
Rebased onto
mainat v0.18.3 and re-verified there, since the first run measured against amainthat has since moved by five commits:mainmake check: cleanuv run oold validate tests/data/oold --offline: PASS, 380 ok, 21 warnings, unchangedgit status --porcelain -- src/oold/validation/meta tests/data/oold: empty, so no vendored byte or upstream fixture movedThe rebase produced no conflicts. #143 landed in the meantime and was the one to check, since it rewrote the remote-fetch half of
meta_store.py. It touchedfetch_remote,load_remoteand_read_stamp;meta_dir()andload_index()are unchanged in both signature and semantics, and those are the two this command depends on.RULES.mdandrules-baseline.json, and correctly refusing the second run without--force