Skip to content

fix: Audit 02/24#2384

Merged
milesj merged 12 commits intomasterfrom
fixes-0224
Feb 25, 2026
Merged

fix: Audit 02/24#2384
milesj merged 12 commits intomasterfrom
fixes-0224

Conversation

@milesj
Copy link
Copy Markdown
Collaborator

@milesj milesj commented Feb 25, 2026

No description provided.

Copilot AI review requested due to automatic review settings February 25, 2026 18:05
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 GraphToJson JSON format (pretty for --json, compact for the server), and update the visualizer to handle the newer graph shape.
  • Refine task-building behavior around runInCI defaults and shell auto-detection (respect shell: false for glob/env detection), with added fixtures/tests.
  • Add defaults for hasher.ignoreMissingPatterns, add MOON_INCLUDE_RELATIONS env support for --include-relations, add more docker prune debug 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})`;
}
}
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
}
}
// Fallback label for unknown or future action types
return node.action;

Copilot uses AI. Check for mistakes.
use crate::shapes::GlobPath;
use crate::{config_struct, config_unit_enum};
use schematic::{Config, ConfigEnum};
use crate::{PortablePath, config_struct, config_unit_enum};
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
use crate::{PortablePath, config_struct, config_unit_enum};
use crate::{config_struct, config_unit_enum};

Copilot uses AI. Check for mistakes.
Comment on lines 361 to +365
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;
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 25, 2026

Run report for 6527d9fe (windows-latest)

Total time: 1m 45s | Comparison time: 4m 36s | Estimated savings: 2m 50s (61.9% faster)

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

@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 25, 2026

Run report for 6527d9fe (ubuntu-latest)

Total time: 1m 21s | Comparison time: 4m 34s | Estimated savings: 3m 12s (70.3% faster)

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

@milesj milesj merged commit ac7f8da into master Feb 25, 2026
35 of 38 checks passed
@milesj milesj deleted the fixes-0224 branch February 25, 2026 21:57
delanni added a commit to elastic/kibana that referenced this pull request Mar 13, 2026
## 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)
sorenlouv pushed a commit to elastic/kibana that referenced this pull request Mar 17, 2026
## 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)
jeramysoucy pushed a commit to jeramysoucy/kibana that referenced this pull request Mar 26, 2026
## 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)
delanni added a commit to delanni/kibana that referenced this pull request Mar 27, 2026
## 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants