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] Dependant change does not trigger targets for main app #1588

Open
MichalCiesliczka opened this issue Jul 26, 2024 · 1 comment
Open
Assignees
Labels
bug Something isn't working

Comments

@MichalCiesliczka
Copy link

Describe the bug

Change in dependant does not trigger target with --affected run in the main app.

I have one app and one library in JS moon workspace. Both have test task and app depends on package (both explicitly <moon.yml> and implicitly <through package.json and workspace:^ dependency>).

apps/webApp/moon.yml

language: 'javascript'
type: 'application'
dependsOn:
  - 'simplePackage'
tasks:
  test:
   command: "yarn test"

packlages/simple/moon.yml

language: 'javascript'
type: 'library'
tasks:
  test:
   command: 'yarn test'

Steps to reproduce

  1. Set up 1 application and 1 library, both with test task.
  2. Import library as dependency to the application AKA make application depends on library
  3. Introduce some changes to the library
  4. Run moon :test --affected
  5. Only library's tests are run, even though this change affects the app

Expected behavior

Once shared library has any change also apps/other packages using this one should be triggered in affected way.
Usually introducing changes to shared code requires rebuild of the main app

Screenshots

Screenshot 2024-07-26 at 13 19 37

Environment

System:
    OS: macOS 14.5
    CPU: (8) arm64 Apple M1 Pro
    Memory: 36.83 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.11.1 - ~/.nvm/versions/node/v20.11.1/bin/node
    Yarn: 3.6.1 - ~/.nvm/versions/node/v20.11.1/bin/yarn
    npm: 10.2.4 - ~/.nvm/versions/node/v20.11.1/bin/npm
    Watchman: 2024.07.01.00 - /opt/homebrew/bin/watchman
  Managers:
    Homebrew: 4.3.9 - /opt/homebrew/bin/brew
    pip3: 24.0 - /opt/homebrew/bin/pip3
    RubyGems: 3.0.3.1 - /Users/michalciesliczka/.rbenv/shims/gem
  Utilities:
    Make: 3.81 - /usr/bin/make
    GCC: 15.0.0 - /usr/bin/gcc
    Git: 2.39.3 - /usr/bin/git
    Clang: 15.0.0 - /usr/bin/clang
    Curl: 8.6.0 - /usr/bin/curl
    OpenSSL: 3.3.1 - /opt/homebrew/bin/openssl
  Servers:
    Apache: 2.4.58 - /usr/sbin/apachectl
  Virtualization:
    Docker: 25.0.3 - /usr/local/bin/docker
    Docker Compose: 2.24.6 - /usr/local/bin/docker-compose
  SDKs:
    iOS SDK:
      Platforms: DriverKit 23.5, iOS 17.5, macOS 14.5, tvOS 17.5, visionOS 1.2, watchOS 10.5
    Android SDK:
      API Levels: 33, 34
      Build Tools: 33.0.0, 34.0.0
      System Images: android-30 | Google Play ARM 64 v8a, android-34 | Google APIs ARM 64 v8a
  IDEs:
    Android Studio: 2022.3 AI-223.8836.35.2231.10811636
    VSCode: 1.91.1 - /usr/local/bin/code
    Vim: 9.0 - /usr/bin/vim
    Xcode: 15.4/15F31d - /usr/bin/xcodebuild
  Languages:
    Bash: 3.2.57 - /bin/bash
    Go: 1.21.2 - /usr/local/go/bin/go
    Java: 17.0.11 - /Users/michalciesliczka/.jenv/shims/javac
    Perl: 5.34.1 - /usr/bin/perl
    Python3: 3.12.4 - /opt/homebrew/bin/python3
    Ruby: 2.6.10 - /Users/michalciesliczka/.rbenv/shims/ruby
  Databases:
    SQLite: 3.39.2 - /Users/michalciesliczka/Library/Android/sdk/platform-tools/sqlite3
  Browsers:
    Brave Browser: 125.1.66.113
    Chrome: 126.0.6478.183
    Safari: 17.5
  Monorepos:
    Yarn Workspaces: 3.6.1

Additional context

@MichalCiesliczka MichalCiesliczka added the bug Something isn't working label Jul 26, 2024
@milesj
Copy link
Collaborator

milesj commented Jul 26, 2024

Yeah right now --affected is purely a match against touched files and doesn't take project relations into account. We can look into that for the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants