Repository navigation
Report Dockerfile RUN provenance for installed requirements - #630
patrickballard merged 10 commits into
Conversation
|
Thanks @kunalkshah1, this looks good overall: the installing RUN line now shows beside each input in the text and Markdown reports, in a new It touches the same parts of CI is green on this commit. #599 is a (Review assisted by Claude.) |
…tinued RUN Merges main (CHANGELOG conflict only). The docs now mark the header, the dockerfile_inputs key and the annotation text as after 0.13.0, say which line a RUN that continues over several lines gets and what file holds, and sit away from the text sample that wheelgap#629 marks. New tests: a RUN continued over four lines in a Dockerfile in its own folder with --dockerfile-context (header, --json and annotation all name the line it starts on), and no dockerfile_inputs key or installed-by text without --dockerfile-inputs. Co-Authored-By: Claude Fable 5.2 <[email protected]>
The author merged main while the review was under way; this joins the two, keeping the longer CHANGELOG bullet. Co-Authored-By: Claude Fable 5.2 <[email protected]>
…#628's Both PRs added a paragraph at the same spot in docs/output.md, which would conflict whichever merges second. Co-Authored-By: Claude Fable 5.2 <[email protected]>
CHANGELOG conflict only: both bullets kept, this PR first. Co-Authored-By: Claude Fable 5.2 <[email protected]>
|
Thanks @kunalkshah1! Adding to the earlier review: the We've made these changes so it can go in:
It'll merge once a final review passes. (Review assisted by Claude.) |
CHANGELOG.md conflicted with wheelgap#622's bullet: both kept, this PR's first. Co-Authored-By: Claude Fable 5.2 <[email protected]>
The file value was the path as wheelgap joined it, so it changed with the working directory, with how --dockerfile-context was given (absolute or not) and with the OS's separator. It is now the path the Dockerfile's COPY names: relative to the build context, with /. The schema describes the three keys. Co-Authored-By: Claude Fable 5.2 <[email protected]>
# Conflicts: # CHANGELOG.md
|
Merged, thanks @kunalkshah1! One change from the final review, made before the key becomes public: (Reply assisted by Claude.) |
main gained wheelgap#622 (pip flags, -c FILE on the RUN line, the --prefer-binary gate), wheelgap#621 (verified -r/-c includes) and wheelgap#630 since this branch was written. dockerfile.py: main moved the COPY lookup into _find_copied_file, called by the copied_requirements closure and by _check_includes. The ignore rules are now a required argument of _find_copied_file and _check_includes and reach _copied_file from both, so a file that .dockerignore leaves out under a folder COPY is refused with the rule named whether it is the installed file, a -c file on the RUN line, or a -r/-c inside either. Without this an excluded include would have been read from disk although the image doesn't have it. The old "a .dockerignore is refused" loop stays deleted (main still had it), and the merged docstring no longer lists a .dockerignore among the refusals. tests: both sides' new tests are kept; the nested-includes test keeps wheelgap#621's assertions and this branch's removal of its .dockerignore tail. New tests for the interaction: an excluded include (one and two levels down), an excluded -c file, an excluded -r inside the -c file, the same under --prefer-binary, an include a later ! rule puts back (and a later rule takes out again), a file COPY naming an excluded source, and the CLI looking nothing up. docs/cli.md: the ignore-file paragraph says included and constraints files are covered. CHANGELOG: every bullet once, this PR's first. Co-Authored-By: Claude Fable 5.2 <[email protected]>
…t be pinned main gained -c FILE and harmless pip flags (wheelgap#622), verified includes (wheelgap#621), .dockerignore rules (wheelgap#626), install provenance (wheelgap#630), uv's Requires-Python lower-bound rule (wheelgap#623) and MCP wording (wheelgap#624) since this branch was written. _pip_install_files returns (files, constraints, prefer_binary, uv) and has one flag loop with the uv branch first. On a uv line only uv's own flags are read: --system, -r/--requirements, -c/--constraints, --no-cache, --no-cache-dir, --upgrade/-U and --quiet/-q (checked against `uv pip install --help`, 0.13.1). pip's --no-input, --root-user-action and --prefer-binary don't exist in uv, and --disable-pip-version-check only warns there, so they are refused. A uv line's files are found by the same copied_requirements closure as pip's, so the ignore rules and the include checks apply. Three things are uv's own: - every requirement must be pinned with == (through includes; a pin from a constraints file counts), using the gate --prefer-binary already had, and --deps is refused: wheelgap resolves a range as pip does, and uv can pick another release; - a -r inside a constraints file is refused: pip installs what it names and uv only constrains with it (uv 0.13.1 against pip 26.2); - included and -c files must be named *.txt or *.in, like the -r file. A file installed by pip on one line and uv on another is refused, and a caller that doesn't pass uv_installs gets an error rather than pip's answer. cli.py: the stderr note keeps main's list of every file read and says which installer ran; uv-installed files get restore_uv_python_files, as a uv.lock with --online does, so the pip_refuses note is main's. docs/cli.md has one paragraph for uv; CHANGELOG keeps every bullet once, this PR's first, reworded. Co-Authored-By: Claude Fable 5.2 <[email protected]>
Closes #599
What this changes
Put the installing Dockerfile RUN line beside each requirements input in text and Markdown. Add the dockerfile_inputs array to JSON, preserving the existing sources labels. GitHub annotations point to the requirement line and identify the RUN in the message. The stderr diagnostic remains.
Tests cover two distinct RUN lines and input files, schema validation, annotation message and location, and byte-for-byte output parity when Dockerfile input discovery is disabled. The three provenance checks fail on the original source.
AI tools used: Codex
Ruff formatting and lint, mypy, and the full pytest suite passed locally (5,187 passed, 3 skipped). The Unreleased entry will be added with the PR number.