Skip to content

Add set environment state helper functions - #2104

Open
geofflamrock wants to merge 1 commit into
mainfrom
geoffl/claude/bmbb-666/wrapper-environment-state-82e60b
Open

Add set environment state helper functions#2104
geofflamrock wants to merge 1 commit into
mainfrom
geoffl/claude/bmbb-666/wrapper-environment-state-82e60b

Conversation

@geofflamrock

@geofflamrock geofflamrock commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Context

We are adding support for setting environment state within a deployment/runbook run. State will be persisted across deployments for the project/environment/(tenant) and will primarily be used across provisioning, deployment and deprovisioning of ephemeral environments.

State will be set using a new service message in the format `set-environmentstate -key "{key}" -value "{value}" -sensitive "{sensitive}" -type "{type}".

Different types of state will be supported:

  • State: General state to be persisted.
  • Url: Url to be associated and shown with the environment.

Changes

Adds helper functions to PowerShell and Bash for setting environment state, mirroring the functions for setting output variables.

  • PowerShell: Set-EnvironmentState -Key {key} -Value {value} -Sensitive.
  • Bash: set_environmentstate {key} {value} [-sensitive].

These functions only support setting general state and don't allow to send the type, we'll be adding more functions for URLs separately.

Reviewing and testing

Automated tests have been added, we'll need to pair and test this with the work in Octopus Server to handle service messages.

@geofflamrock geofflamrock changed the title BMBB-666: Add Set-EnvironmentState/set_environmentstate wrapper functions Add set environment state wrapper functions Aug 5, 2026
@geofflamrock geofflamrock changed the title Add set environment state wrapper functions Add set environment state helper functions Aug 5, 2026
…ions

Add PowerShell and Bash wrapper functions that emit the new
set-environmentstate service message (key/value/sensitive/type),
mirroring the existing Set-OctopusVariable/set_octopusvariable
conventions. Type is fixed to "State" for this function.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@geofflamrock
geofflamrock force-pushed the geoffl/claude/bmbb-666/wrapper-environment-state-82e60b branch from 20b14aa to e7c6538 Compare August 5, 2026 07:18
@geofflamrock
geofflamrock marked this pull request as ready for review August 5, 2026 07:38

@yangguoif yangguoif left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 woohoo, looks great!

Just need to note that we probably want to hold off the merge / publish until the change in Octopus server is rolled out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants