Skip to content

Pass through errors when deserialization fails in NodeState#2292

Merged
milesj merged 5 commits intomoonrepo:masterfrom
Adjective-Object:adjective-object/nodestate-untagged-errors
Jan 13, 2026
Merged

Pass through errors when deserialization fails in NodeState#2292
milesj merged 5 commits intomoonrepo:masterfrom
Adjective-Object:adjective-object/nodestate-untagged-errors

Conversation

@Adjective-Object
Copy link
Copy Markdown
Contributor

Problem

At present, whenever deserialization fails for a Package, the deserialization error is swallowed and replaced with data did not match any variant of untagged enum NodeState.

Solution & Changes

This change is inspired by serde_untagged, and implements a custom deserializer for NodeState that forwards all non-empty serde types to the inner type + returns the inner type's deserializer errors.

This change contains 2 commits:

  • 893be7441fab413f7e5a537c627d17a9f4b4997b performs the actual work
  • bd87e312f5464a819a230253eef04a19781d0f01 adds some missing cfg() and dependencies related to proto_core, which were causing test runs to fail

See: #2201.

Ok(result.config)
}

#[cfg(feature = "proto")]
Copy link
Copy Markdown
Contributor Author

@Adjective-Object Adjective-Object Jan 8, 2026

Choose a reason for hiding this comment

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

this method references types from proto_core, when proto_core is not in the build graph unless the proto feature flag is turned on

moon_toolchain_plugin = { path = "../toolchain-plugin" }
moon_vcs = { path = "../vcs" }
moon_workspace_graph = { path = "../workspace-graph" }
proto_core = { workspace = true }
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This package references proto_core but never lists it as a dependency

@milesj milesj merged commit 132a4f9 into moonrepo:master Jan 13, 2026
31 of 34 checks passed
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