Skip to content

v0.32.0

Choose a tag to compare

@github-actions github-actions released this 28 Sep 19:29
· 394 commits to main since this release
v0.32.0
2d42617

Changed

  • A value quoted in fix guidance stays on one line. A line break inside
    a quoted value, such as an image: written with \n, started a line of
    its own in the text report. A problem matcher registered earlier in a CI
    job (actions/setup-python adds 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 (see docs/github-action.md).

  • A .env that could not be read fails the run. A sibling .env that is
    not UTF-8, is over the 256 KiB read cap, or resolves outside the project,
    and a COMPOSE_FILE list refused for naming a file outside the project or
    a missing one, are now coverage gaps: exit 2, a JSON errors[] entry of
    kind coverage_gap, and SARIF executionSuccessful: false. They were an
    unread_input warning on a run that could still pass, though Compose
    deploys what the file sets. An included file's own .env that could not be
    read was not reported at all; it is the same gap now.
    --allow-partial-coverage accepts them. A refused env_file: target stays
    an unread_input warning. 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-form ports: entry was keyed by
    rendering each field as text, so a host_ip written as a doubling alias
    chain (under 1 KB, with a one-line compose.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-entry dns: 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-file extends: 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.yml that 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 per extends: child for every line it inherited. One labels:
    anchor aliased into 4,000 services (372 KB), the same through a merge key
    (218 KB), and 2,000 extends: children of a 4,000-label base (112 KB)
    each ran out of 2 GiB; a mapping of !reset keys 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, which fix
    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 .env value
    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 an env_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-entry ports: 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; fix and
    init refuse such a file.

  • An override is merged whatever its spelling. compose.yaml beside
    a docker-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 .env value 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.yml committed 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, JSON errors[] 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. --config is read as given. See GHSA-88f4-frh5-gmcr.
  • A Compose file that links out of the checkout is not followed. A
    discovered compose.yml, a sibling compose.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-coverage accepts 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 .env filled in, not its value.
    Values under environment: were never resolved from the sibling .env,
    but image: 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 to image: "${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 json and --format sarif printed 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 failed mkdir for sarif-file: printed
    the resolved directory, which a committed symlink can make a pull
    request's own directory name, outside the stop-commands window. Every
    route is now escaped, JSON and SARIF stay byte-for-byte equivalent data,
    and the Action names the sarif-file: input as written. As hardening,
    the Action's pattern: discovery, whose find errors name directories,
    now runs inside a stop-commands window of its own. See
    GHSA-r7j4-crjv-h467.