Skip to content

fix(yarn-pack-utils): copy patch files - #814

Merged
TorinAsakura merged 8 commits into
masterfrom
fix/image-pack-protocol-files
Jul 11, 2026
Merged

fix(yarn-pack-utils): copy patch files#814
TorinAsakura merged 8 commits into
masterfrom
fix/image-pack-protocol-files

Conversation

@TorinAsakura

@TorinAsakura TorinAsakura commented Jul 11, 2026

Copy link
Copy Markdown
Member

Task

How to verify

Before the fix

  1. Context: an image-pack workspace with a Yarn patch dependency
    Action: run image pack
    Expected result: the standalone install fails with ENOENT because the patch resolution is preserved without its patch file

After the fix

  1. Context: the same workspace
    Action: run image pack with the committed Raijin runtime
    Expected result: workspace-relative patches are included in their owning workspace archives, project-root patches are materialized at the standalone root, and the standalone install completes

Proofs

  • Package tests and checks
yarn test unit yarn/pack-utils/src/pack.utils.test.ts --test-reporter=tap -> 13 passed
targeted format / typecheck / lint -> passed
yarn raijin:check -> passed
yarn check -> passed
  • Standalone patch contract
optional!~/.yarn/patches path -> copied from the project root
top-level resolution patch path -> copied from the project root
reachable workspace ~/ patch path -> copied from the project root
workspace-relative patch path -> included in the owning workspace pack
workspace patch excluded by the files manifest -> included in the owning workspace pack
workspace path escaping its pack boundary -> rejected
same relative project/workspace path -> preserved in separate artifacts
patch descriptors outside the packed dependency graph -> ignored
non-workspace patch parent -> left to Yarn package resolution
  • Committed runtime and standalone export
yarn workspace @atls/yarn-cli build -> passed
cmp yarn/cli/dist/runtime/yarn.mjs .yarn/releases/yarn.mjs -> equal
yarn workspace @atls/yarn-pack-utils export --destination <temp> -> passed
required root-resolution .yarn/patches files -> present
unrelated workspace patch file -> absent
standalone Yarn resolution / fetch / link -> passed
  • Revertix CMS integration smoke
.yarn/patches/@strapi-core-npm-5.33.0-890f83b4d2.patch
Successfully built image cms-app-entrypoint
health_status=204
admin_status=200
running=true

@TorinAsakura TorinAsakura self-assigned this Jul 11, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 04dd34e457

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread yarn/pack-utils/src/pack.utils.ts Outdated
Comment thread yarn/pack-utils/src/copy.utils.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 948b86538f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread yarn/pack-utils/src/copy.utils.ts Outdated
Comment thread yarn/pack-utils/src/pack.utils.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6d5637571a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread yarn/pack-utils/src/copy.utils.ts Outdated
Comment thread yarn/pack-utils/src/copy.utils.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7e77147cd0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread yarn/pack-utils/src/copy.utils.ts Outdated
const copyOperations = new Array<{ dest: PortablePath; src: PortablePath }>()

const parsed = parseDescriptor(resolvedDescriptor)
for (const [descriptor, ownerWorkspace] of getPatchDescriptorSources(project, workspace)) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Copy patches referenced by package extensions

When the copied .yarnrc.yml contains a reachable packageExtensions dependency such as patch:foo@...#~/.yarn/patches/foo.patch, the temporary install still loads those extensions later in pack() before tmpProject.install(), but this loop only walks the packed workspace manifest and root resolutions. The patch file from the extension is therefore never copied into destination, so export/image pack can still fail with an ENOENT when Yarn resolves that injected dependency.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This finding is technically valid, but it is outside the scope of #813. The reported bug covers project-level patch files preserved by root resolutions; PR #814 now materializes that contract. Supporting patch dependencies injected through packageExtensions requires resolved dependency-graph ownership and belongs to the upcoming packaging architecture refactor, so this thread remains open and is not a merge blocker for this bug fix.

@TorinAsakura
TorinAsakura merged commit 5549faf into master Jul 11, 2026
7 checks passed
@TorinAsakura
TorinAsakura deleted the fix/image-pack-protocol-files branch July 11, 2026 23:38
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.

[Bug] Image pack omits Yarn patch files

1 participant