Repository navigation
v0.32.0
Changed
-
A value quoted in fix guidance stays on one line. A line break inside
a quoted value, such as animage:written with\n, started a line of
its own in the text report. A problem matcher registered earlier in a CI
job (actions/setup-pythonadds one) keeps reading output while workflow
commands are stopped, so two such lines could become an annotation. The
break is now shown as\u000a. No advisory: a problem matcher is a
parser the workflow set up, not a command compose-lint's output issues,
and the verdict is unaffected (seedocs/github-action.md). -
A
.envthat could not be read fails the run. A sibling.envthat is
not UTF-8, is over the 256 KiB read cap, or resolves outside the project,
and aCOMPOSE_FILElist refused for naming a file outside the project or
a missing one, are now coverage gaps: exit 2, a JSONerrors[]entry of
kindcoverage_gap, and SARIFexecutionSuccessful: false. They were an
unread_inputwarning on a run that could still pass, though Compose
deploys what the file sets. An included file's own.envthat could not be
read was not reported at all; it is the same gap now.
--allow-partial-coverageaccepts them. A refusedenv_file:target stays
anunread_inputwarning. No advisory: the file is part of the change
under review, and 0.31.0 already reported it as not read.
Fixed
-
Merging an overlay or an
extends:base no longer grows with what
aliases expand to. Three merge steps did work in the size of an expanded
value rather than of the file. A long-formports:entry was keyed by
rendering each field as text, so ahost_ipwritten as a doubling alias
chain (under 1 KB, with a one-linecompose.override.yml) ran out of
memory. Append-style lists (dns,cap_add, ...) were deduplicated by
comparing each entry with every earlier one, which took 47 s on 1.6 KB
holding two alias chains of the same shape, and was quadratic in a long
list. And each merged list item re-scanned the whole line map, so a
20,000-entrydns:under a one-line overlay took 16 s. All three are now
linear: a port entry whose fields are not strings or numbers is not keyed
(Compose rejects it), the dedupe hashes a bounded canonical form, and a
subtree's lines are found by bisection. No advisory: resource use is a
robustness bug, and runners that lint untrusted pull requests are
isolated and limited by whoever operates them. -
A file that is not UTF-8 no longer crashes the run. An
include:
target or a cross-fileextends:base that is not UTF-8 raised a
traceback and exited 1, the findings code, with empty JSON and SARIF
output; it is now a coverage gap, as an unreadable target already was. A
.compose-lint.ymlthat is not UTF-8 is a configuration error (exit 2).
Any exception nothing else handles now exits 2 with the JSON or SARIF
envelope and a request to report it, instead of exiting 1. -
A node shared by many paths no longer multiplies the line map. A
line or tag position was recorded once per path that reached a node, and
once perextends:child for every line it inherited. Onelabels:
anchor aliased into 4,000 services (372 KB), the same through a merge key
(218 KB), and 2,000extends:children of a 4,000-label base (112 KB)
each ran out of 2 GiB; a mapping of!resetkeys aliased the same way
took 634 MiB. Repeated records now share one budget per load, 262,144,
over 200 times the largest a real file in the test corpus uses; past it,
a repeat is not recorded and its finding reports no line, whichfix
already treats as "do not edit". All four now load in about a second
under 130 MiB. Grouping the line map by service also no longer cuts every
path at every dot of a service name, which cost seconds for a name with
thousands of dots. -
Env files cost their size once, not once per use. One
.envvalue
of 130 KB, under the per-value cap, referenced from 20,000 labels was a
389 KB file that substituted to 2.6 GB and ran out of memory. Identical
values now share one result, and what substitution adds to a document is
capped at 8 MB in total; past it a value is left as written, as one over
the per-value cap already was. And anenv_file:named by many services
was read, parsed and graded once per service: 169 KB named by 2,000
services ran for over a minute and now takes half a second. Findings are
unchanged. -
A document that multiplies its findings stops being graded, and says
so. A rule reports one finding per item, and an aliased list is one set
of items in every service that uses it: a 1,000-entryports:anchor in
2,000 services (103 KB) built two million findings and ran out of memory
in every format, SARIF included, since its 5,000-result cap applied only
when the log was written. Grading now stops at 20,000 findings per
document, over 60 times the most any file in the test corpus produces.
What was not graded is a coverage gap (exit 2,--allow-partial-coverage
accepts it) and the findings graded so far are reported;fixand
initrefuse such a file. -
An override is merged whatever its spelling.
compose.yamlbeside
adocker-compose.override.yml(or any other mismatched pair) was graded
as the base alone, while Compose merges and deploys the override. Any of
the four base names now takes whichever override exists, and with several,
the one Compose picks:compose.override.yml, then.yaml, then the
docker-compose.override.*pair. -
SARIF fix regions are placed correctly after an emoji. A suggested
fix's columns were counted in code points, and the log did not say so;
JavaScript consumers (Code Scanning, the VS Code SARIF viewer) index in
UTF-16 code units, so an edit on a line holding a character outside the
Basic Multilingual Plane landed one column short per character. Columns
are now UTF-16 code units, and the run declares
"columnKind": "utf16CodeUnits". -
Two remaining costs are bounded. A service name thousands of
characters long was repeated in every line-map key under it, so one
8,000-character name over 60,000 labels made a 1 MB file cost 600 MB; the
map's key characters now have a budget (32 M, over 250 times the largest in
the test corpus), and a key past it reports no line. And past the
substitution budget, each distinct reference to a large.envvalue was
still built in full before being discarded, which took seconds; a value
that cannot fit is now left as written without being built.
Security
- A
.compose-lint.ymlcommitted as a symlink to a file outside the
project is no longer read. The policy file discovered in the working
directory was followed wherever it pointed, and a parse error quoted part
of the target's line into stderr, JSONerrors[]and the SARIF
notifications. It is now refused with exit 2. Config parse errors also no
longer quote the line PyYAML failed on, matching the Compose loader since
0.25.0.--configis read as given. See GHSA-88f4-frh5-gmcr. - A Compose file that links out of the checkout is not followed. A
discoveredcompose.yml, a siblingcompose.override.yml, and a Compose
file named on the command line (the Action's default list,pattern:,
files:and pre-commit all pass paths the checkout chose), committed as a
link to a file elsewhere on the machine, were read and merged, so a
Compose-shaped target's values reached findings. A link is now followed
only while its target stays inside the directory the run started in (the
checkout, in CI) or inside the link's own directory; a target outside both
is a coverage gap, exit 2, which--allow-partial-coverageaccepts when
another file is left to grade. A shared file symlinked into a monorepo's
service directories is still graded from the repository root, and a plain
path is read as before.
No advisory: since 0.25.0 only values from a target that is itself a
Compose file reached output; releases before that are covered by
GHSA-whr6-fgpq-fpv9. - A finding quotes the
${NAME}a.envfilled in, not its value.
Values underenvironment:were never resolved from the sibling.env,
butimage:and every other field were, and CL-0004 and CL-0019 quoted
the resolved image in their message and fix. A pull request changing one
line toimage: "${DB_PASSWORD}", in a workflow that writes secrets into
that.env, got the value into the job log, JSON and the SARIF uploaded
to Code Scanning. Rules still grade the resolved value; findings now quote
the reference in its place, for any value of eight or more characters, in
text, JSON, SARIF and fix guidance. See GHSA-jf3h-8jvx-vcrg. - No output path lets Compose file text issue a CI command. The 0.31.0
fix left four routes. A no-break space, an ideographic space or any other
Unicode white space before a line-leading::got past the sanitizer,
which allowed only space and tab, while the runner strips them all. That
reached quoted values and also file names, which start the report's file
heading and summary lines, so a repository directory's name was enough.
--format jsonand--format sarifprinted to the log were not escaped
at all. argparse echoed a rejected argument, such as a repository path
passed without--, raw to stderr. And Azure Pipelines'##vso[was not
escaped anywhere. In the Action, a failedmkdirforsarif-file:printed
the resolved directory, which a committed symlink can make a pull
request's own directory name, outside thestop-commandswindow. Every
route is now escaped, JSON and SARIF stay byte-for-byte equivalent data,
and the Action names thesarif-file:input as written. As hardening,
the Action'spattern:discovery, whosefinderrors name directories,
now runs inside astop-commandswindow of its own. See
GHSA-r7j4-crjv-h467.