Commit graph

33 commits

Author SHA1 Message Date
Matias Bordese
a459d8b031
Add shift swaps API docs (#2784)
API added by https://github.com/grafana/oncall/pull/2775
2023-08-16 14:16:37 -03:00
Joey Orlando
767c5352fa
augment API response pagination attributes (#2471)
# What this PR does

This PR:
- adds a few attributes to paginated API responses
- removes channel filter "send demo alert" internal API endpoint + tests
(this endpoint was marked as deprecated + not consumed by the web UI)

With the new paginated API response schema, the web UI will no longer
need to:
- hardcode `ITEMS_PER_PAGE` for each table
- manually calculate total number of pages

(these two things ☝️ will be done in
https://github.com/grafana/oncall/issues/2476)

For `GET /api/internal/v1/alertgroups` the response will now look like
this:
```diff
{
    "next": <url> | None,
    "previous": <url> | None,
    "results": [],
++  "page_size": <int>
}
```

For all other paginated API responses, the response will now look like:
```diff
{
    "count": <int>,
    "next": <url> | None,
    "previous": <url> | None,
    "results": [],
++  "page_size": <int>,
++  "current_page_number": <int>,
++  "total_pages": <int>
}
```

## TODO
- [x] update public API docs to include these new attributes

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
2023-07-14 11:19:40 -04:00
Jack Baldry
1735db4c3b
Update all links to use docs/reference style (#2456)
# What this PR does

The `docs/reference` shortcode supports contextual destinations and
version inference.

`<ONCALL VERSION>` is inferred to match the version of the documentation
set. For example, the inferred version for the page
/docs/grafana/oncall/latest/get-started/ is "latest". It can also be
overriden using front matter.
Given the same page, but with the additional front matter
`oncall_version: next`, the variable is substituted with "next" rather
than "latest".

Contextual destinations are achieved using repeated labels in the
shortcode inner text. The format is [<LABEL>]: "<PAGE PATH PREFIX> ->
<HUGO REFERENCE>".

- _`<LABEL>`_ matches the reference style link label used in the rest of
the text.
- _`<PAGE PATH PREFIX>`_ is matched against the page during the
production build. If the match is successful, the destination that is
used is _`<HUGO REFERENCE>`_. The first matching prefix is used, not the
longest matching prefix.

## Which issue(s) this PR fixes

- Broken links due to ambiguous relref resolution. Any relref parameter
that does not start with either `/`, `./`, or `../` can resolve
ambiguously and is resulting in broken link behavior on the current
site.
- Broken links in Grafana Cloud. We mount OnCall documentation in
Grafana Cloud. In https://github.com/grafana/website/pull/13872 the
location will become /docs/grafana-cloud/alerting-and-irm/oncall. This
PR is intended to be merged alongside that PR.

---------

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
Co-authored-by: Joey Orlando <joey.orlando@grafana.com>
2023-07-13 14:38:35 +00:00
Yulya Artyukhina
04047c6ebe
Resolution notes endpoint docs (#2404)
# What this PR does
- Add docs for `/resolution_notes` public api endpoint
- Fix resolution notes order to show notes for the newest alert group on
top

## Which issue(s) this PR fixes
https://github.com/grafana/oncall/issues/222

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
2023-06-29 14:08:21 +00:00
Yulya Artyukhina
cef9e0ac79
Fix alerts order in public api (#2402)
# What this PR does
Change alerts order in `/alert` public api endpoint

## Which issue(s) this PR fixes
https://github.com/grafana/oncall/issues/1031

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
2023-06-29 12:52:30 +00:00
Joey Orlando
47042decb7
don't enforce line-length rule for markdownlint for code-blocks or tables (#2145)
# What this PR does

## Which issue(s) this PR fixes

## Checklist

- [ ] Unit, integration, and e2e (if applicable) tests updated
- [ ] Documentation added (or `pr:no public docs` PR label added if not
required)
- [ ] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
2023-06-09 06:57:19 +00:00
Ildar Iskhakov
18763c5073
Fix docs, change team to organization in ratelimits, as previously te… (#2135)
…am was equal to orgamization

# What this PR does

## Which issue(s) this PR fixes

## Checklist

- [ ] Unit, integration, and e2e (if applicable) tests updated
- [ ] Documentation added (or `pr:no public docs` PR label added if not
required)
- [ ] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)

Co-authored-by: Matvey Kukuy <Matvey-Kuk@users.noreply.github.com>
2023-06-08 13:47:13 +00:00
Vadim Stepanov
3ec01c2855
Add inbound email address in integration API (#2113)
# What this PR does

Allows fetching inbound email address for an integration using public
API. There's a new field `inbound_email` that's only defined for inbound
email integration and `null` for any other integration types.

## Which issue(s) this PR fixes

https://github.com/grafana/oncall/issues/1989

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
2023-06-06 13:08:54 +00:00
Joey Orlando
7ed6290d42
public API endpoint to export schedule final shifts (#2047)
# What this PR does

Closes https://github.com/grafana/oncall-private/issues/1632

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
2023-06-05 14:06:10 +00:00
Jack Baldry
d3921a5386
Remove absolute aliases as it can cause unexpected redirects in future versions (#1793)
If a page is removed in a future version, the presence of a "latest"
absolute alias in a previous version can redirect that removed page.

**Notes for reviewer:**
I would like to make similar changes for older, previously published
versions.
I believe you are only publishing documentation on specific tag events
and are not maintaining long lived release branches for backporting
fixes into.
If my understanding is correct, I will make the changes in the website
repository
(https://github.com/grafana/website/tree/master/content/docs/oncall).

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
2023-06-05 09:03:38 +00:00
Matvey Kukuy
e9ae4cc3e9
Docs restructure (#1703)
Restructured docs.

Based on: https://github.com/grafana/oncall-private/issues/1698
2023-05-24 14:11:21 +03:00
Matias Bordese
e404d2f4b6
Update shift API to use a default for interval when missing (#1810)
Fixes #1527.
2023-04-21 19:13:09 +00:00
Vadim Stepanov
bd12d38ee0
Public API: allow null escalation chain when creating routes (#1557)
# What this PR does
Allows passing `null` as a value for `escalation_chain` when creating
routes via the public API.

## Which issue(s) this PR fixes
This is needed to unblock https://github.com/grafana/oncall/pull/1555 +
creating a route without an escalation chain is possible in the web UI,
so this PR makes the public API more consistent with the web UI.

## Checklist

- [x] Tests updated
- [x] Documentation added
- [x] `CHANGELOG.md` updated
2023-03-16 09:40:50 +00:00
Ildar Iskhakov
2e63a9ff08
Jinja2 based routes (#1319)
# What this PR does

This PR adds the new way to set up routes using jinja2 templating
language

<img width="1174" alt="Screenshot 2023-03-06 at 22 11 13"
src="https://user-images.githubusercontent.com/2262529/223134053-69d43c47-bb2a-4790-a16d-767425017a76.png">
<img width="1175" alt="Screenshot 2023-03-06 at 22 11 34"
src="https://user-images.githubusercontent.com/2262529/223134070-1e5ef82f-021c-4d5d-b255-b19bb3445641.png">


## Which issue(s) this PR fixes

## Checklist

- [ ] Tests updated
- [ ] Documentation added
- [ ] `CHANGELOG.md` updated
2023-03-08 16:42:18 +08:00
Innokentii Konstantinov
6a5e75e083
Fix of templates api behaviour for public and private api (#1408)
# What this PR does

This PR fixes templates behaviour for public and private api. It fix
"reset to default" for templates from messaging backends and some minor
bugs. Also added acknowledge signal and source link templates

## Checklist

- [x] Tests updated
- [x] Documentation added
- [x] `CHANGELOG.md` updated
2023-03-01 16:32:15 +08:00
Ildar Iskhakov
335c8fe65b
Optimize alert and alert group public api endpoints, add filter by id (#1274)
# What this PR does

## Which issue(s) this PR fixes

## Checklist

- [ ] Tests updated
- [ ] Documentation added
- [ ] `CHANGELOG.md` updated

---------

Co-authored-by: Joey Orlando <joey.orlando@grafana.com>
2023-02-03 17:05:08 +08:00
Tommy
5bd8fbdef8
Add alert groups state filter (#1133)
# What this PR does
This PR added a new parameter (state) into the alert_group public API to
filter the state of the alert groups

## Which issue(s) this PR fixes
https://github.com/grafana/oncall/issues/684

## Checklist

- [x] Tests updated
- [x] Documentation added
- [x] `CHANGELOG.md` updated

Co-authored-by: Vadim Stepanov <vadimkerr@gmail.com>
2023-01-17 10:28:29 +00:00
Joey Orlando
c08eeb72a3
add precommit rules for markdown/json files (#915)
* add markdownlint precommit steps + fix existing errors

* prettier json linting
2022-12-01 14:26:54 +01:00
Jack Baldry
87d0a50e03
Ensure canonical URLs match the new page locations
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
2022-10-26 12:32:47 -04:00
Jack Baldry
7a22410bf6
Remove grafana-cloud absolute aliases
They will only redirect to oncall docs and not to grafana-cloud docs.
Relative aliases will correctly redirect within the grafana-cloud docs.

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
2022-10-26 12:21:59 -04:00
Jack Baldry
e5513d1275
Fix relref links
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
2022-10-18 14:41:22 -04:00
Joey Orlando
9f3f691ea4
Feat 549 - add telegram permalink to alert groups http response (#551)
* rename AlertGroup.permalink to slack_permalink

* add telegram key to alert_groups permalinks object in public API response
2022-09-28 16:59:57 +02:00
Joey Orlando
e16064c6ba
#539 - add slack permalink to alert group public API response (#543)
* add .python-version to .gitignore

* add .nvmrc to frontend

Also update DEVELOPER.md to mention optionally using nvm

* update DEVELOPER.md to reflect running successfully locally

* markdown autoformatter styling changes

* add slack permalink to alertgroup public api http response

* update changelog

* address PR comments

- rename permalink to permalinks in alert group public api seralizer
- add permalinks property to AlertGroup model
- update public api alert groups test
- update alertgroups public documentation to include permalinks property

* add default DEBUG = True in dev.py settings
2022-09-22 15:17:17 +02:00
Matias Bordese
c8b8449afc Add UNTIL support for shifts recurrence rules 2022-06-28 11:21:36 -03:00
Matias Bordese
817693b1c0 Add hourly support to custom shifts frequency 2022-06-27 17:26:53 -03:00
Jack Baldry
1812b0707f
Merge pull request #59 from grafana/jdb/2022-06-fix-links-from-doc-validator
Fix broken links found by doc-validator
2022-06-14 17:06:16 +01:00
Alyssa Wada
7e51546ce2
Merge branch 'dev' into oss-launch-doc-updates 2022-06-14 08:45:17 -06:00
Jack Baldry
6cf190ce71
Fix more links
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
2022-06-14 14:01:03 +01:00
Innokentii Konstantinov
3a61519c4b Add api key docs 2022-06-14 13:28:22 +04:00
alyssa wada
f1cc392ceb oncall doc updates 2022-06-13 21:21:58 -06:00
Eve Meelan
ba2cf5ee7b Add canonical url 2022-06-13 14:02:31 -07:00
Jack Baldry
95b6ad9f92
Convert front matter to YAML and add current aliases to all pages
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
2022-06-09 10:08:07 +01:00
Michael Derynck
6b40f95033 World, meet OnCall!
Co-authored-by: Eve832 <eve.meelan@grafana.com>
    Co-authored-by: Francisco Montes de Oca <nevermind89x@gmail.com>
    Co-authored-by: Ildar Iskhakov <ildar.iskhakov@grafana.com>
    Co-authored-by: Innokentii Konstantinov <innokenty.konstantinov@grafana.com>
    Co-authored-by: Julia <ferril.darkdiver@gmail.com>
    Co-authored-by: maskin25 <kengurek@gmail.com>
    Co-authored-by: Matias Bordese <mbordese@gmail.com>
    Co-authored-by: Matvey Kukuy <motakuk@gmail.com>
    Co-authored-by: Michael Derynck <michael.derynck@grafana.com>
    Co-authored-by: Richard Hartmann <richih@richih.org>
    Co-authored-by: Robby Milo <robbymilo@fastmail.com>
    Co-authored-by: Timur Olzhabayev <timur.olzhabayev@grafana.com>
    Co-authored-by: Vadim Stepanov <vadimkerr@gmail.com>
    Co-authored-by: Yulia Shanyrova <yulia.shanyrova@grafana.com>
2022-06-03 08:09:47 -06:00