Skip to content

Commit 9f839e0

Browse files
committed
Polish.
1 parent eb21fbf commit 9f839e0

7 files changed

Lines changed: 17 additions & 17 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
)

website/blog/2025-06-24_moon-v1.38.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
slug: moon-v1.38
33
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

99
In this release, we're stoked to release the Go WASM toolchain plugin, and improved MCP/AI support!

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

998 KB
Loading

0 commit comments

Comments
 (0)