Skip to content

moon run silently filters out type: run tasks in CI after v2.0.0 #2382

@moltar

Description

@moltar

Bug Report

After upgrading from RC2 to v2.0.1, running moon run :install in CI produces:

CAUTION
No tasks found. Unable to execute action pipeline.
For targets :install.

The install task is defined as:

install:
  command: pnpm install
  toolchains:
    - node
  type: run
  args:
    - --frozen-lockfile
    - --prefer-offline

Root Cause

Commit b1a6939c2 ("fix: Audit 02/13 #2354") changed the CI check logic in two ways:

  1. Flag inversion: ci_check changed from opt-in (--only-ci-tasks, default false) to opt-out (--ignore-ci-checks, default true), meaning CI checks are now always applied.

  2. Removed reqs.ci guard: The old condition reqs.ci && reqs.ci_check && !task.should_run_in_ci() was changed to reqs.ci_check && !task.should_run(reqs.ci), removing the requirement that CI checks only apply when explicitly requested.

The old code had a comment explaining the intended behavior:

// Only apply checks when requested. This applies to `moon ci`,
// but not `moon run`, since the latter should be able to
// manually run local tasks in CI (deploys, etc).

Since should_run(in_ci=true) returns false for type: run tasks (only build and test are considered runnable in CI by default), all type: run tasks are now silently filtered out when using moon run in a CI environment.

Expected Behavior

moon run should be able to run any task type in CI, as was the case before v2.0.0. The CI filtering should only apply to moon ci.

Workaround

  • Add --ignore-ci-checks flag: moon run --ignore-ci-checks :install
  • Or set runInCI: always on the task

Environment

  • moon v2.0.1
  • Worked in RC2, broken since v2.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions