Skip to content

Rename DotrainGuiStateV1 to OrderBuilderStateV1#93

Merged
thedavidmeister merged 8 commits intomainfrom
rename-gui-state-to-order-builder-state
Apr 28, 2026
Merged

Rename DotrainGuiStateV1 to OrderBuilderStateV1#93
thedavidmeister merged 8 commits intomainfrom
rename-gui-state-to-order-builder-state

Conversation

@findolor
Copy link
Copy Markdown
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

    • Renamed internal state types and associated modules for improved naming consistency.
  • Chores

    • Updated build configuration to exclude pre-commit configuration files from version control.

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
Copy Markdown

coderabbitai Bot commented Feb 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 9ca21009-cc93-4146-81c6-15eae50e3d7b

📥 Commits

Reviewing files that changed from the base of the PR and between 14d8dcc and 8a9495f.

⛔ Files ignored due to path filters (1)
  • flake.lock is excluded by !**/*.lock
📒 Files selected for processing (1)
  • .gitignore

Walkthrough

Systematic rename of metadata type and module identifiers from DotrainGuiStateV1 to OrderBuilderStateV1 across the CLI metadata subsystem, maintaining identical discriminant values and control flow. Additionally, .gitignore updated to exclude .pre-commit-config.yaml.

Changes

Cohort / File(s) Summary
Magic Discriminators
crates/cli/src/meta/magic.rs
Renamed enum variant KnownMagic::DotrainGuiStateV1 to OrderBuilderStateV1 with identical discriminant 0xffda7b2fb167c286. Updated TryFrom<u64> conversion and tests accordingly.
Metadata Type System
crates/cli/src/meta/mod.rs
Updated KnownMeta enum variant from DotrainGuiStateV1 to OrderBuilderStateV1. Adjusted TryFrom<KnownMagic> mapping and RainMetaDocumentV1Item unpacking routes.
Type Module Organization
crates/cli/src/meta/types/dotrain/mod.rs
Replaced public module export from gui_state_v1 to order_builder_state_v1.
Type Implementation
crates/cli/src/meta/types/dotrain/order_builder_state_v1.rs
Renamed struct DotrainGuiStateV1 to OrderBuilderStateV1. Updated all trait implementations, TryFrom conversions, CBOR serialization/deserialization, magic discriminator references, and tests to use new type name.
Build Ignore Configuration
.gitignore
Added .pre-commit-config.yaml to ignore list.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and concisely describes the main change: renaming DotrainGuiStateV1 to OrderBuilderStateV1, which aligns perfectly with the changeset across all modified files.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • 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
Copy Markdown

@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 thread crates/cli/src/meta/magic.rs Outdated
…rder-builder-state

# Conflicts:
#	crates/cli/src/meta/magic.rs
#	crates/cli/src/meta/mod.rs
Copy link
Copy Markdown

@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.

Caution

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

⚠️ Outside diff range comments (1)
crates/cli/src/meta/magic.rs (1)

179-185: 🧹 Nitpick | 🔵 Trivial

Test name is stale after the rename.

test_dotrain_instance_meta_v1 now tests KnownMagic::OrderBuilderStateV1. Consider renaming for consistency with the rest of the rename and with the other per-variant tests in this module.

📝 Proposed fix
-    #[test]
-    fn test_dotrain_instance_meta_v1() {
-        let magic_number = KnownMagic::OrderBuilderStateV1;
+    #[test]
+    fn test_order_builder_state_v1() {
+        let magic_number = KnownMagic::OrderBuilderStateV1;
         let magic_number_after_prefix = magic_number.to_prefix_bytes();
 
         assert_eq!(hex::encode(magic_number_after_prefix), "ffda7b2fb167c286");
     }
🤖 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 179 - 185, The test function name
is stale—rename fn test_dotrain_instance_meta_v1() to reflect the variant being
asserted (e.g., fn test_known_magic_order_builder_state_v1() or fn
test_order_builder_state_v1_magic()) so it matches the checked value
KnownMagic::OrderBuilderStateV1 and the naming pattern of other per-variant
tests; update the test declaration and any references accordingly while leaving
the assertion body (hex::encode(magic_number_after_prefix) ==
"ffda7b2fb167c286") unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@crates/cli/src/meta/magic.rs`:
- Around line 179-185: The test function name is stale—rename fn
test_dotrain_instance_meta_v1() to reflect the variant being asserted (e.g., fn
test_known_magic_order_builder_state_v1() or fn
test_order_builder_state_v1_magic()) so it matches the checked value
KnownMagic::OrderBuilderStateV1 and the naming pattern of other per-variant
tests; update the test declaration and any references accordingly while leaving
the assertion body (hex::encode(magic_number_after_prefix) ==
"ffda7b2fb167c286") unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 6c3cf35a-e9ce-4a45-bf60-44d4c34a0a6d

📥 Commits

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

📒 Files selected for processing (2)
  • crates/cli/src/meta/magic.rs
  • crates/cli/src/meta/mod.rs

@findolor findolor requested a review from hardyjosh April 17, 2026 06:58
Copy link
Copy Markdown

@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.

Caution

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

⚠️ Outside diff range comments (1)
crates/cli/src/meta/magic.rs (1)

179-185: 🧹 Nitpick | 🔵 Trivial

Stale test name: test_dotrain_instance_meta_v1 no longer reflects the variant under test.

Consider renaming to match the new variant for consistency with the other per-variant tests in this module.

✏️ Proposed rename
-    #[test]
-    fn test_dotrain_instance_meta_v1() {
+    #[test]
+    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 179 - 185, Rename the stale test
function test_dotrain_instance_meta_v1 to a name that reflects the variant under
test (e.g., test_order_builder_state_v1) to match the other per-variant tests;
update the test function identifier while keeping the body that references
KnownMagic::OrderBuilderStateV1 and its to_prefix_bytes() assertion unchanged so
the test still verifies hex::encode(magic_number_after_prefix) ==
"ffda7b2fb167c286".
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@crates/cli/src/meta/magic.rs`:
- Around line 179-185: Rename the stale test function
test_dotrain_instance_meta_v1 to a name that reflects the variant under test
(e.g., test_order_builder_state_v1) to match the other per-variant tests; update
the test function identifier while keeping the body that references
KnownMagic::OrderBuilderStateV1 and its to_prefix_bytes() assertion unchanged so
the test still verifies hex::encode(magic_number_after_prefix) ==
"ffda7b2fb167c286".

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 0359ffc9-6427-4479-9702-9bdd9bfb4c86

📥 Commits

Reviewing files that changed from the base of the PR and between e056d2d and 14d8dcc.

📒 Files selected for processing (2)
  • crates/cli/src/meta/magic.rs
  • test/lib/deploy/LibMetaBoardDeploy.t.sol

findolor and others added 4 commits April 17, 2026 14:40
@thedavidmeister thedavidmeister merged commit 0cfba66 into main Apr 28, 2026
9 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

@coderabbitai assess this PR size classification for the totality of the PR with the following criterias and report it in your comment:

S/M/L PR Classification Guidelines:

This guide helps classify merged pull requests by effort and complexity rather than just line count. The goal is to assess the difficulty and scope of changes after they have been completed.

Small (S)

Characteristics:

  • Simple bug fixes, typos, or minor refactoring
  • Single-purpose changes affecting 1-2 files
  • Documentation updates
  • Configuration tweaks
  • Changes that require minimal context to review

Review Effort: Would have taken 5-10 minutes

Examples:

  • Fix typo in variable name
  • Update README with new instructions
  • Adjust configuration values
  • Simple one-line bug fixes
  • Import statement cleanup

Medium (M)

Characteristics:

  • Feature additions or enhancements
  • Refactoring that touches multiple files but maintains existing behavior
  • Breaking changes with backward compatibility
  • Changes requiring some domain knowledge to review

Review Effort: Would have taken 15-30 minutes

Examples:

  • Add new feature or component
  • Refactor common utility functions
  • Update dependencies with minor breaking changes
  • Add new component with tests
  • Performance optimizations
  • More complex bug fixes

Large (L)

Characteristics:

  • Major feature implementations
  • Breaking changes or API redesigns
  • Complex refactoring across multiple modules
  • New architectural patterns or significant design changes
  • Changes requiring deep context and multiple review rounds

Review Effort: Would have taken 45+ minutes

Examples:

  • Complete new feature with frontend/backend changes
  • Protocol upgrades or breaking changes
  • Major architectural refactoring
  • Framework or technology upgrades

Additional Factors to Consider

When deciding between sizes, also consider:

  • Test coverage impact: More comprehensive test changes lean toward larger classification
  • Risk level: Changes to critical systems bump up a size category
  • Team familiarity: Novel patterns or technologies increase complexity

Notes:

  • the assessment must be for the totality of the PR, that means comparing the base branch to the last commit of the PR
  • the assessment output must be exactly one of: S, M or L (single-line comment) in format of: SIZE={S/M/L}
  • do not include any additional text, only the size classification
  • your assessment comment must not include tips or additional sections
  • do NOT tag me or anyone else on your comment

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 28, 2026

Tip

For best results, initiate chat on the files or code changes.

SIZE=S

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.

2 participants