Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug?]: --since flag produces different results for yarn workspaces foreach and yarn workspaces list #4885

Closed
alexedwardjones opened this issue Sep 22, 2022 · 2 comments
Labels
bug Something isn't working stale Issues that didn't get attention

Comments

@alexedwardjones
Copy link

alexedwardjones commented Sep 22, 2022

Describe the bug

Summary

Adding the --since flag to yarn workspaces foreach is running all workspaces not just the subset that have changed or their dependencies..

To reproduce

Example
I have a project that looks like the following when I run yarn workspaces list --json.

{"location":".","name":"project"}
{"location":"packages/db-utils","name":"db-utils"}
{"location":"packages/api-utils","name":"api-utils"}
{"location":"apps/service-one","name":"service-one"}
{"location":"apps/service-two,"name":"service-two"}
{"location":"apps/service-three,"name":"service-three"}
{"location":"apps/service-four,"name":"service-four"}

✅ If I change a file in db-utils and run yarn workspaces list --json --since=origin/main I get the following which is what I expect...

{"location":".","name":"project"}
{"location":"packages/db-utils","name":"db-utils"}

✅ If I change a file in db-utils and run yarn workspaces list --json --since=origin/main --recursive I get the following which is what I expect because service-one and service-two have db-utils as a dependency...

{"location":".","name":"project"}
{"location":"packages/db-utils","name":"db-utils"}
{"location":"apps/service-one","name":"service-one"}
{"location":"apps/service-two,"name":"service-two"}

However when I start applying those same arguments to foreach every workspace gets run.

  • yarn workspaces foreach --since=origin/main run lint - Runs all workspaces ❌
  • yarn workspaces foreach --since=origin/main --recursive run lint - Runs all workspaces ❌

Environment

System:
    OS: macOS 12.5.1
    CPU: (8) arm64 Apple M1 Pro
  Binaries:
    Node: 16.16.0 - /private/var/folders/6m/m5yvxnzx6z10cyk51929x0400000gp/T/xfs-934c9136/node
    Yarn: 3.2.3 - /private/var/folders/6m/m5yvxnzx6z10cyk51929x0400000gp/T/xfs-934c9136/yarn
    npm: 8.11.0 - ~/Library/Caches/fnm_multishells/67237_1663157503102/bin/npm
@alexedwardjones alexedwardjones added the bug Something isn't working label Sep 22, 2022
@thdk
Copy link

thdk commented Sep 26, 2022

I believe this is one of the issues which is planned to be handled in yarn 4.0 (#3591). yarn -R behaves differently whether or not --since flag is applied (#4391)

@yarnbot
Copy link
Collaborator

yarnbot commented Oct 26, 2022

Hi! 👋

This issue looks stale, and doesn't feature the reproducible label - which implies that you didn't provide a working reproduction using Sherlock. As a result, it'll be closed in a few days unless a maintainer explicitly vouches for it or you edit your first post to include a formal reproduction (you can use the playground for that).

Note that we require Sherlock reproductions for long-lived issues (rather than standalone git repositories or similar) because we're a small team. Sherlock gives us the ability to check which bugs are still affecting the master branch at any given point, and decreases the amount of code we need to run on our own machines (thus leading to faster bug resolutions). It helps us help you! 😃

If you absolutely cannot reproduce a bug on Sherlock (for example because it's a Windows-only issue), a maintainer will have to manually add the upholded label. Thanks for helping us triaging our repository! 🌟

@yarnbot yarnbot added the stale Issues that didn't get attention label Oct 26, 2022
@yarnbot yarnbot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale Issues that didn't get attention
Projects
None yet
Development

No branches or pull requests

3 participants