Repository navigation
fix(docker): allowlist patches/ so pnpm patchedDependencies resolve in web build - #834
Merged
Merged
Conversation
…n web build The Devtron web image build fails at the deps stage: ENOENT: no such file or directory, open '/repo/patches/braces@3.0.3.patch' exit code: 254 .dockerignore is deny-all (`**/*` plus an allowlist) and never allowed patches/. `turbo prune --docker` therefore runs without the patch files, so it omits them from out/json, and the subsequent `pnpm install --frozen-lockfile` cannot resolve the patchedDependencies declared in pnpm-workspace.yaml. Allowlist patches/ and lock the invariant with a CI test that fails if any declared or lockfile-referenced patch path is excluded from the build context.
There was a problem hiding this comment.
🟢 Approval recommended
The functional fix and regression guard are sound; only non-blocking precedence wording needs correction.
1 open finding
What changed in this PR
Fixes web Docker builds by exposing pnpm patch files to Turbo’s pruner.
Changes:
- Allowlists
patches/in.dockerignore. - Adds regression tests for patch reachability and lockfile consistency.
- Runs the guard in PR verification.
| File | Description |
|---|---|
.dockerignore |
Includes pnpm patches in Docker context. |
.github/workflows/pr-verify.yml |
Runs the new invariant test. |
scripts/ci/tests/dockerignore-pnpm-patches.test.mjs |
Validates patch configuration and Docker access. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+47
to
+49
| // Minimal .dockerignore matcher: returns true when the most specific matching | ||
| // pattern for `path` is a negation (an allow rule). Only the subset needed here | ||
| // is implemented: `**`, `*`, leading `!`, and literal path prefixes. |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 18 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
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.

Cherry-pick of #833 (→ main) onto develop. Same latent bug lives here: the deny-all
.dockerignorenever allowlistspatches/, so any Devtron web image build from this tree fails withENOENT /repo/patches/braces@3.0.3.patch(exit 254)..dockerignore:!patchesscripts/ci/tests/dockerignore-pnpm-patches.test.mjs: regression guard (fails when any declared/lockfile-referenced patch is excluded from the build context), wired into the always-onclassifyjobVerified locally: deps stage ENOENT before, exit 0 after; test red on broken state, green on fix. Details in #833.