Skip to content

fix(docker): allowlist patches/ so pnpm patchedDependencies resolve in web build - #834

Merged
tolstenko merged 1 commit into
developfrom
fix/dockerignore-pnpm-patches-develop
Oct 12, 2026
Merged

tolstenko merged 1 commit into
developfrom
fix/dockerignore-pnpm-patches-develop

Conversation

@tolstenko

Copy link
Copy Markdown
Contributor

Cherry-pick of #833 (→ main) onto develop. Same latent bug lives here: the deny-all .dockerignore never allowlists patches/, so any Devtron web image build from this tree fails with ENOENT /repo/patches/braces@3.0.3.patch (exit 254).

  • .dockerignore: !patches
  • scripts/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-on classify job

Verified locally: deps stage ENOENT before, exit 0 after; test red on broken state, green on fix. Details in #833.

…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.
Copilot AI balanced review requested due to automatic review settings October 12, 2026 23:10
@cla-bot cla-bot Bot added the cla-signed label Oct 12, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 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.
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 18 complexity

Metric Results
Complexity 18

View in Codacy

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.

@tolstenko
tolstenko merged commit 3ab8095 into develop Oct 12, 2026
25 checks passed
@tolstenko
tolstenko deleted the fix/dockerignore-pnpm-patches-develop branch October 12, 2026 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants