Skip to content

make rvn-stack workspace settings immutable#65

Merged
flybayer merged 2 commits into
mainfrom
bb-stackfix
Jul 15, 2026
Merged

make rvn-stack workspace settings immutable#65
flybayer merged 2 commits into
mainfrom
bb-stackfix

Conversation

@flybayer

@flybayer flybayer commented Jul 15, 2026

Copy link
Copy Markdown
Member

Greptile Summary

This PR marks two Terraform state backend workspace settings — use_ravion_state_backend and ravion_state_backend_workspace — as immutable: true in the rvn-stack-definition.yml module definition, preventing users from changing the state backend configuration after a stack is initially created.

  • use_ravion_state_backend (boolean, default true) is now locked at creation time, preventing any switch between Ravion-managed state and a self-managed backend after deployment.
  • ravion_state_backend_workspace (string, optional, no default in YAML) is also locked; since the field is only visible when use_ravion_state_backend is true, it must be set during initial configuration or it will remain unset permanently.

Confidence Score: 4/5

Safe to merge with a minor clarification needed: the optional workspace name field can be permanently left unset once immutability is enforced.

The change is minimal and intentional — locking the Terraform state backend settings prevents dangerous mid-lifecycle state migrations. The only concern is that ravion_state_backend_workspace, being optional and shown only conditionally, could end up permanently unset if a user skips it at creation time. Whether this is acceptable depends on how the platform handles the absence of this field at runtime.

stack/terraform/rvn-stack-definition.yml — specifically the interaction between immutable: true and the optionality of ravion_state_backend_workspace.

Important Files Changed

Filename Overview
stack/terraform/rvn-stack-definition.yml Adds immutable: true to use_ravion_state_backend and ravion_state_backend_workspace workspace settings to prevent changes after initial configuration.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[User creates stack] --> B{use_ravion_state_backend?}
    B -- "true (default)" --> C[Ravion manages state backend]
    B -- "false" --> D[User manages own backend]
    C --> E{ravion_state_backend_workspace set?}
    E -- "yes" --> F[Use custom workspace name]
    E -- "no" --> G[Use default: project+env+module ids]
    F --> H[🔒 immutable: true — cannot change]
    G --> H
    D --> I[🔒 immutable: true — cannot change]
    C --> I2[🔒 immutable: true — cannot change]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[User creates stack] --> B{use_ravion_state_backend?}
    B -- "true (default)" --> C[Ravion manages state backend]
    B -- "false" --> D[User manages own backend]
    C --> E{ravion_state_backend_workspace set?}
    E -- "yes" --> F[Use custom workspace name]
    E -- "no" --> G[Use default: project+env+module ids]
    F --> H[🔒 immutable: true — cannot change]
    G --> H
    D --> I[🔒 immutable: true — cannot change]
    C --> I2[🔒 immutable: true — cannot change]
Loading
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
stack/terraform/rvn-stack-definition.yml:123-130
**Immutable optional field may be permanently unset**

`ravion_state_backend_workspace` has no `required: true` and no `default` value set in the YAML. Once it is marked `immutable: true`, a user who skips setting this field during initial stack creation can never populate it afterward. This is likely intentional since the system resolves it to `project + environment + module` IDs at runtime, but it is worth verifying that the immutability guard is only applied after the field has been given an opportunity to be set (i.e., when `use_ravion_state_backend` is `true` and the form is visible).

Reviews (1): Last reviewed commit: "make rvn-stack workspace settings immuta..." | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown

Ravion Module Publish Plan

Dry run only. No Ravion API mutations were made.

Module Current Version New Version Description
rvn-stack 1.2.3 1.2.4 Make the stack backend settings immutable

Diffs

rvn-stack 1.2.3 -> 1.2.4

--- remote
+++ compiled
   - default: true
     description: Use Ravion-managed state. Your Terraform configuration must include an empty `terraform { cloud {} }` block; Ravion supplies the workspace configuration. Disable to use your own backend, including S3 or Terraform Cloud.
     id: use_ravion_state_backend
+    immutable: true
     label: Use Ravion for your Terraform state
     type: boolean
   - collapsible: true
     description: Override Terraform state backend workspace name. Defaults to project + environment + module given ids.
     id: ravion_state_backend_workspace
+    immutable: true
     label: Ravion Terraform workspace name
     show_when:
       use_ravion_state_backend: true

Comment thread stack/terraform/rvn-stack-definition.yml
@flybayer
flybayer merged commit a009b45 into main Jul 15, 2026
6 checks passed
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.

1 participant