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

add POST /escalation public API endpoint + add public API docs for teams/organization endpoints #4815

Merged
merged 11 commits into from
Aug 15, 2024

Conversation

joeyorlando
Copy link
Contributor

@joeyorlando joeyorlando commented Aug 13, 2024

What this PR does

  • Adds a POST /escalation public endpoint (equivalent to the internal direct paging API endpoint)
  • Adds public API documentation for teams and organization endpoints
Screenshot 2024-08-15 at 12 49 40

Which issue(s) this PR closes

Closes https://github.com/grafana/oncall-private/issues/2859
Closes #2448

Checklist

  • Unit, integration, and e2e (if applicable) tests updated
  • Documentation added (or pr:no public docs PR label added if not required)
  • Added the relevant release notes label (see labels prefixed w/ release:). These labels dictate how your PR will
    show up in the autogenerated release notes.

@joeyorlando joeyorlando marked this pull request as ready for review August 15, 2024 17:02
@joeyorlando joeyorlando requested a review from a team as a code owner August 15, 2024 17:02
@joeyorlando joeyorlando requested review from a team August 15, 2024 17:02
@joeyorlando joeyorlando added the release:enhancement PR will be added to "Exciting New Features 🎉" section of release notes label Aug 15, 2024

if alert_group_id and (title or message or source_url or grafana_incident_id):
raise serializers.ValidationError(
"alert_group_id and (title, message, source_url, grafana_incident_id) are mutually exclusive"
f"alert_group_id and (title, message, source_url{', grafana_incident_id' if self.ALLOWS_GRAFANA_INCIDENT_ID else ''}) "
"are mutually exclusive"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is here because the grafana_incident_id is really only a concept that is relevant for the internal API (you cannot specify this attribute from the public API)

Comment on lines +64 to +65
if attrs["users"] and attrs["team"]:
raise serializers.ValidationError("users and team are mutually exclusive")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is already the case if you perform this workflow from Slack or the web plugin UI, you cannot specify users and a team, we just weren't previously validating the payload for it. Added test cases for this:

@joeyorlando joeyorlando changed the title add direct paging public API endpoint add direct paging public API endpoint + add public API docs for teams/organization endpoints Aug 15, 2024
@joeyorlando joeyorlando changed the title add direct paging public API endpoint + add public API docs for teams/organization endpoints add POST /escalation public API endpoint + add public API docs for teams/organization endpoints Aug 15, 2024
@joeyorlando joeyorlando changed the title add POST /escalation public API endpoint + add public API docs for teams/organization endpoints add POST /escalation public API endpoint + add public API docs for teams/organization endpoints Aug 15, 2024
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@joeyorlando joeyorlando requested a review from matiasb August 15, 2024 18:16
Copy link
Contributor

@matiasb matiasb left a comment

Choose a reason for hiding this comment

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

LGTM

@joeyorlando joeyorlando enabled auto-merge August 15, 2024 18:22
@joeyorlando joeyorlando added this pull request to the merge queue Aug 15, 2024
Merged via the queue into dev with commit 67fc52d Aug 15, 2024
21 checks passed
@joeyorlando joeyorlando deleted the jorlando/add-direct-paging-public-api-endpoint branch August 15, 2024 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:enhancement PR will be added to "Exciting New Features 🎉" section of release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add public documentation for organizations and teams public API endpoints
2 participants