Add set environment state helper functions - #2104
Open
geofflamrock wants to merge 1 commit into
Open
Conversation
…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
force-pushed
the
geoffl/claude/bmbb-666/wrapper-environment-state-82e60b
branch
from
August 5, 2026 07:18
20b14aa to
e7c6538
Compare
geofflamrock
marked this pull request as ready for review
August 5, 2026 07:38
yangguoif
approved these changes
Aug 5, 2026
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.
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.
Set-EnvironmentState -Key {key} -Value {value} -Sensitive.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.