moon: [bug] `moon ci` skipping all targets based on touched files

Hi,

I have a fairly large monorepo adopting Moon one project at a time, but for some reason, the moon ci command is not playing ball. It skips all projects regardless of the touched files.

I have inputs defined in multiple projects, and they work fine for caching repeated tasks. Running moon task SomeProject:some-task returns a nice description with a list of inputs, like so:

 INPUTS 

 - .moon/*.yml
 - SomeProject/src/**/*

Running moon ci also nicely prints touched files but then skips the affected targets:

▪▪▪▪ Gathering touched files
  .moon/tasks.yml
  .moon/workspace.yml
  SomeProject/src/HelloWorld.vue
▪▪▪▪ Gathering runnable targets
No targets to run based on touched files

I’d expect any of the above three touched files to have triggered tasks.

This feels like there is some extremely obvious solution I’m just not seeing. Running the command with --log debug didn’t give out any obvious hints or errors. Any pointers on what I may have missed?

I get the same result in Github Actions, so I’m assuming it’s a project configuration issue. I also feel like this used to work in an earlier iteration of the repo & moon configs 😥

Environment

moon 1.11.0

System:
    OS: macOS 13.4.1
    CPU: (20) x64 Intel(R) Core(TM) i9-10910 CPU @ 3.60GHz
    Memory: 3.59 GB / 40.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.16.0 - ~/.nvm/versions/node/v18.16.0/bin/node
    npm: 9.6.7 - ~/Documents/Metaplay/sdk/node_modules/.bin/npm
  Managers:
    CocoaPods: 1.11.2 - /usr/local/bin/pod
    Homebrew: 4.0.15 - /usr/local/bin/brew
    pip3: 23.0.1 - /usr/local/bin/pip3
    RubyGems: 3.0.3.1 - /usr/bin/gem
  Utilities:
    Make: 3.81 - /usr/bin/make
    GCC: 14.0.3 - /usr/bin/gcc
    Git: 2.39.2 - /usr/bin/git
    Clang: 14.0.3 - /usr/bin/clang
    FFmpeg: 6.0 - /usr/local/bin/ffmpeg
    Curl: 7.88.1 - /usr/bin/curl
  Servers:
    Apache: 2.4.56 - /usr/sbin/apachectl
  Virtualization:
    Docker: 24.0.2 - /usr/local/bin/docker
    Parallels: 18.0.2 - /usr/local/bin/prlctl
  SDKs:
    iOS SDK:
      Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4
  IDEs:
    Android Studio: 4.0 AI-193.6911.18.40.6626763
    VSCode: 1.80.2 - /usr/local/bin/code
    Vim: 9.0 - /usr/bin/vim
    Xcode: 14.3.1/14E300c - /usr/bin/xcodebuild
  Languages:
    Bash: 3.2.57 - /bin/bash
    Go: 1.20.3 - /usr/local/bin/go
    Java: 11.0.12 - /usr/bin/javac
    Perl: 5.30.3 - /usr/bin/perl
    Python3: 3.11.3 - /usr/local/bin/python3
    Ruby: 2.6.10 - /usr/bin/ruby
  Databases:
    SQLite: 3.39.5 - /usr/bin/sqlite3
  Browsers:
    Chrome: 115.0.5790.114
    Safari: 16.5.2

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 18

Most upvoted comments

I found the issue for affected checks. A fix will go out on monday: https://github.com/moonrepo/moon/pull/1004

Also if I set the fetch-depth: 1 it shows the following error.

::group::Gathering touched files
Error:   × Process git failed with a 128 exit code.
  │ 
  │ fatal: ambiguous argument 'HEAD~1': unknown revision or path not in the
  │ working tree.
  │ Use '--' to separate paths from revisions, like this:
  │ 'git <command> [<revision>...] -- [<file>...]'

Might be moon is always trying to look at the diff between the last commit and only run it.