Repository navigation
The documents the program writes are checked against the schema - #27
Merged
Merged
Conversation
Microsoft's own validator — the one the Open XML SDK Productivity Tool uses — is the reader of the format this suite writes. It is vendored here rather than depended on: nothing the library ships depends on it, and the library's own suite does not need it to run. The build output is ignored. A .NET program writes its build beside its sources, and what it writes is a function of the machine that built it.
A .docx and a .pptx are Office Open XML, and a document that breaks the schema is a document that is not what it claims to be. Word opens it because Word is lenient where the schema is not, and nothing else in the suite could see it: the two libraries are measured by their own suites, and neither of them looks at what it wrote. So the check runs over what the binary writes. The binary is what the release publishes, and it is the one thing the two libraries do not measure. The test skips itself where the .NET SDK is not, and says what is missing — the SDK is not on every machine, and a test that fails where it cannot run says nothing about the code. A machine with the runtime but no SDK is a different case and says so. The third test asks the validator about a document with an error in it. The gate is worth nothing if it cannot fail, and a validator that answered "no errors" about every document would pass the two tests above.
The test skips itself where the SDK is not, so the job that runs the suite runs it and learns nothing from it. A job of its own installs the SDK, so the gate cannot be skipped there. The release workflow does not test the library: it builds and publishes. So the check belongs in the job that builds the archive, after the reproducibility check and before the artifact is uploaded. The documents are written by the archive itself, because the archive is built once and every released binary carries it — so this is the document a user of the release gets. The status of the validator is read rather than the step's own: a failure inside a command substitution is swallowed by the `echo` around it, so the answer is taken here.
|
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.



An OOXML validation gate: the documents this program writes are checked against the schema with Microsoft's own validator — the one the Open XML SDK Productivity Tool uses.
The validator is vendored in
tools/ooxml-validatorrather than depended on: nothing the library ships depends on it, and the library's own suite does not need it to run.The gate is on, and it is red today. The document the binary writes carries 25 schema errors and the deck carries none. All 25 are PHPWord's defects, and they are being fixed upstream: PHPOffice/PHPWord#2963 names them, and the five pull requests that fix them are #2964, #2965, #2966, #2968 and #2969.
Measured against the patch that carries them — the one at
markdown-office/PHPWord'spatches/1.4.0-to-fixes, whichmarkdown-office/markdown-worddeclares and applies — the same document carries 0 errors and the gate is green. That is what this pull request is measured against, and the gate stays red until the patch reaches the library this program installs.The test runs over what the binary writes rather than over what the library writes: the binary is what the release publishes and it is the one thing neither of the two libraries measures.
Where the .NET SDK is not on the machine, the test skips itself and says what is missing. The new
ooxmljob intests.ymlinstalls the SDK, so the gate cannot be skipped there.The release workflow does not test the library — it builds and publishes — so the check is in the
pharjob, after the reproducibility check and before the artifact is uploaded. The documents are written by the archive itself, because the archive is built once and every released binary carries it.The three red jobs have one cause. The
ooxmljob, thecoveragejob and thesonarcloudjob all build the two libraries from the branches named in the repository variablesMARKDOWN_WORD_REFandMARKDOWN_PRESENTATION_REF, and both saymain.maindoes not carry the patch yet, so the document the program writes has the 25 errors the unpatched PHPWord gives it — and the two jobs that run the suite fail on it, thesonarcloudjob among them because it runs the suite to produce the reports the analysis reads.So this pull request is merged after the two libraries'.
markdown-word's #49 andmarkdown-presentation's #43 carry the patch, andmaincarries it the moment they are merged. The run that follows is green.The release notes are under a heading the release job can read. The changelog's
## [Unreleased]is now## [0.1.3] - 2026-10-31, with the link reference beside the others —v0.1.2is already cut and published, and the gate is not in it. The release job reads the newest released heading out of the changelog and refuses a tag that disagrees with it, so a tag cut before this would have failed.