Skip to content

Mount a Tracked-Files Snapshot Into docker_lint.py Lint Containers - #2675

Merged
ptr727 merged 5 commits into
developfrom
feature/auto-1090
Oct 9, 2026
Merged

ptr727 merged 5 commits into
developfrom
feature/auto-1090

Conversation

@ptr727

@ptr727 ptr727 commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

Summary

scripts/docker_lint.py bound the live --root checkout read-only into every third-party lint container. Read-only stops a container writing back, not reading, so a git-ignored file on disk, such as a local secrets file beside a tracked placeholder, was readable inside each image.

The wrapper now copies the tracked and unignored files into a temporary snapshot and binds that instead. Target discovery stays on the host against the real --root, so git ls-files still has its .git. The snapshot is staged under the checkout's own git directory, since the system temporary directory sits outside Docker Desktop for Linux's default file sharing, and the lookup reuses local_review.git_dir(). It carries an empty .git so actionlint still finds its project, copies a symlink as a link without following it, and skips a tracked path missing from disk. It is removed when the run ends, and a SIGTERM handler turns a termination into an exit so a run stopped by timeout or a harness removes it too.

editorconfig-checker walks the mounted tree, so git-ignored build output such as .artifacts/ no longer reaches it either. That closes #1185 as a side effect.

The doc surfaces that described a checkout mount now describe the snapshot: GOVERNANCE.md "Running the Linters Locally (Known-Working Invocations)", scripts/README.md "docker_lint.py", and the comment-and-doc-style Skill's "Docker lint authorization", with its generated copies rebuilt.

Verification

  • New tests: a git-ignored file and a git-ignored directory never reach the mounted tree, a symlink is copied as a link, a deleted tracked file is skipped, and the snapshot is gone after the run. Reverting the fix (passing root rather than the snapshot to container_command) fails all four.
  • A real run of all seven linters against this branch passes.
  • With a git-ignored CRLF file under .artifacts/, editorconfig-checker fails on the old wrapper and passes on this one.
  • The local gate set in OPERATIONS.md passes.
  • timeout -s TERM during the lint phase leaves no snapshot behind, and the same run with the handler registration removed leaves one.

Local review findings still open

The local-strict-review edit budget for the first push was spent with one finding open:

  • introduced: tests/test_docker_lint.py drives exit_on_sigterm directly, so nothing tests that main() registers it. Removing the registration line leaves the suite green.

Closes on promotion: #1090, #1185

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Updates
    • Docker lint containers now use a temporary, read-only snapshot containing tracked and unignored files. Git-ignored files stay on the host, and the snapshot is cleaned up when linting ends, including after an interrupt or termination.
    • Updated guidance to reflect the snapshot behavior. Approval requirements and restrictions on unconstrained Docker runs remain unchanged.

ptr727 and others added 3 commits October 9, 2026 11:48
docker_lint.py bound the live --root checkout into every third-party lint
container, so a git-ignored file on disk, such as a local secrets file
beside a tracked placeholder, was readable inside each image. It now
copies the tracked and unignored files into a temporary snapshot and binds
that read-only instead, keeping target discovery on the host against the
real checkout. The snapshot carries an empty .git so actionlint still
finds its project, and it is removed when the run ends.

editorconfig-checker walks the mounted tree, so git-ignored build output
such as .artifacts/ no longer reaches it either.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The system temporary directory sits outside Docker Desktop for Linux's
default file sharing, so a snapshot there could not be mounted where the
live checkout could. The checkout's own git directory is reachable by any
Docker setup that mounts the checkout, and git never lists it.

Also split two over-long doc sentences and name the PSScriptAnalyzer
install as running without any repository mount, since no checkout mount
remains.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Python exits on SIGTERM without unwinding, so a run stopped by timeout or
an agent harness left a full copy of the tracked files under the git
directory, where nothing ever clears it. A SIGTERM handler now raises
SystemExit so the snapshot's cleanup runs.

