Skip to content

Rename DotrainGuiStateV1 to OrderBuilderStateV1#93

Open
findolor wants to merge 1 commit intomainfrom
rename-gui-state-to-order-builder-state
Open

Rename DotrainGuiStateV1 to OrderBuilderStateV1#93
findolor wants to merge 1 commit intomainfrom
rename-gui-state-to-order-builder-state

Conversation

@findolor
Copy link
Contributor

@findolor findolor commented Feb 24, 2026

Motivation

The "GUI" terminology is being phased out across the Rain ecosystem in favor of "Order Builder", which more accurately describes the purpose of these types — they configure order building, not a GUI specifically. This rename aligns rain.metadata with the ongoing renaming effort in rain.orderbook.

Solution

Renames DotrainGuiStateV1 to OrderBuilderStateV1 across 4 files:

  • gui_state_v1.rsorder_builder_state_v1.rs: Renamed file and all struct references, trait implementations, doc comments, and tests
  • magic.rs: KnownMagic::DotrainGuiStateV1KnownMagic::OrderBuilderStateV1 (magic number value 0xffda7b2fb167c286 unchanged)
  • mod.rs (meta): KnownMeta::DotrainGuiStateV1KnownMeta::OrderBuilderStateV1
  • mod.rs (dotrain): Module declaration gui_state_v1order_builder_state_v1

No functional changes. Wire format is unchanged.

Checks

By submitting this for review, I'm confirming I've done the following:

  • made this PR as small as possible
  • unit-tested any new functionality
  • linked any relevant issues or PRs
  • included screenshots (if this involves a front-end change)

Summary by CodeRabbit

  • Refactor
    • Updated internal naming conventions to improve clarity and consistency across the codebase.

Renames gui_state_v1.rs to order_builder_state_v1.rs and updates the
struct, KnownMagic variant, and KnownMeta variant accordingly. The magic
number value is unchanged.
@findolor findolor self-assigned this Feb 24, 2026
@coderabbitai
Copy link

coderabbitai bot commented Feb 24, 2026

Walkthrough

This pull request systematically renames the public enum variant DotrainGuiStateV1 to OrderBuilderStateV1 across multiple files in the CLI metadata system, preserving numeric discriminants and behavioral logic while updating all associated type definitions, implementations, conversions, and tests to reflect the new naming.

Changes

Cohort / File(s) Summary
Enum and Conversion Updates
crates/cli/src/meta/magic.rs, crates/cli/src/meta/mod.rs
Updated KnownMagic::DotrainGuiStateV1 to KnownMagic::OrderBuilderStateV1 in enum variant declaration and TryFrom<u64> implementation. Updated KnownMeta enum and TryFrom<KnownMagic> conversion mapping to use the renamed variant. Adjusted payload unpacking logic in RainMetaDocumentV1Item::unpack_into to recognize the renamed variant.
Module and Type Definitions
crates/cli/src/meta/types/dotrain/mod.rs, crates/cli/src/meta/types/dotrain/order_builder_state_v1.rs
Renamed module export from gui_state_v1 to order_builder_state_v1. Renamed struct DotrainGuiStateV1 to OrderBuilderStateV1 throughout, including wasm trait implementations, impl blocks, and trait implementations (TryFrom<OrderBuilderStateV1> and reverse). Updated serialization/deserialization logic, magic discriminator references, and all test cases to use the new type name.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Rename DotrainGuiStateV1 to OrderBuilderStateV1' accurately and concisely describes the main change across all four files in the changeset.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch rename-gui-state-to-order-builder-state

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
crates/cli/src/meta/types/dotrain/order_builder_state_v1.rs (2)

13-23: 🧹 Nitpick | 🔵 Trivial

Nit: doc comment still references "dotrain instance".

Line 13: "Configuration for a value field in the dotrain instance" — consider updating to "order builder state" or simply "order builder" to match the new terminology.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@crates/cli/src/meta/types/dotrain/order_builder_state_v1.rs` around lines 13
- 23, Update the struct doc comment for ValueCfg to remove the outdated "dotrain
instance" wording and reference the new terminology (e.g., "order builder state"
or "order builder"); locate the ValueCfg definition and change the first line
comment to something like "Configuration for a value field in the order builder
state" so the documentation matches the current domain language.

40-44: 🧹 Nitpick | 🔵 Trivial

Stale doc comment: still says "Dotrain Instance V1 metadata".

The struct doc comment should be updated to reflect the new naming, e.g., "Order Builder State V1 metadata".

📝 Proposed fix
-/// Dotrain Instance V1 metadata - contains user's specific configuration
-/// for a deployed order referencing a dotrain template
+/// Order Builder State V1 metadata - contains user's specific configuration
+/// for a deployed order referencing a dotrain template
 #[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
 #[cfg_attr(target_family = "wasm", derive(Tsify))]
 pub struct OrderBuilderStateV1 {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@crates/cli/src/meta/types/dotrain/order_builder_state_v1.rs` around lines 40
