Repository navigation
Deduplicate enclave audit setup and cleanup Docker assertions - #11963
Merged
Merged
Conversation
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
lpcox
marked this pull request as ready for review
November 22, 2026 22:39
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Active critical and moderate findings remain: an unused variable causes ESLint to fail, and a test expectation mishandles supported path-prefix normalization.
2 open issues
What changed in this PR
This PR centralizes duplicated enclave audit fixture setup and rootless Docker permission-repair assertions across related tests while adding coverage for alternate mount prefixes, registries, and image tags.
Changes:
- Added shared helpers for enclave audit fixtures and cleanup Docker assertions.
- Updated diagnostics and artifact-preservation tests to use the shared helpers.
- Added parameterized coverage for alternate Docker mount prefixes and image references.
| File | Description |
|---|---|
| src/test-helpers/docker-test-fixtures.test-utils.ts | Adds shared enclave audit fixture and Docker invocation assertion helpers. |
| src/docker-manager-diagnostics.test.ts | Replaces duplicated enclave audit setup with the shared fixture helper. |
| src/artifact-preservation-errors.test.ts | Uses the shared cleanup Docker assertion helper for error-path coverage. |
| src/artifact-permissions.test.ts | Parameterizes rootless repair tests and adds alternate registry, tag, and mount-prefix coverage. |
Review effort: Lite (adaptive)
Comment on lines
275
to
+276
| const enclaveRoot = resolveEnclavePaths(getDir()).root; | ||
| fs.mkdirSync(enclaveRoot, { recursive: true }); | ||
| const auditDir = path.join(getDir(), 'audit'); | ||
| fs.mkdirSync(auditDir); | ||
| const auditDir = setupEnclaveAuditFixture(getDir()); |
| '--entrypoint', | ||
| 'sh', | ||
| '-v', | ||
| `${path.join(dockerHostPathPrefix, path.resolve(auditDir))}:/fix:rw`, |
Collaborator
Author
|
@copilot address review feedback |
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Contributor
Contributor
|
✅ Copilot review passed with no inline comments. @lpcox Add the |
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.


Enclave audit fixtures and rootless cleanup Docker assertions were duplicated across three test files, creating opportunities for coverage drift.
setupEnclaveAuditFixture(dir)to create the enclave root and return the audit directory.expectPreserveCleanupDockerRun(mock, options)for mount translation, image selection, pull policy, and repair command checks.