Repository navigation
feat(config): ruleset-only ct.dynamicGroup for groups ct no longer owns - #203
Merged
Merged
Conversation
ct.dynamicGroup({ group, dynamic }) manages only the dynamic status and ruleset
of an existing group, found in ct's state or the OpenTofu id map. It writes no
state entry and has no delete path. Refused at load alongside ct.group for the
same key or when declared twice.
Also: ct state rm treats id-map groups as not state-only, ct refresh --group
and ct adopt group --with-dynamic accept id-map groups (adopt emits a
ct.dynamicGroup snippet), ct coverage labels them owned elsewhere, and a bare
string group scope that only the id map knows fails with a hint to use
{ group }.
- state rm: read the id map softly so an unreadable map makes the guard stricter instead of skipping it - plan: refuse a ct.dynamicGroup whose key ct's state holds as another type - adopt: no empty block or state write when every id-map group is skipped; say no state was written; warn that --key/--with-member-fields do not apply - coverage: show the owned-elsewhere count per type - share virtualGroupEntry between plan and refresh; apply's event id fallback only for ruleset-only items
Member
Author
|
Review pass (
Not changed:
Verified: |
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.
Closes #202
What
ct.dynamicGroup({ group, dynamic }): a ruleset-only declaration for groups ct no longer owns (e.g. OpenTofu'schurchtools_group).dynamictakes the threect.group({ dynamic })forms (reusesdesugarDynamic).ct state list, has no delete path. Dropping it plans as a no-op and writes nothing.ct.group(either order), or declared twice.dynamicfield; fetch-failed degradation, portability and stereotype warnings, status-only flips andapply --refreshare unchanged.Cutover items
{ group: "<key>" }(which resolves through the id map).ct.dynamicGroupkeys do not count as same-config declared groups for scopes.ct state rm: a group key the id map resolves is not state-only; act.dynamicGroupis not a declaration that would recreate the group.ct refresh --groupandct adopt group --with-dynamicaccept id-map groups; adopt then emits act.dynamicGroupsnippet and writes no state entry.--allis unchanged (state only).ct coveragelabels id-map groups "owned elsewhere (id map)".ct.group({ dynamic })is unchanged. Handbook pages updated and re-signed.Tests
tests/dynamic-group.test.tspins the rendered plan (No changes; onedynamicupdate; dropped declaration; unknown key; vanished group; fetch-failed), apply writing no state, the scope hint, the state rm guard, refresh and coverage.format:check,lint,typecheck,test,buildand the docs staleness check pass locally.