The git directory lookup reuses local_review.git_dir() rather than a
second copy of the same rev-parse call.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings October 9, 2026 19:14
@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: ptr727/ProjectTemplate/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 22396212-9b1d-4bf9-abc7-041bc8670ac5

📥 Commits

Reviewing files that changed from the base of the PR and between ef95ad7 and 92b907b.


⛔ Files ignored due to path filters (3)
  • .claude-plugin/fleet-skills/.source-digests/comment-and-doc-style is excluded by !.claude-plugin/fleet-skills/**
  • .claude-plugin/fleet-skills/skills/comment-and-doc-style/SKILL.md is excluded by !.claude-plugin/fleet-skills/**
  • .github/skills/comment-and-doc-style/SKILL.md is excluded by !.github/skills/**

📒 Files selected for processing (5)
  • .agents/skills/comment-and-doc-style/SKILL.md
  • GOVERNANCE.md
  • scripts/README.md
  • scripts/docker_lint.py
  • tests/test_docker_lint.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.



📝 Walkthrough

Walkthrough

The Docker lint wrapper now stages tracked and unignored files in a temporary snapshot and mounts the snapshot in lint containers. It removes the snapshot when execution ends, including after SIGTERM. Tests and documentation cover snapshot contents, mount behavior, and cleanup.

Changes

Docker lint snapshot flow

Layer / File(s) Summary
Stage tracked and unignored files
scripts/docker_lint.py, tests/test_docker_lint.py
The wrapper stages listed files into a snapshot, skips missing files, copies symlinks without following them, adds an empty .git directory, and matches the checkout root mode. Tests check excluded ignored files and snapshot contents.
Mount and clean up the snapshot
scripts/docker_lint.py, tests/test_docker_lint.py, .agents/skills/comment-and-doc-style/SKILL.md, GOVERNANCE.md, scripts/README.md
Lint containers mount the snapshot instead of the checkout. SIGTERM exits through the temporary-directory cleanup path. Tests check mount sources and cleanup; documentation describes the snapshot behavior and the unmounted PSScriptAnalyzer module-install container.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Severity of issue fixed: Medium


Merge Risk: ⚪ Minimal · up to 92b90

The snapshot change appears ready to merge after normal checks; no actionable issue remains from this review.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 36.84% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 19 functions across 2 files. (3 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: mounting a tracked-files snapshot in docker_lint.py lint containers.
Linked Issues check Passed The directly linked issue is #1185. The PR changes scripts/docker_lint.py to mount a snapshot containing tracked and unignored files instead of the live checkout. This prevents `editorconfig-checker…
Out of Scope Changes check Passed The changes stay within the lint-isolation objective. Snapshot staging, symlink handling, missing-file handling, cleanup, SIGTERM handling, related tests, and documentation updates support the contain…

Full details: Docstring Coverage

Explanation

Docstring coverage is 36.84% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 19 functions across 2 files. (3 skipped: 3 unsupported.)



  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR


  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.36364% with 6 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (develop@ef95ad7). Learn more about missing BASE report.

Files with missing lines Patch % Lines
scripts/docker_lint.py 86.36% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #2675   +/-   ##
==========================================
  Coverage           ?   59.58%           
==========================================
  Files              ?       16           
  Lines              ?     8317           
  Branches           ?        0           
==========================================
  Hits               ?     4956           
  Misses             ?     3361           
  Partials           ?        0           
Flag Coverage Δ
python-3.13 59.58% <86.36%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Snapshot staging fails for read-only checkout roots, and SIGTERM handler registration lacks main-level test coverage.

2 open findings
What changed in this PR

Updates Docker linting to mount a temporary snapshot containing only tracked, unignored files, preserving symlinks and cleaning up on termination.

Changes:

  • Adds snapshot staging, filtering, cleanup, and SIGTERM handling.
  • Expands tests for ignored files, symlinks, deleted files, and cleanup.
  • Updates documentation and generated skill copies.
File Reviewed changes
tests/​test_docker_lint.py Tests snapshot contents and cleanup behavior.
scripts/​README.md Documents snapshot-based mounts.
scripts/​docker_lint.py Implements snapshot creation and mounting.
GOVERNANCE.md Updates local linting guidance.
.github/​skills/​comment-and-doc-style/​SKILL.md Updates generated skill guidance.
.claude-plugin/​fleet-skills/​skills/​comment-and-doc-style/​SKILL.md Updates generated plugin guidance.
.claude-plugin/​fleet-skills/​.source-digests/​comment-and-doc-style Updates the generated source digest.
.agents/​skills/​comment-and-doc-style/​SKILL.md Updates Docker authorization guidance.

🧠 Review effort: Lite


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread scripts/docker_lint.py Resolved
Comment thread tests/test_docker_lint.py Resolved
ptr727 and others added 2 commits October 9, 2026 12:19
The existing test drives exit_on_sigterm directly, so removing the
registration in main() left the suite green.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copying the checkout root's mode onto the snapshot before staging made a
read-only root's snapshot read-only too, so the first copy into it failed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ptr727

ptr727 commented Oct 9, 2026

Copy link
Copy Markdown
Owner Author

Answers for the findings this pull request carries outside a review thread.

The body's "Local review findings still open" list (1). tests/test_docker_lint.py, "nothing tests that main() registers it": Fixed in 34cd972, by test_main_registers_the_sigterm_handler. Copilot raised the same point as a thread, answered and resolved there.

pr_review.py's FINDINGS WITH NO THREAD (2) on the e282fee round (review). The round's "2 open findings" section lists exactly two entries, and each links one of the two threads that round opened: "Preserve write access while staging read-only snapshots" (fixed in 92b907b) and "Verify SIGTERM registration through main()" (fixed in 34cd972). Both threads are answered and resolved. The shortfall is the digest misreading the entries' absolute-URL thread links, filed as #2676: No change needed here.

@ptr727

ptr727 commented Oct 9, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 92b907b0f542fc1e140bac9720ac8df6402dbe22, the content this pull request carries at that commit against develop, and it recorded 0 findings.

@ptr727

ptr727 commented Oct 9, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@ptr727

ptr727 commented Oct 9, 2026

Copy link
Copy Markdown
Owner Author

CodeRabbit's pre-merge "Docstring Coverage" warning (36.84% against an 80% threshold, 19 functions across 2 files): Disproven as a defect in this change. Every function in scripts/docker_lint.py carries a docstring, which an ast walk over the head confirms with an empty list of exceptions. The undocumented functions are the test methods in tests/test_docker_lint.py, and the file's convention on develop is none: 29 test methods there, 0 with a docstring. The new tests follow that convention, and ruff's configured rules pass on the head. No change needed.

@ptr727
ptr727 merged commit eef6e5d into develop Oct 9, 2026
13 checks passed
@ptr727
ptr727 deleted the feature/auto-1090 branch October 9, 2026 19:57
ptr727 added a commit that referenced this pull request Oct 9, 2026
…ain (#2683)

## Summary

Promotes develop to main. It carries five changes:

- #2673 Adds the removal of the `push:` block to the Docker delta list
in `docs/reusable-workflows.md` "Adopting the Release Chain".
- #2675 Mounts a snapshot of tracked files, rather than the live
checkout, into `docker_lint.py` lint containers, so git-ignored files
and build output never reach a linter.
- #2684 Drops tracked files deleted from disk from `docker_lint.py`'s
lint targets, answering this pull request's review finding.
- #2678 Reads an absolute-URL thread link in `pr_review.py`'s overview
sections.
- #2661 Stops calling closed issues #699 and #700 open in
`docs/fleet-map.md`.

Fixes #1497
Fixes #1090
Fixes #1185
Fixes #2676
Fixes #2659

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants