Skip to content

Conversation

@mcasperson
Copy link
Contributor

@mcasperson mcasperson commented Oct 14, 2025

Background

This new step provides a way to check that blue/green deployments alternate between each environment. This is useful when modeling blue/green deployments as two environments where deployments should go from blue->green->blue and so on.

Pre-requisites

  • Id should be a GUID that is not 00000000-0000-0000-0000-000000000000
    • NOTE If you are modifying an existing step template, please make sure that you do not modify the Id property (updating the Id will break the Library sync functionality in Octopus).
  • Version should be incremented, otherwise the integration with Octopus won't update the step template correctly
  • Parameter names should not start with $
  • Step template parameter names (the ones declared in the JSON, not the script body) should be prefixed with a namespace so that they are less likely to clash with other user-defined variables in Octopus (see this issue). For example, use an abbreviated name of the step template or the category of the step template).
  • LastModifiedBy field must be present, and (optionally) updated with the correct author
  • The best practices documented here have been applied
  • If a new Category has been created:
    • An image with the name {categoryname}.png must be present under the step-templates/logos folder
    • The switch in the humanize function in gulpfile.babel.js must have a case statement corresponding to it

Fixes # . If there is an open issue that this PR fixes add it here, otherwise just remove this line

@github-actions
Copy link

Start Hyponome locally

docker pull ghcr.io/hnrkndrssn/hyponome:main
docker run --rm -p 8000:8080 -it ghcr.io/hnrkndrssn/hyponome:main

Review in Hyponome

@mcasperson mcasperson requested a review from Copilot October 14, 2025 06:43
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a new step template for Octopus Deploy that validates blue/green deployment patterns by ensuring deployments alternate between blue and green environments.

  • Adds validation logic to check deployment history and prevent sequential deployments to the same environment
  • Sets an output variable SequentialDeploy to indicate whether the current deployment would break the alternating pattern
  • Provides configurable parameters for API key and environment names
Comments suppressed due to low confidence (2)

step-templates/octopus-blue-green-check.json:1

  • The comment 'Check to make sure targets have been created' is misleading - this code is determining the Octopus server URL, not checking targets. The comment should be updated to reflect the actual purpose.
{

step-templates/octopus-blue-green-check.json:1

  • [nitpick] The variable name $blueLatestDeployment is misleading since it contains an array of deployments, not a single deployment. Consider renaming to $blueDeployments for clarity. The same applies to $greenLatestDeployment.
{

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@mcasperson mcasperson requested a review from Copilot October 14, 2025 06:45
@mcasperson mcasperson enabled auto-merge (squash) October 14, 2025 06:45
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (2)

step-templates/octopus-blue-green-check.json:1

  • The code fetches only 2 deployments but then filters out the current deployment, potentially leaving only 1 or 0 results. This could cause issues when checking for the most recent deployment. Consider increasing the take parameter to 3 or handle the case where filtering returns no results.
{

step-templates/octopus-blue-green-check.json:1

  • Using .Length property on PowerShell objects that might be null or a single object can cause errors. PowerShell collections behave differently when they contain 0, 1, or multiple items. Use @($greenLatestDeployment).Count instead to ensure consistent behavior.
{

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@harrisonmeister harrisonmeister left a comment

Choose a reason for hiding this comment

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

LGTM

@mcasperson mcasperson merged commit 9253f8b into master Oct 14, 2025
2 checks passed
@mcasperson mcasperson deleted the mattc/blue-green branch October 14, 2025 08:53
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.

2 participants