Open runeh opened 1 year ago
In most cases, you wouldn't want an update to yarn.lock
to trigger this because an update to a package.json
in any workspace can update it. That said, I'm about to do a yarn dedupe
change and will experience the exact same issue that you're describing.
I don't think updating a workspace's package.json
is ever fully isolated, but at least in my team's repo, we're fine with it not triggering CI/CD on all packages. I can see the value in it being more configurable at least.
Looks like this is similar to: https://github.com/yarnpkg/berry/issues/4610
In most cases, you wouldn't want an update to
yarn.lock
to trigger this [..]
What does "this" refer here?
In my case I want to use --since
to find what apps in a monorepo to build. The package.json files are irrelevant. The yarn.lock is the source of truth for this.
Self-service
Describe the bug
yarn workspaces list --since <sha>
does not consider changes toyarn.lock
when determining if a workspace has been modified.For example, if there is a change triggered by
yarn dedupe
, then the packages whose resolved dependencies changed are not included in the output of thelist
command.The same likely applies to using the
--since
argument withworkspaces foreach
. They both use the same code path for this https://github.com/yarnpkg/berry/blob/3bf438d259b6db462a3591a080d61c3cb4a39e87/packages/plugin-git/sources/gitUtils.ts#L352To reproduce
There's a repo here: https://github.com/runeh/yarn-list-repro
date-fns
.yarn -R date-fns
and checking in the resultTo reproduce:
Run
yarn workspaces list --json -R --verbose --since=4fad77b815dbd49350b4faa53e93914909feaeb5
Expected result:
Shows the
pkg1
workspace as changed, due to the resolved version ofdate-fns
inyarn.lock
changing.Actual:
Shows no workspaces as changed
Environment
Additional context
No response