Skip to content

feat(rust-tui): Enable ResourceBehaviour for next services - #1975

Merged
gtema merged 1 commit into
mainfrom
codegenerator_1003750
Sep 3, 2026
Merged

feat(rust-tui): Enable ResourceBehaviour for next services#1975
gtema merged 1 commit into
mainfrom
codegenerator_1003750

Conversation

@gtema

@gtema gtema commented Sep 3, 2026

Copy link
Copy Markdown
Owner

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

`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
gtema merged commit a98eca5 into main Sep 3, 2026
19 checks passed
@gtema
gtema deleted the codegenerator_1003750 branch September 3, 2026 15:41
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-release-plz gtema-release-plz Bot mentioned this pull request Sep 3, 2026
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>
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