feat: Generate mode/action/app wiring per resource - #1897
Merged
Conversation
mode.rs/action.rs/app.rs stayed 100% hand-synced across ~30 TUI resources with no cross-check, and cloud_worker generation never touched them. These files are also shared across all services and hand-edited, so a full-file overwrite would destroy other resources' content. Add RustTuiViewGenerator, driven by a new opt-in extensions.rust-tui-view metadata block per resource, patching only that resource's marker-delimited region via the new BaseGenerator._patch_marker_region/generate_view helpers. Resources without the extension are left untouched, so migration is incremental. Piloted and rolled out for all of network's migrated resources; regenerated files matched the hand-written originals byte-for-byte (mode.rs/action.rs) or by an expected rustfmt line-wrap (app.rs), and reruns are idempotent. CI: rust-tui-view reads existing files to find markers, unlike every other target which only writes new ones, so the generation step needs the target repo's current content before it runs, not after. Add a pre-step in playbooks/rust/all.yaml seeding wrk/rust/openstack_tui from a scratch checkout, and wire rust-tui-view into network's target list in zuul.d/rust.yaml (the only service with opted-in resources so far). Changes are triggered by https://review.opendev.org/c/openstack/codegenerator/+/998982 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.
mode.rs/action.rs/app.rs stayed 100% hand-synced across ~30 TUI
resources with no cross-check, and cloud_worker generation never
touched them. These files are also shared across all services and
hand-edited, so a full-file overwrite would destroy other
resources' content.
Add RustTuiViewGenerator, driven by a new opt-in
extensions.rust-tui-view metadata block per resource, patching
only that resource's marker-delimited region via the new
BaseGenerator._patch_marker_region/generate_view helpers.
Resources without the extension are left untouched, so migration
is incremental. Piloted and rolled out for all of network's
migrated resources; regenerated files matched the hand-written
originals byte-for-byte (mode.rs/action.rs) or by an expected
rustfmt line-wrap (app.rs), and reruns are idempotent.
CI: rust-tui-view reads existing files to find markers, unlike every
other target which only writes new ones, so the generation step needs
the target repo's current content before it runs, not after. Add a
pre-step in playbooks/rust/all.yaml seeding wrk/rust/openstack_tui from
a scratch checkout, and wire rust-tui-view into network's target list in
zuul.d/rust.yaml (the only service with opted-in resources so far).
Changes are triggered by https://review.opendev.org/c/openstack/codegenerator/+/998982
Signed-off-by: Artem Goncharov artem.goncharov@gmail.com