Skip to content
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

Load and transform Opsgenie escalation policies #20

Merged
merged 2 commits into from
Apr 25, 2024

Conversation

AlexisJasso
Copy link
Contributor

https://firehydrant.atlassian.net/browse/PDE-1847

Wow it was a road getting here. Some salient decisions made when creating this (there are code comments for these also):

  • Our targets for escalation policy steps don't map well to most of the target types for Opsgenie escalation policy steps. For some of those types, we've simply dropped them an logged to the console that we're doing so. For escalating to a schedule specifically, we're targeting all FH schedules (which are actually OG rotations) that were created from the OG schedule, which might be awkward if that separation changed the semantics here enough.
  • OG tracks a delay (starting from esc policy start) before an escalation policy step starts, where FH uses a timeout on the previous step before the next step begins. Also, OG allows delay times on the order of hours, days, weeks, or months (!?), where FH only allows minutes. We've locked in a minimum of 1min and a max of 60min for the resulting FH steps, but anyone using an escalation policy step on a different order of magnitude almost certainly has a different semantic meaning there and this should be viewed with suspicion. As above, we log to the console when doing this, and can tag this for future work to insert comments into the tf file or something else as we choose.
  • A query was added to get schedules where the schedule ID is LIKE ?. This is to support the fan out mentioned above and can be used for Pagerduty schedule layers also.

@AlexisJasso AlexisJasso requested review from wilsonehusin and a team April 25, 2024 19:48
Copy link
Member

@wilsonehusin wilsonehusin left a comment

Choose a reason for hiding this comment

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

good stuff -- thank you AJ! some questions and should be ok to merge after they're addressed

Copy link
Member

Choose a reason for hiding this comment

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

is this correct? seems like the test reveals that the query returns none?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Heh. I missed this is the flurry of generating files. The test runs LoadTeamMembers() without any users or teams so... yeah, null.

Updating this test to run LoadUser() and LoadTeams() first and then I'll get the correct golden file in here.

store/queries.sql Outdated Show resolved Hide resolved
@AlexisJasso AlexisJasso merged commit b74e1f5 into main Apr 25, 2024
4 checks passed
@AlexisJasso AlexisJasso deleted the opsgenie_escalation_policies branch April 25, 2024 22:38
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