Repository navigation
ci(container): CI reads every corpus file's container with olefile and holds rvt-dump's stream names, stored sizes and stored bytes to it (#1938) - #1957
Merged
Conversation
…d holds rvt-dump's stream names, stored sizes and stored bytes to it (#1938) The container is the layer every other reader stands on, and the only reader of it that CI used was rvt-rs's own (the cfb crate). tools/ci/olefile_streams.py lists each Revit file of the family corpus, the project corpus and tests/fixtures/families/empty.rfa with olefile, a second reader written separately in Python, runs rvt-dump --raw on the same file, and fails on any difference in the stream names, each stream's stored size or the stored bytes. It prints how many files and streams it compared; a directory with no Revit file, a file olefile cannot open and a run that compared no stream fail. The Writer patch corpus job runs it: it is the job that holds both corpora, where #1938 named Corpus health, which holds only the project corpus. olefile 0.47 is pinned with hashes in tools/ci/requirements-olefile.txt. cfb-container-open stays partial; its evidence names the check.
Owner
Author
|
The new step ran in The 19 files are the 12 Autodesk family samples 2016 to 2027, |
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
CI now reads every Revit file of both corpora, and the committed family fixture, with a second reader of the OLE container (olefile, written separately in Python) and fails if its stream names, stored sizes or stored bytes are not the ones rvt-rs's own reader (the
cfbcrate) gives. Closes #1938.Motivation
#1933 lowered
cfb-container-openfromverifiedtopartialbecause the only reader of the container that CI used was rvt-rs's own. This is the check #1938 asks for: a second reader over every corpus file, printing what it compared so that a run that compared nothing is not a pass.Changes
tools/ci/olefile_streams.py(new): for each.rvt,.rfa,.rteor.rftunder the paths given, lists the streams with olefile and reads them, runsrvt-dump --rawon the same file, and compares (1) the stream names, (2) each stream's stored size (rvt-dump'sraw=<bytes>), and (3) the stored bytes, as the multiset of (size, sha256) of olefile's streams against rvt-dump's raw dumps, so that rvt-dump's own file names take no part. Storages are listed by olefile and not by rvt-rs, so they are counted and not compared. Fails on a path with no Revit file, a file olefile cannot open, an rvt-dump that fails, any difference, and a run that compared no stream.tools/ci/requirements-olefile.inand.txt(new): olefile 0.47 (BSD, pure Python, 2023-12-01) pinned with hashes byuv pip compile --universal --generate-hashes, installed with--require-hashes. Dependabot's/tools/cidirectory covers it..github/workflows/ci.yml: the step is in theWriter patch corpusjob, after its other steps. CI: compare rvt-rs's stream list with olefile's over every corpus file (#1933 follow-up) #1938 names Corpus health, which holds only the project corpus; this job fetches both the phi-ag family corpus and the magnetar project corpus. It buildsrvt-dumpwith the job's existing cache and runs the script on_corpus/examples/Autodesk,_project_corpus/Revitandtests/fixtures/families/empty.rfa.docs/support-matrix.json: the evidence and note ofcfb-container-openname the check. The status stayspartial:docs/verification-protocol.mdasks two independent witnesses across a recorded edge forverified, and has not said that a stream-list agreement is one, which this PR does not decide.changelog.d/changed/1938-olefile-streams.md.Testing
No Rust changes and no export changes, so no Measure.
The script was run on this Mac with the 0.22.0 release's
rvt-dump(the macOS binary, sha256 checked against the release'sSHA256SUMS) on the corpora in the working checkout and the committed fixture:(11 family files 2016 to 2026, 6 project files, the fixture.) CI's checkout has the pinned commits of both corpora; the run of this job on this PR is the measurement over them, and its counts replace the ones above in a comment.
The check failing when it should was shown with a wrapper around the real
rvt-dump:one stream's printed stored size changed:
FAIL ... stream 'BasicFileInfo': olefile says 1025 bytes, rvt-dump 999;one byte of a raw dump changed:
FAIL ... the stored bytes differ: 1 of olefile's streams are not among rvt-dump's raw dumps and 1 of rvt-dump's are not among olefile's;a directory with no Revit file:
FAIL ...: no Revit file, exit 1;a text file named
.rvt(a Git LFS pointer, as an unfetched corpus would hold):FAIL ... olefile could not read it: NotOleFileError.tools/check-local.sh: N/A, no Rust, formatting or docs-build change;tools/ci/check-workflows.pyandtools/release/changelog.py checkpass.Verified end to end on real Revit files: above (Autodesk's family samples, magnetar's project corpus, the committed fixture).
IFC exporter: N/A.
Performance: N/A. The whole run on the 18 local files took 1.5 s.
Audit-honesty checklist
verifiedneeds.changelog.d/changed/..rteand.rft(in no corpus).Legal and contribution hygiene
Breaking changes
None.