Skip to content

Commit 02b2798

Browse files
committed
new: Add v1.38 blog post. (#2024)
* More blog work. * Polish.
1 parent 90fcf67 commit 02b2798

17 files changed

Lines changed: 81 additions & 51 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
`notifier.terminalNotifications` setting in `.moon/workspace.yml`.
3333
- Added a `notifier.webhookAcknowledge` setting, that ensures webhooks resolve with a 2xx status
3434
code.
35+
- Updated project graph invalidation to take manifests from toolchain plugins into account.
3536

3637
#### 🐞 Fixes
3738

crates/plugin/src/plugin.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ use warpgate::{Id, PluginContainer, PluginLocator};
88

99
pub struct PluginRegistration {
1010
pub container: PluginContainer,
11-
pub id: Id,
11+
pub id: Id, // unstable_foo
12+
pub id_stable: Id, // foo
1213
pub locator: PluginLocator,
1314
pub moon_env: Arc<MoonEnvironment>,
1415
pub proto_env: Arc<ProtoEnvironment>,

crates/plugin/src/plugin_registry.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,17 +179,15 @@ impl<T: Plugin> PluginRegistry<T> {
179179
// expect a specific ID, for example "rust", and if we provide
180180
// "unstable_rust", it breaks in weird ways.
181181
let orig_id = entry.key().as_str();
182-
let stable_id = orig_id.strip_prefix("unstable_").unwrap_or(orig_id);
182+
let stable_id =
183+
PluginId::new(orig_id.strip_prefix("unstable_").unwrap_or(orig_id))?;
183184

184185
// Combine everything into the container and register
185186
let plugin = T::new(PluginRegistration {
186-
container: PluginContainer::new(
187-
PluginId::new(stable_id)?,
188-
manifest,
189-
functions,
190-
)?,
187+
container: PluginContainer::new(stable_id.clone(), manifest, functions)?,
191188
locator: locator.to_owned(),
192189
id: entry.key().to_owned(),
190+
id_stable: stable_id,
193191
moon_env: Arc::clone(&self.host_data.moon_env),
194192
proto_env: Arc::clone(&self.host_data.proto_env),
195193
wasm_file: plugin_file,

crates/task-runner/src/task_hashing.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -222,12 +222,14 @@ async fn apply_toolchain_dependencies(
222222
let mut lock_files = vec![];
223223
let mut workspace_manifests = vec![];
224224
let mut project_manifests = vec![];
225+
let has_parse_manifest = toolchain.has_func("parse_manifest").await;
226+
let has_parse_lock = toolchain.has_func("parse_lock").await;
225227

226228
// Load the project manifest
227229
for manifest_file_name in &toolchain.metadata.manifest_file_names {
228230
let manifest_path = project_root.join(manifest_file_name);
229231

230-
if toolchain.has_func("parse_manifest").await {
232+
if manifest_path.exists() && has_parse_manifest {
231233
project_manifests.push(
232234
toolchain
233235
.parse_manifest(ParseManifestInput {
@@ -264,7 +266,7 @@ async fn apply_toolchain_dependencies(
264266

265267
if lock_path.exists()
266268
&& app_context.workspace_config.hasher.optimization == HasherOptimization::Accuracy
267-
&& toolchain.has_func("parse_lock").await
269+
&& has_parse_lock
268270
{
269271
lock_files.push(
270272
toolchain
@@ -281,10 +283,7 @@ async fn apply_toolchain_dependencies(
281283
for manifest_file_name in &toolchain.metadata.manifest_file_names {
282284
let manifest_path = deps_root.join(manifest_file_name);
283285

284-
if manifest_path.exists()
285-
&& deps_root != project_root
286-
&& toolchain.has_func("parse_manifest").await
287-
{
286+
if manifest_path.exists() && deps_root != project_root && has_parse_manifest {
288287
workspace_manifests.push(
289288
toolchain
290289
.parse_manifest(ParseManifestInput {
@@ -345,6 +344,7 @@ fn apply_toolchain_dependencies_by_manifest(
345344
);
346345

347346
let mut inject = false;
347+
let empty_deps = BTreeMap::new();
348348

349349
for manifest in project_manifests {
350350
for (scope, project_deps) in [
@@ -355,7 +355,7 @@ fn apply_toolchain_dependencies_by_manifest(
355355
] {
356356
if apply_toolchain_dependencies_by_scope(
357357
project_deps,
358-
workspace_deps.get(&scope).unwrap(),
358+
workspace_deps.get(&scope).unwrap_or(&empty_deps),
359359
&locked_deps,
360360
hash_content,
361361
) {

crates/toolchain-plugin/src/toolchain_plugin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ impl Plugin for ToolchainPlugin {
4545
tool: if plugin.has_func("register_tool").await {
4646
Some(RwLock::new(
4747
Tool::new(
48-
registration.id.clone(),
48+
registration.id_stable,
4949
Arc::clone(&registration.proto_env),
5050
Arc::clone(&plugin),
5151
)

crates/toolchain/src/detect/languages.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,15 @@ pub static BUN: StaticStringList = &["bunfig.toml", "bun.lock", "bun.lockb", ".b
55

66
pub static DENO: StaticStringList = &["deno.json", "deno.jsonc", "deno.lock", ".dvmrc"];
77

8-
pub static GO: StaticStringList = &["go.mod", "go.sum", "g.lock", ".gvmrc", ".go-version"];
8+
pub static GO: StaticStringList = &[
9+
"go.mod",
10+
"go.sum",
11+
"go.work",
12+
"go.work.sum",
13+
"g.lock",
14+
".gvmrc",
15+
".go-version",
16+
];
917

1018
pub static NODE: StaticStringList = &[
1119
"package.json",
Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
11
---
22
slug: moon-v1.38
3-
title: moon v1.38 - Go WASM toolchain ...
3+
title: moon v1.38 - Go WASM toolchain, MCP tools, terminal notifications, and more!
44
authors: [milesj]
5-
tags: [toolchain, wasm, plugin, go, mcp, ai, webhooks]
6-
# image: ./img/moon/v1.38.png
5+
tags: [toolchain, wasm, plugin, go, mcp, ai, webhooks, terminal, notifications]
6+
image: ./img/moon/v1.38.png
77
---
88

9-
In this release, we're stoked to release yet another WASM toolchain plugin, and improved MCP/AI
10-
support!
9+
In this release, we're stoked to release the Go WASM toolchain plugin, and improved MCP/AI support!
1110

1211
<!--truncate-->
1312

1413
## RFC: Task inheritance via inline configuration
1514

16-
TODO
15+
Task inheritance is one of moon's most powerful features, allowing you to define tasks at the
16+
top-level and have them automatically inherited by projects that match certain conditions. In it's
17+
current form, task inheritance is based on the file name of the configuration file, but this
18+
approach has several limitations.
19+
20+
We're planning to improve task inheritance and have written up an
21+
[RFC to discuss these changes](https://github.com/moonrepo/moon/issues/2023). We'd appreciate any
22+
and all feedback!
1723

1824
## New Go toolchain powered by WASM
1925

@@ -51,11 +57,41 @@ We hope you enjoy this new Go toolchain. With that said, we are _not_ Go experts
5157
hear from you on what works, what doesn't, what can be improved, and what features you would like to
5258
see added!
5359

60+
## New MCP tools
61+
62+
In our last release, we introduced the [`moon mcp` command](./moon-v1.37#mcp-editor-integration),
63+
offering deep editor integration with AI models like GitHub Copilot and Cursor. This release expands
64+
on that by introducing 3 more tools to utilize:
65+
66+
- `get_touched_files` - Gets touched files between base and head revisions.
67+
- `sync_projects` - Runs the `SyncProject` action for one or many projects by `id`.
68+
- `sync_workspace` - Runs the `SyncWorkspace` action.
69+
70+
## New OS terminal notifications
71+
72+
This was a feature we originally scoped out during moon's inception, almost 3 years ago, but we
73+
never got around to implementing it. However, there has been some improvements to native operating
74+
system notifications in Rust lately, so it felt like a good time to finally implement it!
75+
76+
And on that note, we are introducing a new
77+
[`notifier.terminalNotifications`](/docs/config/workspace#terminalnotifications) setting that allows
78+
you to receive terminal notifications for pipeline events.
79+
80+
```yaml title=".moon/workspace.yml"
81+
notifier:
82+
terminalNotifications: 'failure'
83+
```
84+
85+
> View the [official guide](/docs/guides/notifications) for more information!
86+
5487
## Other changes
5588

5689
View the [official release](https://github.com/moonrepo/moon/releases/tag/v1.38.0) for a full list
5790
of changes.
5891

92+
- Added new `moon toolchain` command and sub-commands.
93+
- Add a toolchain to `.moon/toolchain.yml` with `moon toolchain add`.
94+
- View information about a toolchain plugin with `moon toolchain info`.
5995
- Added a `notifier.webhookAcknowledge` setting, that ensures webhooks resolve with a 2XX status
6096
code.
6197
- Updated proto to [v0.50.1](https://github.com/moonrepo/proto/releases/tag/v0.50.0) (from 0.49.4).

website/blog/img/moon/v1.38.png

998 KB
Loading

website/docs/__partials__/create-task/go/filegroups.mdx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ tasks:
99
command: 'go build -o @out(0)'
1010
inputs:
1111
- '@globs(sources)'
12-
- 'go.mod'
13-
- '/go.mod'
1412
outputs:
1513
- 'build' # Just an example!
1614
```

website/docs/__partials__/create-task/go/inputs.mdx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,4 @@ tasks:
66
command: 'go build -o build'
77
inputs:
88
- 'src/**/*'
9-
- 'go.mod'
10-
- '/go.mod'
119
```

0 commit comments

Comments
 (0)