feat: instance groups for organizing related services#739
Open
mathiasbourgoin wants to merge 10 commits intomainfrom
Open
feat: instance groups for organizing related services#739mathiasbourgoin wants to merge 10 commits intomainfrom
mathiasbourgoin wants to merge 10 commits intomainfrom
Conversation
5bbb94c to
abf124b
Compare
Introduce the concept of instance groups — logical deployments that tie related services (node, baker, accuser, DAL) together with shared config (network, binary version, service user). - Add Group type with JSON serialization (src/group.ml) - Add Group_registry for CRUD operations (src/group_registry.ml) - Add `group` field to Service.t (backward-compatible, defaults to None) - Add `octez-manager group` CLI subcommand with create/list/show/delete/ add/remove/start/stop/restart/upgrade operations - Add group lifecycle functions to Lifecycle module (start_group, stop_group, restart_group with dependency ordering) - Add 15 unit tests for Group type, registry, and Service.group field Implements #335 (phases 1 and 3). Co-Authored-By: Claude <noreply@anthropic.com>
Add a group-based layout mode to the instances page that organizes services by their instance group. Users can toggle between group view and the existing role-based flat view with 'g'/'G' keys. - Add view_mode (Group/Role) to instances state with group folding - Add group_by_group layout that distributes groups across columns - Add group header rendering with name, network, and binary version - Add group actions modal (start/stop/restart all, add/remove service) - Add "Create Group" option (index 0) to the create menu - Handle 'g'/'G' key toggle between group and role views - Update navigation and render tests for new group-aware layout Implements #335 (phase 2). Co-Authored-By: Claude <noreply@anthropic.com>
Add an optional Group field to all install forms (node, baker, accuser, DAL node, signatory) allowing users to assign services to instance groups at creation time. - Add `group` to core_service_config in form_builder_common - Add group_field bundle with modal selection of existing groups - Add group field to all 5 install forms (read-only in edit mode) - Set group on service post-install via registry update - Update golden path test field counts (+1 down for each form) and menu indices (+1 for "Create Group" at position 0) Implements #335 (phase 4). Co-Authored-By: Claude <noreply@anthropic.com>
Regenerate bash and zsh completions to include the new `group` subcommand and its options. Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Three integration tests covering group CRUD operations: - 54: create, list, show (text + JSON), delete - 55: add/remove service to/from group, verify registry - 56: multiple groups on same network coexist independently Add group category to run-tests.sh and shard manifest (shard-1). Co-Authored-By: Claude <noreply@anthropic.com>
Add "Add to Group" and "Remove from Group" actions to the instance actions modal. "Add to Group" shows existing groups + "Create New Group" option that opens a validated text input prefixed with the network name. Remove the "Create Group" stub from the create menu since groups are now created contextually from instances. Co-Authored-By: Claude <noreply@anthropic.com>
current_service was indexing into the flat service list regardless of view mode. In group view, the display order differs (grouped first, then ungrouped), so the cursor mapped to the wrong service. Add display_ordered_services that computes the correct flat order based on view_mode, and use it in current_service. Co-Authored-By: Claude <noreply@anthropic.com>
- 57: network mismatch rejection on group add - 58: path traversal and invalid group name validation - 59: delete --cascade/--ungroup mutual exclusion and --ungroup behavior Co-Authored-By: Claude <noreply@anthropic.com>
abf124b to
7aa025a
Compare
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.
Summary
Implements instance groups (#335) — logical deployments that tie related services together with shared configuration (network, binary version, service user).
Group.ttype with JSON serialization,Group_registryfor CRUD with path traversal protection,groupfield onService.t(backward-compatible, defaults toNone)om group create/list/show/delete/add/remove/start/stop/restart/upgradesubcommand with network validation onaddand--cascade/--ungroupmutual exclusion ondeletegkey) with collapsible group headers showing name, network, and binary versionstart_group/stop_group/restart_groupwith dependency ordering (node first on start, last on stop)set_service_grouphelper eliminates duplication.groupsubcommandCode quality (from self-review)
Group_registryviais_safe_namevalidationString.equal,Option.equal, pattern matching)include Helperstoopen Helpersinlifecycle.mldelete --cascadesorts services by reverse role order (dependents first)sections_for_view(delegates toInstances_layout.sections_of_state)group_foldedfield from state typedisplay_ordered_servicesproperly sorts by role within groupsAlso fixes pre-existing Yojson
Tuple/Variantexhaustiveness warnings infoldable_json.mlandjson_highlighter.ml.Closes #335
Test plan
dune exec test/test_group.exe)dune runtest)54-group-create-list-show-delete: CRUD operations55-group-add-remove-service: add/remove service to/from group, verify registry56-group-multiple-groups: two groups on same network coexist independently57-group-add-network-mismatch: rejects adding service on wrong network58-group-name-validation: rejects path traversal and invalid characters59-group-delete-cascade-ungroup:--cascade/--ungroupmutual exclusion and behavior