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

fix: Support the From header when snoozing an incident #541

Merged
merged 1 commit into from
Jan 6, 2025

Conversation

adamdecaf
Copy link
Contributor

@adamdecaf adamdecaf commented Oct 4, 2024

@adamdecaf adamdecaf force-pushed the snooze-requires-from branch from 9bce536 to 54f28f1 Compare October 4, 2024 20:59
@adamdecaf
Copy link
Contributor Author

This is a breaking change but the snooze calls don't work currently, so they're already broken.

@adamdecaf
Copy link
Contributor Author

cc @ChuckCrawford @imjaroiswebdev

incident.go Outdated Show resolved Hide resolved
incident.go Outdated Show resolved Hide resolved
Copy link

@ChezCrawford ChezCrawford left a comment

Choose a reason for hiding this comment

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

If you don't mind addressing the tiny comments I would be happy to get this merged.

incident_test.go Show resolved Hide resolved
@adamdecaf adamdecaf force-pushed the snooze-requires-from branch from 54f28f1 to fdfbb0a Compare January 2, 2025 19:41
@adamdecaf
Copy link
Contributor Author

@ChezCrawford thanks - should be g2g now

@ChezCrawford
Copy link

ChezCrawford commented Jan 2, 2025

Ahhh. As I am coming out of my holiday-vacation-fog I am realizing that this is actually a breaking change for some users. The From header is only required when using an Account API Key or an App OAuth Token. Clients authenticating with User API Keys are currently able to use this function without issue.

If we are going to make a breaking change here I am tempted to ask that we do this the right way by adding a SnoozeIncidentOptions struct with From and Duration fields. Let me brood on this until I am back at work.

@adamdecaf
Copy link
Contributor Author

I can make that change to use a struct. Yes, it's breaking but for me Snooze wasn't even working without this.

@ChezCrawford
Copy link

Yes, it's breaking but for me Snooze wasn't even working without this.

You are likely using one of the two types of tokens I mentioned above. I did verify that it works correctly with User API Keys right now.

I can make that change to use a struct.

I think that is the best move here. If we are going to make a breaking change let's change it to the "correct" thing that will work properly for everyone.

The API docs list From as a reqired header, but the From header is
only required when using an Account API Key or an App OAuth Token.

https://developer.pagerduty.com/api-reference/fc871396fb23f-snooze-an-incident#request-headers
@adamdecaf adamdecaf force-pushed the snooze-requires-from branch from fdfbb0a to 430090a Compare January 3, 2025 17:13
@adamdecaf
Copy link
Contributor Author

Updated the PR. Thanks for helping get this merged.

@ChuckCrawford ChuckCrawford changed the title fix: require From when snoozing an incident fix: Support the From header when snoozing an incident Jan 6, 2025
@ChuckCrawford ChuckCrawford added this to the v1.9.0 milestone Jan 6, 2025
Copy link
Collaborator

@ChuckCrawford ChuckCrawford left a comment

Choose a reason for hiding this comment

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

Note that this PR makes a breaking change in order to add support for the snooze incident API with Account API Keys and App Tokens.

@ChuckCrawford ChuckCrawford merged commit f29b507 into PagerDuty:main Jan 6, 2025
1 check passed
@adamdecaf adamdecaf deleted the snooze-requires-from branch January 6, 2025 16:42
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