- 44, The struct doc comment for OrderBuilderStateV1 is stale ("Dotrain Instance
V1 metadata"); update the doc comment above the OrderBuilderStateV1 definition
to reflect the new name (e.g., "Order Builder State V1 metadata - contains
user's specific configuration for a deployed order referencing a dotrain
template") so the comment matches the struct name and purpose.
crates/cli/src/meta/magic.rs (1)

173-178: 🧹 Nitpick | 🔵 Trivial

Nit: test function name is stale.

test_dotrain_instance_meta_v1 should be renamed to match the new variant name (e.g., test_order_builder_state_v1) for consistency with the rest of the rename.

📝 Proposed fix
     #[test]
-    fn test_dotrain_instance_meta_v1() {
+    fn test_order_builder_state_v1() {
         let magic_number = KnownMagic::OrderBuilderStateV1;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@crates/cli/src/meta/magic.rs` around lines 173 - 178, The test function name
is stale; rename the test function test_dotrain_instance_meta_v1 to match the
new variant naming (e.g., test_order_builder_state_v1) so it reflects
KnownMagic::OrderBuilderStateV1 and keeps consistency; update the function
declaration and any references to the old name in the file
crate::cli::meta::magic (the test containing the assert_hex) to the new name.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@crates/cli/src/meta/magic.rs`:
- Around line 42-43: Update the stale doc comment on the OrderBuilderStateV1
variant: replace "Dotrain instance meta v1" with a correct description such as
"Order builder state meta v1" so the documentation matches the enum variant
OrderBuilderStateV1 and its purpose.

---

Outside diff comments:
In `@crates/cli/src/meta/magic.rs`:
- Around line 173-178: The test function name is stale; rename the test function
test_dotrain_instance_meta_v1 to match the new variant naming (e.g.,
test_order_builder_state_v1) so it reflects KnownMagic::OrderBuilderStateV1 and
keeps consistency; update the function declaration and any references to the old
name in the file crate::cli::meta::magic (the test containing the assert_hex) to
the new name.

In `@crates/cli/src/meta/types/dotrain/order_builder_state_v1.rs`:
- Around line 13-23: Update the struct doc comment for ValueCfg to remove the
outdated "dotrain instance" wording and reference the new terminology (e.g.,
"order builder state" or "order builder"); locate the ValueCfg definition and
change the first line comment to something like "Configuration for a value field
in the order builder state" so the documentation matches the current domain
language.
- Around line 40-44: The struct doc comment for OrderBuilderStateV1 is stale
("Dotrain Instance V1 metadata"); update the doc comment above the
OrderBuilderStateV1 definition to reflect the new name (e.g., "Order Builder
State V1 metadata - contains user's specific configuration for a deployed order
referencing a dotrain template") so the comment matches the struct name and
purpose.

ℹ️ Review info

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a823381 and a712031.

📒 Files selected for processing (4)
  • crates/cli/src/meta/magic.rs
  • crates/cli/src/meta/mod.rs
  • crates/cli/src/meta/types/dotrain/mod.rs
  • crates/cli/src/meta/types/dotrain/order_builder_state_v1.rs

Comment on lines 42 to +43
/// Dotrain instance meta v1
DotrainGuiStateV1 = 0xffda7b2fb167c286,
OrderBuilderStateV1 = 0xffda7b2fb167c286,
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Stale doc comment: still says "Dotrain instance meta v1".

The doc comment should be updated to reflect the new name, e.g., "Order builder state meta v1".

📝 Proposed fix
-    /// Dotrain instance meta v1
+    /// Order builder state meta v1
     OrderBuilderStateV1 = 0xffda7b2fb167c286,
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/// Dotrain instance meta v1
DotrainGuiStateV1 = 0xffda7b2fb167c286,
OrderBuilderStateV1 = 0xffda7b2fb167c286,
/// Order builder state meta v1
OrderBuilderStateV1 = 0xffda7b2fb167c286,
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@crates/cli/src/meta/magic.rs` around lines 42 - 43, Update the stale doc
comment on the OrderBuilderStateV1 variant: replace "Dotrain instance meta v1"
with a correct description such as "Order builder state meta v1" so the
documentation matches the enum variant OrderBuilderStateV1 and its purpose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant