feat(rust-tui): Enable ResourceBehaviour for next services - #1975
Merged
Conversation
`RustResourceBehaviourGenerator` derived the target `components/<service>/` directory straight from the hyphenated metadata service key, so `load-balancer.*` and `block-storage.*` resources resolved to non-existent `components/load-balancer/` and were silently skipped. Normalise the filesystem/module segment to underscores (`service_pascal`, which drives the emitted Rust type names, already handles the hyphen via `get_rust_service_type_from_str`). Add the `filter_type` needed by `generate_behaviour` to the top-level `extensions.rust-tui-view` blocks for identity (group/project/user) and block-storage (backup/snapshot/volume); the filter structs already exist in the tree. No `filter_action_name` is added — those resources have no `handle_set_filter_action` today and the template correctly omits it. load-balancer metadata already carried `filter_type`/`filter_action_name`, so the path fix alone unblocks it. Signed-off-by: Artem Goncharov <artem.goncharov@gmail.com>
| use crate::components::resource_behaviour::GeneratedResourceBehaviour; | ||
| use crate::mode::Mode; | ||
|
|
||
| pub(crate) struct Generated; |
| use crate::components::resource_behaviour::GeneratedResourceBehaviour; | ||
| use crate::mode::Mode; | ||
|
|
||
| pub(crate) struct Generated; |
| use crate::components::resource_behaviour::GeneratedResourceBehaviour; | ||
| use crate::mode::Mode; | ||
|
|
||
| pub(crate) struct Generated; |
| use crate::components::resource_behaviour::GeneratedResourceBehaviour; | ||
| use crate::mode::Mode; | ||
|
|
||
| pub(crate) struct Generated; |
| use crate::components::resource_behaviour::GeneratedResourceBehaviour; | ||
| use crate::mode::Mode; | ||
|
|
||
| pub(crate) struct Generated; |
| use crate::components::resource_behaviour::GeneratedResourceBehaviour; | ||
| use crate::mode::Mode; | ||
|
|
||
| pub(crate) struct Generated; |
| use crate::components::resource_behaviour::GeneratedResourceBehaviour; | ||
| use crate::mode::Mode; | ||
|
|
||
| pub(crate) struct Generated; |
| use crate::components::resource_behaviour::GeneratedResourceBehaviour; | ||
| use crate::mode::Mode; | ||
|
|
||
| pub(crate) struct Generated; |
| use crate::components::resource_behaviour::GeneratedResourceBehaviour; | ||
| use crate::mode::Mode; | ||
|
|
||
| pub(crate) struct Generated; |
| use crate::components::resource_behaviour::GeneratedResourceBehaviour; | ||
| use crate::mode::Mode; | ||
|
|
||
| pub(crate) struct Generated; |
gtema
added a commit
that referenced
this pull request
Sep 3, 2026
PR #1975 added the generated mechanical tier for the identity resources. Thin the hand-written `ResourceBehaviour` impls to one-line forwarders onto `super::generated::<r>::Generated::<method>`, keeping only custom logic: - `users.rs`: `action_to_request` enable/disable toggle, `confirm_request` delete prompt, `filter_carry_action` drilldown into application credentials, `handle_mutation_response`, and the two `TryFrom<&serde_json::Value>` builders. - `projects.rs`: `filter_carry_action` translating `SwitchToProject` into a `CloudChangeScope`. - `groups.rs`: `confirm_request` delete prompt, `filter_carry_action` drilldown into group users, and its two `TryFrom` builders. `group_users.rs` and `application_credentials.rs` are nested resources the generator does not emit and are left untouched. Test title expectations move to the generator's prefix-stripped form ("Users", "Projects", "Groups"). Assisted-By: Claude Sonnet 5 <noreply@anthropic.com> Signed-off-by: Artem Goncharov <artem.goncharov@gmail.com>
This was referenced Sep 3, 2026
Open
gtema
added a commit
that referenced
this pull request
Sep 3, 2026
PR #1975 added the generated mechanical tier for the load_balancer resources but left the hand-written `ResourceBehaviour` impls writing the six derivable methods inline. Thin each hand file to a one-line forwarder onto `super::generated::<r>::Generated::<method>`, keeping only the genuinely custom logic: - `loadbalancers.rs`: dual `filter_carry_action` drilldown into listeners and pools, plus the two `TryFrom<&serde_json::Value>` filter builders. - `pools.rs`: dual `filter_carry_action` drilldown into members and health monitors, plus its two `TryFrom` filter builders. - `listeners.rs` / `health_monitors.rs`: pure forwarders. `pool_members.rs` is a nested resource the generator does not emit and is left untouched. Test title expectations move to the generator's prefix-stripped form ("Load Balancers", "Pools"). Assisted-By: Claude Sonnet 5 <noreply@anthropic.com> Signed-off-by: Artem Goncharov <artem.goncharov@gmail.com>
gtema
added a commit
that referenced
this pull request
Sep 3, 2026
PR #1975 added the generated mechanical tier for the identity resources. Thin the hand-written `ResourceBehaviour` impls to one-line forwarders onto `super::generated::<r>::Generated::<method>`, keeping only custom logic: - `users.rs`: `action_to_request` enable/disable toggle, `confirm_request` delete prompt, `filter_carry_action` drilldown into application credentials, `handle_mutation_response`, and the two `TryFrom<&serde_json::Value>` builders. - `projects.rs`: `filter_carry_action` translating `SwitchToProject` into a `CloudChangeScope`. - `groups.rs`: `confirm_request` delete prompt, `filter_carry_action` drilldown into group users, and its two `TryFrom` builders. `group_users.rs` and `application_credentials.rs` are nested resources the generator does not emit and are left untouched. Test title expectations move to the generator's prefix-stripped form ("Users", "Projects", "Groups"). Assisted-By: Claude Sonnet 5 <noreply@anthropic.com> Signed-off-by: Artem Goncharov <artem.goncharov@gmail.com>
gtema
added a commit
that referenced
this pull request
Sep 3, 2026
PR #1975 added the generated mechanical tier for the identity resources. Thin the hand-written `ResourceBehaviour` impls to one-line forwarders onto `super::generated::<r>::Generated::<method>`, keeping only custom logic: - `users.rs`: `action_to_request` enable/disable toggle, `confirm_request` delete prompt, `filter_carry_action` drilldown into application credentials, `handle_mutation_response`, and the two `TryFrom<&serde_json::Value>` builders. - `projects.rs`: `filter_carry_action` translating `SwitchToProject` into a `CloudChangeScope`. - `groups.rs`: `confirm_request` delete prompt, `filter_carry_action` drilldown into group users, and its two `TryFrom` builders. `group_users.rs` and `application_credentials.rs` are nested resources the generator does not emit and are left untouched. Test title expectations move to the generator's prefix-stripped form ("Users", "Projects", "Groups"). Assisted-By: Claude Sonnet 5 <noreply@anthropic.com> Signed-off-by: Artem Goncharov <artem.goncharov@gmail.com>
gtema
added a commit
that referenced
this pull request
Sep 3, 2026
PR #1975 added the generated mechanical tier for the block_storage resources. Thin the hand-written `ResourceBehaviour` impls to one-line forwarders onto `super::generated::<r>::Generated::<method>`, keeping only custom logic: - `volumes.rs`: `confirm_request` delete prompt plus its `TryFrom<&serde_json::Value>` for the delete request builder. - `backups.rs` / `snapshots.rs`: pure forwarders; their `view_key()` now resolves through `crate::mode::BLOCK_STORAGE_*` via the companion instead of a bare string literal. All three resources use the `list_detailed` operation, so the generated tier resolves the `ListDetailed` request variant, matching the prior hand code. Assisted-By: Claude Sonnet 5 <noreply@anthropic.com> Signed-off-by: Artem Goncharov <artem.goncharov@gmail.com>
gtema
added a commit
that referenced
this pull request
Sep 3, 2026
PR #1975 added the generated mechanical tier for the block_storage resources. Thin the hand-written `ResourceBehaviour` impls to one-line forwarders onto `super::generated::<r>::Generated::<method>`, keeping only custom logic: - `volumes.rs`: `confirm_request` delete prompt plus its `TryFrom<&serde_json::Value>` for the delete request builder. - `backups.rs` / `snapshots.rs`: pure forwarders; their `view_key()` now resolves through `crate::mode::BLOCK_STORAGE_*` via the companion instead of a bare string literal. All three resources use the `list_detailed` operation, so the generated tier resolves the `ListDetailed` request variant, matching the prior hand code. Assisted-By: Claude Sonnet 5 <noreply@anthropic.com> Signed-off-by: Artem Goncharov <artem.goncharov@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RustResourceBehaviourGeneratorderived the targetcomponents/<service>/directory straight from the hyphenated metadataservice key, so
load-balancer.*andblock-storage.*resourcesresolved to non-existent
components/load-balancer/and were silentlyskipped. Normalise the filesystem/module segment to underscores
(
service_pascal, which drives the emitted Rust type names, alreadyhandles the hyphen via
get_rust_service_type_from_str).Add the
filter_typeneeded bygenerate_behaviourto the top-levelextensions.rust-tui-viewblocks for identity (group/project/user) andblock-storage (backup/snapshot/volume); the filter structs already exist
in the tree. No
filter_action_nameis added — those resources have nohandle_set_filter_actiontoday and the template correctly omits it.load-balancer metadata already carried
filter_type/filter_action_name, so the path fix alone unblocks it.Signed-off-by: Artem Goncharov artem.goncharov@gmail.com