Skip to content

Commit

Permalink
fix: Fix docker scaffold not copying moon.yml. (#1292)
Browse files Browse the repository at this point in the history
* Add fix.

* Add tests.
  • Loading branch information
milesj authored Jan 26, 2024
1 parent 2802690 commit b5067e2
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
9 changes: 9 additions & 0 deletions .yarn/versions/0957d65a.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
releases:
"@moonrepo/cli": patch
"@moonrepo/core-linux-arm64-gnu": patch
"@moonrepo/core-linux-arm64-musl": patch
"@moonrepo/core-linux-x64-gnu": patch
"@moonrepo/core-linux-x64-musl": patch
"@moonrepo/core-macos-arm64": patch
"@moonrepo/core-macos-x64": patch
"@moonrepo/core-windows-x64-msvc": patch
8 changes: 6 additions & 2 deletions crates/cli/src/commands/docker/scaffold.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use super::MANIFEST_NAME;
use clap::Args;
use moon::generate_project_graph;
use moon_common::consts::CONFIG_DIRNAME;
use moon_common::consts::{CONFIG_DIRNAME, CONFIG_PROJECT_FILENAME, CONFIG_TEMPLATE_FILENAME};
use moon_common::Id;
use moon_config::{ConfigEnum, LanguageType};
use moon_platform_detector::detect_language_files;
Expand Down Expand Up @@ -60,7 +60,11 @@ fn scaffold_workspace(
// Copy manifest and config files for every type of language,
// not just the one the project is configured as!
let copy_from_dir = |source: &Path, dest: &Path| -> AppResult {
let mut files: Vec<String> = vec![".prototools".to_owned()];
let mut files: Vec<String> = vec![
".prototools".to_owned(),
CONFIG_PROJECT_FILENAME.to_owned(),
CONFIG_TEMPLATE_FILENAME.to_owned(),
];

for lang in LanguageType::variants() {
files.extend(detect_language_files(&lang));
Expand Down
3 changes: 3 additions & 0 deletions crates/cli/tests/docker_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ mod scaffold_workspace {
assert!(docker.join(".moon/tasks/node.yml").exists());
assert!(docker.join(".moon/toolchain.yml").exists());
assert!(docker.join(".moon/workspace.yml").exists());
assert!(docker.join("base/moon.yml").exists());
assert!(docker.join("swc/moon.yml").exists());
assert!(docker.join("version-override/moon.yml").exists());
}

#[test]
Expand Down
7 changes: 7 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@
- More accurately monitors signals (ctrl+c) and shutdowns.
- Tasks can now be configured with a timeout.

## Unreleased

#### 🐞 Fixes

- Fixed `moon docker scaffold` not copying the project specific `moon.yml` file, resulting in a
skewed project graph.

## 1.20.0

#### 🚀 Updates
Expand Down

0 comments on commit b5067e2

Please sign in to comment.