Skip to content

Commit 2421cdd

Browse files
authored
ref(integration-platform): Add URI formatting guidelines to docs (#5103)
This PR adds a blurb explaining the URI formatting guidelines for the schema they provide when specifying UI Components. Each instance of a URI attribute links back to these guidelines.
1 parent 45bc4a3 commit 2421cdd

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

src/docs/product/integrations/integration-platform/ui-components/alert-rule-action.mdx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ The alert rule action component gives you to access to parameters to define rout
3333
## Attributes
3434

3535
- `title` - (Required) The title shown in the UI component.
36-
- `uri` - (Required) Sentry will make a POST request to the URI when the User submits the form. If the services fails to process the request (status code >= 400), this component will bubble up the error to the User with the provided response text.
36+
- `uri` - (Required) Sentry will make a POST request to the URI when the User submits the form. If the services fails to process the request (status code >= 400), this component will bubble up the error to the User with the provided response text. Check out our [URI Guidelines](/product/integrations/integration-platform/ui-components/#uri-guidelines) documentation for formatting help.
3737
- `required_fields` - (Required) List of [FormField](/product/integrations/integration-platform/ui-components/formfield) components the User is required to complete.
3838
- `optional_fields` - (Optional) List of [FormField](/product/integrations/integration-platform/ui-components/formfield) components the User may complete.
3939
- `description` - (Optional) Text that will be displayed above the form. Limited to 140 characters.
@@ -69,7 +69,6 @@ The alert rule action component gives you to access to parameters to define rout
6969
}
7070
```
7171

72-
7372
## Issue Alert Request Format
7473

7574
When an issue alert fires, your service will need to read the settings from the alert payload. The `settings` are in `data.issue_alert.settings`. Check out the full [Issue Alert webhook documentation](/product/integrations/integration-platform/webhooks/issue-alerts) for more information.
@@ -141,7 +140,7 @@ When a metric alert fires, your service will need to read the settings from the
141140
If a user setting up an alert rule action with your app tries to save an incorrect or malformed configuration, you can surface the errors to them directly in [sentry.io](https://sentry.io) by responding to the POST request with a JSON response in this shape:
142141

143142
```json
144-
{"message": "Channel no longer exists!"}
143+
{ "message": "Channel no longer exists!" }
145144
```
146145

147146
Alternately, if an error code (40x, 50x) is returned, we will show a generic error message. If an error occurs, the user will not be able to save the alert rule.

src/docs/product/integrations/integration-platform/ui-components/formfield.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ The [issue linking](/product/integrations/integration-platform/ui-components/iss
6969

7070
- `label` - (Required) Label text to be rendered for the form field
7171
- `name` - (Required) Value to use in `name` attribute of the field
72-
- `uri` - (Required if developer doesn't provide `options`) URI to retrieve values from.
72+
- `uri` - (Required if developer doesn't provide `options`) URI to retrieve values from. Check out our [URI Guidelines](/product/integrations/integration-platform/ui-components/#uri-guidelines) documentation for formatting help.
7373
- `async` - (Optional) Used only if `uri` is present. If true (default), will query the URI as the user types, for autocomplete suggestions (see response format below). If false, will query the URI once initially to retrieve all possible options. This request _must_ succeed, and the response _must_ return data in the format Sentry expects, otherwise the entire component won't render.
7474
- `options` - (Required if developer doesn't provide `uri`) Static list of options in the format of [value, label]
7575
- `depends_on` - (Optional) If a field value depends on the value of another field, a request will be made to load those options when the dependent field is set.

src/docs/product/integrations/integration-platform/ui-components/index.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ The UI components are specified in the schema section of the integration details
2727
}
2828
```
2929

30+
### URI Guidelines
31+
32+
The `uri` keys in your schema elements describe the URI path that will receive a request from that UI component. Sentry will append the path in the `uri` field onto the host of your integration's _webhook URL_.
33+
For example, if the webhook URL is `https://example.com/webhook/`, and your schema's `uri` attribute is `/alerts/`, then the integration will receive requests to `https://example.com/alerts/`.
34+
3035
## Error Handling
3136

3237
Component rendering either 100% works or shows nothing. To protect the integration from looking chaotic due to errors we have no control over, if any part of the third-party component rendering fails, nothing will render.

src/docs/product/integrations/integration-platform/ui-components/issue-link.mdx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,10 @@ When an external issue is created or linked in [sentry.io](https://sentry.io), a
3939

4040
## Attributes
4141

42-
- `uri` - (Required) The URI to request when the User submits the Link/Create Issue form.
42+
- `uri` - (Required) The URI to request when the User submits the Link/Create Issue form. Check out our [URI Guidelines](/product/integrations/integration-platform/ui-components/#uri-guidelines) documentation for formatting help.
4343
- `required_fields` - (Required) List of [FormField](/product/integrations/integration-platform/ui-components/formfield) components the User is required to complete.
4444
- `optional_fields` - (Optional) List of [FormField](/product/integrations/integration-platform/ui-components/formfield) components the User may complete.
4545

46-
4746
## Example
4847

4948
```json {filename:schema.json}
@@ -86,9 +85,6 @@ When an external issue is created or linked in [sentry.io](https://sentry.io), a
8685
}
8786
```
8887

89-
90-
91-
9288
## Request Format
9389

9490
When a user attempts to create or link an issue, we will send a request to your service based on the provided `uri`. We send a `POST` request, so all the information is stored in the body.

src/docs/product/integrations/integration-platform/ui-components/stacktrace-link.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ This feature allows you to insert a link within a stack trace frame. The link co
2323

2424
## Attributes
2525

26-
- `uri` - (Required) The link destination. Sentry will automatically add the following query params to the link.
27-
- `installationId` - Your integration's installation ID (helps you determine the requesting Sentry org)
28-
- `projectSlug` - slug of the project the issue belongs to
29-
- `filename` - full path of the stack frame file
30-
- `lineNo` - line number of the stack trace in the file
26+
- `uri` - (Required) The link destination. Sentry will automatically add the following query params to the link. Check out our [URI Guidelines](/product/integrations/integration-platform/ui-components/#uri-guidelines) documentation for formatting help.
27+
- `installationId` - Your integration's installation ID (helps you determine the requesting Sentry org)
28+
- `projectSlug` - slug of the project the issue belongs to
29+
- `filename` - full path of the stack frame file
30+
- `lineNo` - line number of the stack trace in the file
3131

3232
## Example
3333

@@ -36,7 +36,7 @@ This feature allows you to insert a link within a stack trace frame. The link co
3636
"elements": [
3737
{
3838
"type": "stacktrace-link",
39-
"uri": "/stacktrace-redirect",
39+
"uri": "/stacktrace-redirect"
4040
}
4141
]
4242
}

0 commit comments

Comments
 (0)