-
Notifications
You must be signed in to change notification settings - Fork 503
Mattc/blue green #1629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mattc/blue green #1629
Conversation
|
Start Hyponome locally |
There was a problem hiding this 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
SequentialDeployto 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
$blueLatestDeploymentis misleading since it contains an array of deployments, not a single deployment. Consider renaming to$blueDeploymentsfor clarity. The same applies to$greenLatestDeployment.
{
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this 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
.Lengthproperty 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).Countinstead to ensure consistent behavior.
{
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
harrisonmeister
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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
Idshould be a GUID that is not00000000-0000-0000-0000-000000000000Idproperty (updating theIdwill break the Library sync functionality in Octopus).Versionshould be incremented, otherwise the integration with Octopus won't update the step template correctly$LastModifiedByfield must be present, and (optionally) updated with the correct authorCategoryhas been created:{categoryname}.pngmust be present under thestep-templates/logosfolderswitchin thehumanizefunction ingulpfile.babel.jsmust have acasestatement corresponding to itFixes # . If there is an open issue that this PR fixes add it here, otherwise just remove this line