Conversation
There was a problem hiding this comment.
Pull request overview
This PR applies an audit sweep across Moon’s CLI/runtime (Rust), visualizer (TS), config/docs, and test fixtures to address CI/task execution behavior, graph visualization compatibility, and a few operational/debuggability concerns.
Changes:
- Switch graph serving/rendering to use the raw
GraphToJsonJSON format (pretty for--json, compact for the server), and update the visualizer to handle the newer graph shape. - Refine task-building behavior around
runInCIdefaults and shell auto-detection (respectshell: falsefor glob/env detection), with added fixtures/tests. - Add defaults for
hasher.ignoreMissingPatterns, addMOON_INCLUDE_RELATIONSenv support for--include-relations, add moredocker prunedebug logs, and temporarily relax shallow-checkout CI behavior.
Reviewed changes
Copilot reviewed 24 out of 25 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| yarn.lock | Adds workspace dependency resolution for visualizer → types. |
| website/docs/config/workspace.mdx | Documents default hasher.ignoreMissingPatterns behavior. |
| packages/visualizer/package.json | Adds @moonrepo/types dependency. |
| packages/visualizer/tsconfig.json | Adds TS project reference to ../types. |
| packages/visualizer/src/helpers/types.ts | Introduces v1/v2 graph type union aligned with @moonrepo/types. |
| packages/visualizer/src/helpers/render.ts | Adds v2 graph extraction + action label rendering. |
| crates/graph-utils/src/graph_formats.rs | Makes GraphToJson::to_json accept a pretty toggle. |
| crates/app/src/commands/action_graph.rs | Uses to_json(true/false) for JSON output vs server payload. |
| crates/app/src/commands/project_graph.rs | Uses to_json(true/false) for JSON output vs server payload. |
| crates/app/src/commands/task_graph.rs | Uses to_json(true/false) for JSON output vs server payload. |
| crates/app/src/commands/graph/utils.rs | Serves already-serialized JSON directly to the UI/server. |
| crates/app/src/commands/graph/mod.rs | Removes DTO module export, leaving only server utilities. |
| crates/app/src/commands/graph/dto.rs | Removes the legacy DTO-based graph representation. |
| crates/task/src/task.rs | Extends TaskState and updates CI run decision logic. |
| crates/task-builder/src/tasks_builder.rs | Tracks new task state flags, adjusts default runInCI, and shell auto-detection. |
| crates/task-builder/tests/tasks_builder_test.rs | Updates shell expectations + adds tests for auto-shell and runInCI behavior. |
| crates/task-builder/tests/fixtures/builder/syntax/moon.yml | Updates fixtures to rely on auto-shell behavior. |
| crates/task-builder/tests/fixtures/builder/env-substitute/moon.yml | Updates fixtures to rely on auto-shell behavior. |
| crates/task-builder/tests/fixtures/builder/auto-shell/moon.yml | Adds fixtures to validate auto-shell detection + override. |
| crates/task-builder/tests/fixtures/builder/options-runinci/moon.yml | Adds fixtures for runInCI defaulting vs explicit config. |
| crates/config/src/workspace/hasher_config.rs | Adds default ignore patterns for missing inputs. |
| crates/app/src/commands/exec.rs | Temporarily disables CI shallow-checkout hard error. |
| crates/app/src/commands/docker/prune.rs | Adds debug logs and tweaks prune invocation handling. |
| crates/app-macros/src/lib.rs | Adds MOON_INCLUDE_RELATIONS env var support for --include-relations. |
| CHANGELOG.md | Documents the above behavior changes/fixes. |
Comments suppressed due to low confidence (1)
crates/task-builder/src/tasks_builder.rs:493
- Typo/grammar in this trace message: "as its required" should be "as it's required" or "as required".
trace!(
task_target = target.as_str(),
"Task has defined a shell script, wrapping in a shell as its required",
);
| } else { | ||
| return `RunTask(${node.params.target})`; | ||
| } | ||
| } |
There was a problem hiding this comment.
getActionLabel has a code path that reaches the end of the function without returning a label. With noImplicitReturns enabled this will be a TS compile error, and it can also make row.label = getActionLabel(node) unsafe. Add an explicit default/fallback return (or an exhaustive never check) so the function always returns a string.
| } | |
| } | |
| // Fallback label for unknown or future action types | |
| return node.action; |
| use crate::shapes::GlobPath; | ||
| use crate::{config_struct, config_unit_enum}; | ||
| use schematic::{Config, ConfigEnum}; | ||
| use crate::{PortablePath, config_struct, config_unit_enum}; |
There was a problem hiding this comment.
PortablePath is imported but never used in this module. This will trigger an unused import warning (and can fail CI if warnings are denied). Remove the unused import or use it if it was intended for the new default function.
| use crate::{PortablePath, config_struct, config_unit_enum}; | |
| use crate::{config_struct, config_unit_enum}; |
| if result.shallow { | ||
| if self.ci_env { | ||
| return Err(AppError::CiNoShallowHistory.into()); | ||
| } else { | ||
| self.affected = false; | ||
| } | ||
| // if self.ci_env { | ||
| // return Err(AppError::CiNoShallowHistory.into()); | ||
| // } else { | ||
| self.affected = false; |
There was a problem hiding this comment.
Large blocks of commented-out code (including the AppError import and the CI shallow-check branch) make it harder to understand the intended behavior and can easily go stale. Prefer a small explicit implementation (e.g., feature flag/env toggle + warning log) and remove the commented code.
Run report for 6527d9fe
|
| Action | Time | Status | Info | |
|---|---|---|---|---|
| 🟩 | SyncWorkspace |
410.4ms | Passed | |
| 🟩 | SyncProject(types) |
8.5ms | Passed | |
| 🟩 | SyncProject(visualizer) |
13.2ms | Passed | |
| 🟩 | SyncProject(runtime) |
15.2ms | Passed | |
| 🟩 | SyncProject(report) |
25.8ms | Passed | |
| 🟩 | SyncProject(website) |
42.3ms | Passed | |
| 🟩 | SetupProto(0.55.2) |
10.3s | Passed | |
| 🟩 | SetupToolchain(node:22.14.0) |
10s | Passed | |
| 🟩 | SetupToolchain(yarn:4.12.0) |
634.6ms | Passed | |
| ⬛️ | SetupToolchain(javascript) |
0.3ms | Skipped | |
| 🟩 | SetupEnvironment(javascript) |
5.7ms | Passed | |
| 🟩 | InstallDependencies(javascript) |
1m 3s | Passed | |
| 🟦 | RunTask(types:build) |
2.1s | Cached | |
| 🟦 | RunTask(visualizer:typecheck) |
384.7ms | Cached | |
| 🟦 | RunTask(visualizer:format) |
448.2ms | Cached | |
| 🟦 | RunTask(visualizer:lint) |
216.3ms | Cached | |
| 🟦 | RunTask(visualizer:test) |
366.6ms | Cached | |
| 🟦 | RunTask(runtime:build) |
843.9ms | Cached | |
| 🟦 | RunTask(report:build) |
919.5ms | Cached | |
| 🟦 | RunTask(visualizer:build) |
861.3ms | Cached | |
| And 1 more... |
Expanded report
| Action | Time | Status | Info | |
|---|---|---|---|---|
| 🟦 | RunTask(website:build) |
17.6s | Cached |
Environment
OS: Windows
Matrix:
os = windows-latest
Changed files
.github/workflows/publish-npm.yml
.github/workflows/rust.yml
.yarn/versions/8aff476a.yml
CHANGELOG.md
crates/app-macros/src/lib.rs
crates/app/src/commands/action_graph.rs
crates/app/src/commands/docker/prune.rs
crates/app/src/commands/exec.rs
crates/app/src/commands/graph/dto.rs
crates/app/src/commands/graph/mod.rs
crates/app/src/commands/graph/utils.rs
crates/app/src/commands/project_graph.rs
crates/app/src/commands/task_graph.rs
crates/cli/tests/__fixtures__/pipeline/shared/moon.yml
crates/cli/tests/exec_test.rs
crates/config/src/workspace/hasher_config.rs
crates/graph-utils/src/graph_formats.rs
crates/task-builder/src/tasks_builder.rs
crates/task-builder/tests/__fixtures__/builder/auto-shell/moon.yml
crates/task-builder/tests/__fixtures__/builder/env-substitute/moon.yml
crates/task-builder/tests/__fixtures__/builder/options-runinci/moon.yml
crates/task-builder/tests/__fixtures__/builder/syntax/moon.yml
crates/task-builder/tests/tasks_builder_test.rs
crates/task/src/task.rs
packages/report/package.json
packages/runtime/package.json
packages/types/package.json
packages/visualizer/package.json
packages/visualizer/src/helpers/render.ts
packages/visualizer/src/helpers/types.ts
packages/visualizer/tsconfig.json
scripts/release/publish.sh
scripts/release/release.sh
scripts/release/setupNpm.sh
website/docs/config/workspace.mdx
yarn.lock
Run report for 6527d9fe
|
| Action | Time | Status | Info | |
|---|---|---|---|---|
| 🟩 | SyncWorkspace |
321.2ms | Passed | |
| 🟩 | SyncProject(types) |
6.9ms | Passed | |
| 🟩 | SyncProject(visualizer) |
9.5ms | Passed | |
| 🟩 | SyncProject(runtime) |
15ms | Passed | |
| 🟩 | SyncProject(report) |
15.8ms | Passed | |
| 🟩 | SyncProject(website) |
9.4ms | Passed | |
| 🟩 | SetupProto(0.55.2) |
9.7s | Passed | |
| 🟩 | SetupToolchain(node:22.14.0) |
6.2s | Passed | |
| 🟩 | SetupToolchain(yarn:4.12.0) |
1.2s | Passed | |
| ⬛️ | SetupToolchain(javascript) |
0.2ms | Skipped | |
| 🟩 | SetupEnvironment(javascript) |
4.1ms | Passed | |
| 🟩 | InstallDependencies(javascript) |
40.8s | Passed | |
| 🟦 | RunTask(types:build) |
2.3s | Cached | |
| 🟦 | RunTask(visualizer:typecheck) |
218.6ms | Cached | |
| 🟦 | RunTask(visualizer:test) |
263.3ms | Cached | |
| 🟦 | RunTask(visualizer:lint) |
147.2ms | Cached | |
| 🟦 | RunTask(visualizer:format) |
274.4ms | Cached | |
| 🟦 | RunTask(visualizer:build) |
909.4ms | Cached | |
| 🟦 | RunTask(report:build) |
1.6s | Cached | |
| 🟦 | RunTask(runtime:build) |
1.4s | Cached | |
| And 1 more... |
Expanded report
| Action | Time | Status | Info | |
|---|---|---|---|---|
| 🟦 | RunTask(website:build) |
19.4s | Cached |
Environment
OS: Linux
Matrix:
os = ubuntu-latest
Changed files
.github/workflows/publish-npm.yml
.github/workflows/rust.yml
.yarn/versions/8aff476a.yml
CHANGELOG.md
crates/app-macros/src/lib.rs
crates/app/src/commands/action_graph.rs
crates/app/src/commands/docker/prune.rs
crates/app/src/commands/exec.rs
crates/app/src/commands/graph/dto.rs
crates/app/src/commands/graph/mod.rs
crates/app/src/commands/graph/utils.rs
crates/app/src/commands/project_graph.rs
crates/app/src/commands/task_graph.rs
crates/cli/tests/__fixtures__/pipeline/shared/moon.yml
crates/cli/tests/exec_test.rs
crates/config/src/workspace/hasher_config.rs
crates/graph-utils/src/graph_formats.rs
crates/task-builder/src/tasks_builder.rs
crates/task-builder/tests/__fixtures__/builder/auto-shell/moon.yml
crates/task-builder/tests/__fixtures__/builder/env-substitute/moon.yml
crates/task-builder/tests/__fixtures__/builder/options-runinci/moon.yml
crates/task-builder/tests/__fixtures__/builder/syntax/moon.yml
crates/task-builder/tests/tasks_builder_test.rs
crates/task/src/task.rs
packages/report/package.json
packages/runtime/package.json
packages/types/package.json
packages/visualizer/package.json
packages/visualizer/src/helpers/render.ts
packages/visualizer/src/helpers/types.ts
packages/visualizer/tsconfig.json
scripts/release/publish.sh
scripts/release/release.sh
scripts/release/setupNpm.sh
website/docs/config/workspace.mdx
yarn.lock
## Summary Kibana VM images are currently broken @ moon 2.0.1 due to us using a shallow clone for warming up the initial install/moon caches. Moon @ 2.0.4 has bugfixes and no errors on a shallow clone (moonrepo/moon#2384)
## Summary Kibana VM images are currently broken @ moon 2.0.1 due to us using a shallow clone for warming up the initial install/moon caches. Moon @ 2.0.4 has bugfixes and no errors on a shallow clone (moonrepo/moon#2384)
## Summary Kibana VM images are currently broken @ moon 2.0.1 due to us using a shallow clone for warming up the initial install/moon caches. Moon @ 2.0.4 has bugfixes and no errors on a shallow clone (moonrepo/moon#2384)
## Summary Kibana VM images are currently broken @ moon 2.0.1 due to us using a shallow clone for warming up the initial install/moon caches. Moon @ 2.0.4 has bugfixes and no errors on a shallow clone (moonrepo/moon#2384) (cherry picked from commit adab6fa) # Conflicts: # package.json # yarn.lock
No description provided.