Skip to content
This repository was archived by the owner on Mar 5, 2026. It is now read-only.

refactor: update API to use 'scope' instead of 'group_id' for state management#14

Merged
andersonleal merged 1 commit intomainfrom
fix/states
Feb 16, 2026
Merged

refactor: update API to use 'scope' instead of 'group_id' for state management#14
andersonleal merged 1 commit intomainfrom
fix/states

Conversation

@andersonleal
Copy link
Copy Markdown
Contributor

@andersonleal andersonleal commented Feb 16, 2026

Summary

Aligns the iii-console state API with the iii engine's state module by replacing group_id/item_id with scope/key across the frontend and Rust bridge.

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Changes

  • Frontend (packages/console-frontend/src/api/state/state.ts):

    • fetchStateItems: Request body now sends scope instead of group_id
  • Rust bridge (packages/console-rust/src/bridge/functions.rs):

    • handle_state_group_items: Extracts and forwards scope instead of group_id
    • handle_state_item_set: State input uses scope/key instead of group_id/item_id
    • handle_state_item_delete: Same parameter rename
    • handle_flow_config_get: Flow config state calls use scope/key
    • handle_flow_config_save: Same parameter rename
  • Cargo.lock: Version bump (0.1.5 → 0.1.7)

Checklist

  • Code compiles and lints
  • Changes align with iii engine state module API (state::list, state::set, state::delete, state::get)

Additional Context

The iii engine's state module expects scope and key parameters. The console was previously using the legacy group_id and item_id names, causing state operations to fail. This refactor ensures compatibility with the current engine API.

Summary by CodeRabbit

  • Refactor
    • Updated internal request parameter naming across state management APIs for improved consistency.

…anagement

Changed the API request body and related function parameters to replace 'group_id' with 'scope' for consistency. Updated relevant functions in Rust to reflect this change, ensuring proper handling of state group items and configurations.
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 16, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

This pull request systematically renames state management parameters from group_id/item_id to scope/key across the frontend API and Rust backend bridge handlers. The control flow and overall functionality remain unchanged; only parameter names and their references in request/response payloads are updated.

Changes

Cohort / File(s) Summary
Frontend API State
packages/console-frontend/src/api/state/state.ts
Request payload parameter renamed from group_id to scope in fetchStateItems function.
Rust Bridge Functions
packages/console-rust/src/bridge/functions.rs
Parameter extraction and payload construction updated across multiple handlers (handle_state_group_items, handle_state_item_set, handle_state_item_delete, handle_flow_config_get, handle_flow_config_save) to use scope/key instead of group_id/item_id. Error messages and state_input object keys updated accordingly.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • guibeira
  • ytallo

Poem

🐰 A rabbit hops through refactored code,
Where scope and key now light the road,
Old names fade like morning dew,
Consistency blooms in all that's new! 🌿

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ 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 clearly and accurately summarizes the main change: refactoring the API to use 'scope' instead of 'group_id' for state management, which matches the primary objective of aligning with the iii engine's state module API.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/states

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

@andersonleal andersonleal merged commit 84b0a7e into main Feb 16, 2026
1 check passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant