Skip to content

Conversation

@Sam-Kudo
Copy link
Contributor

@Sam-Kudo Sam-Kudo commented Feb 17, 2025

Background

While setting up a new runbook that utilised the statuspage Incident creation template, I ran into a recurring 422 error with the POST request to the StatusPage API for creating an In-Progress incident. This was an error that required modifying the underlying powershell script to alleviate.
The problem:

  • the timestamp for Incident scheduled-for and Incident scheduled-until fields were identical, causing the body of the POST request to be improperly formed.
  • I speculate that StatusPage.io has updated it's protocols at some point in the last 8 years to begin caring about the validity of incident schedule timings, and so now rejects API requests where incident schedule time was invalid, breaking the previously-working template

The fix:

  • Updated the scheduled-until time to be 1 day after the scheduled-for time.

Results

This template runs smooth as butter right out of the box now. No more entity processing errors.

Before

Running the create incident script returned only
image

After

image

Pre-requisites

  • [x ] 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).
  • [ x] Version should be incremented, otherwise the integration with Octopus won't update the step template correctly
  • [x ] Parameter names should not start with $
  • [x ] 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).
  • [x ] LastModifiedBy field must be present, and (optionally) updated with the correct author
  • [x ] 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

@CLAassistant
Copy link

CLAassistant commented Feb 17, 2025

CLA assistant check
All committers have signed the CLA.

@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

@Sam-Kudo Sam-Kudo marked this pull request as ready for review February 17, 2025 04:53
Copy link
Contributor

@hnrkndrssn hnrkndrssn left a comment

Choose a reason for hiding this comment

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

Looks good 👍

@Sam-Kudo thanks for finding and fixing this bug!

I had a look at the StatusPage API docs and there's no mention of any sort of validation on that endpoint so who knows when/how this validation changed 🤷

@hnrkndrssn hnrkndrssn merged commit 3a09940 into OctopusDeploy:master Feb 18, 2025
2 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.

3 participants