ci(codeql): extract the render backends, not the engine alone - #481
Merged
Conversation
The scan built one module, and the Java extractor sees only what the build compiles — so the PDFBox and POI parsing paths, SVG and image handling, font loading and the ZIP/OPC writers were not partly analysed, they were outside the scan entirely, and a green result said nothing about them. The build now covers every published module that carries code. `-am` compiles their dependencies from source, so the scanned set is the closure of the list. CodeQlScopeGuardTest derives the expectation instead of repeating it: a module the verify gate compiles that carries main sources must be in the scan. It also pins `-am`, whose loss would read as a formatting change and would quietly turn the named modules back into resolved jars.
…inst CI Comparing the scan to the verify gate answers whether two lists agree, and two lists agree perfectly when a module is missing from both — the shape an artifact takes when it joins the publish train and is forgotten everywhere else. The guard now also reads the deploy steps of the publish workflows, which is the inventory the promise is about. fonts and emoji are named outright rather than arriving through `-am`: reaching the extractor as somebody's dependency ends the day that dependency is dropped. Three defects in the guard itself: - the artifact id was matched anywhere in a pom, so a module bound to the first module that *depends* on it — `graph-compose-testing` resolved to `render-pptx`. Module coordinates are now read from the module's own pom, with the inherited `<parent>` block removed first. - the `-pl` value was captured up to the first space, so wrapping the long verify command across a continuation would have shrunk the expected set in silence. Selectors are collected token by token instead. - a command with no `-pl` at all made the guard throw, which would have punished widening the scan to the whole reactor. The stated reason for `-am` was wrong: core is in the selection, so the named modules build without it.
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.
Why
The Java extractor sees whatever the build compiles, so the
-pllist in the scanning workflow is the analysis scope. It named one module. The render backends, the templates and the testing harness were not partially analysed — they were absent from the scan, and nothing in a green result says which code was looked at.That is where the untrusted input lands: PDFBox and POI parsing, the SVG and image paths, font loading, the ZIP/OPC writers. The engine module, which was scanned, handles the least of it.
The workflow's own comment admitted the gap and deferred it. The reason for deferring was a standing pile of untriaged alerts; measured now, that pile is 53 open — 50
note, 3warning, 0error, and zero carrying any security severity. It is a style backlog, not a triage burden that should hold back scanning the parsers.Honest expectation, since the point is coverage rather than a haul: the unscanned modules contain no deserialization, no
Class.forName, noRuntime.execand no XML parsers; the ZIP work isByteArrayInputStream→ByteArrayOutputStreamwith no extract-to-disk. Few or no new high-severity findings are likely. The gain is that the binary-parsing and file-writing boundary stops being invisible.What
Every deployed module that carries code is named outright — core, render-pdf, render-docx, render-pptx, templates, testing, fonts, emoji. Naming
fontsandemojirather than letting them arrive through-ammatters: reaching the extractor as somebody's dependency ends the day that dependency is dropped, and nothing would have said so.CodeQlScopeGuardTestholds the list against two inventories that fail differently:ci.yml's verify gate — catches the scan falling behind the build;The guard reads a module's coordinates from its own pom with the inherited
<parent>block removed, collects-plselectors token by token so a wrapped command cannot silently shrink the expectation, and treats a command with no-plas the whole reactor rather than throwing — a guard that failed on the stricter setup would push toward the looser one.Tests
The exact command the workflow runs, executed locally:
BUILD SUCCESS, eight modules.Extraction is confirmed rather than assumed: on this branch the CodeQL tracer compiles 632 main + 170 test sources across eight modules, against 404 + 83 on develop. Build 57s → 130s, analysis 58s → 71s; the job is 3m53s against a 30-minute timeout.
Guard job as CI invokes it: 37 tests,
BUILD SUCCESS.render-pptxfrom the scan listfonts) from the scan list-am-pllist across a continuation-plwith a whole-reactor build