Skip to content

[Bug?]: patch constructs completely wrong resolutions section #4712

Closed
@xenoterracide

Description

@xenoterracide

Self-service

  • I'd be willing to implement a fix

Describe the bug

I've created a patch that isn't getting applied, no errors from yarn, just silent failure

To reproduce

create and apply patch for internal dependency, seems to fail for both pnp and node_modules linker

yarn patch @cof/express-chassisjs-compat-lib
yarn patch-commit -s /private/var/folders/xk/s3n8ww014pzbx2sn30ctz7000000gq/T/xfs-ddf1a095/user

Environment

## System:
 - OS: macOS 11.6.8
 - CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
## Binaries:
 - Node: 16.14.2 - /private/var/folders/xk/s3n8ww014pzbx2sn30ctz7000000gq/T/xfs-22dba7bd/node
 - Yarn: 3.2.2 - /private/var/folders/xk/s3n8ww014pzbx2sn30ctz7000000gq/T/xfs-22dba7bd/yarn
 - npm: 8.5.0 - ~/.asdf/plugins/nodejs/shims/npm

Additional context

related to #4231 and #4711

this is the correct package.json, the one that should have been generated

"dependencies":{
    "@cof/express-chassisjs-compat-lib": "^0.8.3"
  },
  "resolutions": {
    "@cof/express-chassisjs-compat-lib@^0.8.3": "patch:@cof/express-chassisjs-compat-lib@npm:^0.8.3#.yarn/patches/@cof-express-chassisjs-compat-lib-npm-0.8.3-2720ff1a2c.patch"
  }

this is the resolutions it did generate

  "resolutions": {
    "@cof/express-chassisjs-compat-lib@0.8.3": "patch:@cof/express-chassisjs-compat-lib@npm:0.8.3::__archiveUrl=https%3A%2F%2Fartifactory.cloud.company.com%3A443%2Fartifactory%2Fapi%2Fnpm%2Fnpm-internalfacing%2F%40cof%2Fexpress-chassisjs-compat-lib%2F-%2F%40cof%2Fexpress-chassisjs-compat-lib-0.8.3.tgz#.yarn/patches/@cof-express-chassisjs-compat-lib-npm-0.8.3-2720ff1a2c.patch"
  }

oh, one difference from #4711 my yarnrc.yml doesn't use scopes, only

npmRegistryServer: '...'

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions