Commit graph

4915 commits

Author SHA1 Message Date
Yulya Artyukhina
3d4ce622cb
Add default service_name label for Alerting integrations (#5373)
# What this PR does
- The `service_name` label will be added to Grafana Alerting integration
when it is created, if it wasn't added by user.
- Adds celery task that should be started manually and will add the
`service_name` dynamic label to all existing Grafana Alerting
integrations.

## Which issue(s) this PR closes

Related to https://github.com/grafana/oncall-private/issues/2975

## 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] 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.

---------

Co-authored-by: Innokentii Konstantinov <innokenty.konstantinov@grafana.com>
2025-01-14 10:02:23 +00:00
Jack Baldry
6e75374229
Use tags only workflow behavior (#5404)
# What this PR does

Without this, the action assumes there is a release branch that a tag is
made on because that is common to most other Grafana repositories. Those
repositories maintain a long-lived release branch to facilitate
backports to documentation and code.

Since grafana/oncall doesn't follow this pattern, it doesn't make sense
to try and discover the matching release branch. That action behavior is
disabled by the `tags_only: true` setting.

## Checklist

- [ ] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] 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.

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
2025-01-08 14:36:01 +00:00
Joey Orlando
be10967883
fix: patch direct paging routes migration (#5401)
## Which issue(s) this PR closes

Patches some issues experienced on dev related to
https://github.com/grafana/oncall/pull/5397. Previous migration was
running into the following:
```bash
File "/usr/local/lib/python3.12/site-packages/pymysql/connections.py", line 775, in _read_packet
    packet.raise_for_error()
File "/usr/local/lib/python3.12/site-packages/pymysql/protocol.py", line 219, in raise_for_error
    err.raise_mysql_exception(self._data)
File "/usr/local/lib/python3.12/site-packages/pymysql/err.py", line 150, in raise_mysql_exception
    raise errorclass(errno, errval)
django.db.utils.OperationalError: (1093, "You can't specify target table 'alerts_channelfilter' for update in FROM clause")
```
2025-01-07 16:50:55 +00:00
Jack Baldry
84c9a0cb0d
Update publishing workflows to use GitHub App authentication (#5399)
# What this PR does

Use a centralized composite action that uses GitHub App authentication
to publish documentation.
The organization secrets used in the current workflows have expired.

## Checklist

- [ ] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] 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.

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
2025-01-07 15:37:20 +00:00
Joey Orlando
872f1e35e1
fix: update direct paging integration non-default route data (#5397)
## Which issue(s) this PR closes

This is a quick db migration follow-up to
https://github.com/grafana/oncall/pull/5382. It's mostly just an
enhancement. Basically #5382 had created a new/non-default route for
each Direct Paging integration. However, I overlooked actually setting
the chatops/escalation chain data for this new route:

![Screenshot 2025-01-06 at 3 55
19 PM](https://github.com/user-attachments/assets/6c9e68c3-64b7-47e2-9de6-34edd151b505)

This PR simply updates the recently created non-default direct paging
integration route, such that, to start, direct paging a team has no
escalation/notification difference whether the user doing the direct
paging sets important = True or False. From here, teams can modify these
routes to their needs (ex. setup and assign different escalation chains
for these different routes).

## Checklist

- [ ] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] 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.
2025-01-06 16:35:39 -05:00
Joey Orlando
2581d642bc
chore: fix migration error 2025-01-06 14:09:50 -05:00
Joey Orlando
152d5f74fc
feat: allow setting direct paging importance for teams (#5379)
## Which issue(s) this PR closes

https://www.loom.com/share/e1858db48e8b4fa99014a997af5e3d5e

Closes https://github.com/grafana/irm/issues/322

## 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] 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.

---------

Co-authored-by: Vadim Stepanov <vadimkerr@gmail.com>
2025-01-06 15:53:13 +00:00
Matias Bordese
f3f7c17f8b
fix: update missing users / empty shifts check (#5322)
Related to https://github.com/grafana/oncall-private/issues/2950

- Represent missing users in schedule events (so they are displayed in
the web UI)
- Fix schedule checks for gaps/empty shifts so they send notifications
2025-01-02 13:50:09 +00:00
github-actions[bot]
678833bb29
Update make docs procedure (#5388)
To test the changes, run the following and browse to URL output by the
script:

```console
git fetch
git checkout origin/update-make-docs
cd docs
make docs
```

---------

Co-authored-by: grafanabot <bot@grafana.com>
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
2024-12-30 10:18:01 +00:00
github-actions[bot]
cea98dc17a
Update make docs procedure (#5383)
To test the changes, run the following and browse to URL output by the
script:

```console
git fetch
git checkout origin/update-make-docs
cd docs
make docs
```

---------

Co-authored-by: grafanabot <bot@grafana.com>
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
2024-12-27 09:08:08 +00:00
Matias Bordese
cc63ec3141
fix: return a throttled response if org is being synced for the first time during auth (#5374)
Related to https://github.com/grafana/oncall-private/issues/2826

When Terraform triggers multiple requests and org needs to be synced in
OnCall, the first request will wait for sync to complete but others will
get an immediate response, before a 403, with these changes a 429
indicating to retry (Terraform
[client](https://github.com/grafana/amixr-api-go-client/blob/main/client.go#L310)
will handle the response and perform a retry).
2024-12-19 11:17:08 +00:00
Joey Orlando
2503eafdc6
chore: add pagerduty migrator test + fix linting (#5378) 2024-12-19 11:03:54 +00:00
Joey Orlando
54ff63a25d
chore: update pagerduty migrator docs 2024-12-18 17:27:36 -05:00
Joey Orlando
62c4e86a59
feat: allow PagerDuty migrator script to migrate data while ignoring users (#5375) 2024-12-18 17:16:47 -05:00
Vadim Stepanov
c36761e345
Inbound email: download from S3 + convert HTML to plaintext (#5348)
# What this PR does

* Make `AmazonSESValidatedInboundWebhookView` able to download emails
from S3 by providing AWS credentials via env variables
* Convert HTML to plaintext when there's only `text/html` available

## Which issue(s) this PR closes

Related to https://github.com/grafana/oncall-private/issues/2905

## 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] 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.
2024-12-18 16:35:44 +00:00
Innokentii Konstantinov
0694fe5572
Fix dynamic label template validation (#5363)
1. Fix https://github.com/grafana/irm/issues/530 - applied same
validation logic as for multi-label extraction template to dynamic
label. Actual fix is here -
https://github.com/grafana/oncall/pull/5363/files#diff-58657df0f1ff9a8578a14504f1c6cfd240e45e084171c5bbeb09d975c3ec72ddR74
2. Some minor refactorings over static/dynamic/integration label naming.
This work should be continued in separate PR.
2024-12-18 04:11:21 +00:00
Matias Bordese
1399ba93df Fix conflict 2024-12-16 15:51:46 -03:00
Matias Bordese
36c1e28b26
Fix merge conflict (#5371)
Co-authored-by: Joey Orlando <joey.orlando@grafana.com>
Co-authored-by: GitHub Actions <actions@github.com>
Co-authored-by: Joey Orlando <joseph.t.orlando@gmail.com>
Co-authored-by: Vadim Stepanov <vadimkerr@gmail.com>
Co-authored-by: Dominik Broj <dominik.broj@grafana.com>
Co-authored-by: Michael Derynck <michael.derynck@grafana.com>
Co-authored-by: Yulya Artyukhina <Ferril.darkdiver@gmail.com>
Co-authored-by: Innokentii Konstantinov <innokenty.konstantinov@grafana.com>
Co-authored-by: Ildar Iskhakov <Ildar.iskhakov@grafana.com>
Co-authored-by: grafana-irm-app[bot] <165293418+grafana-irm-app[bot]@users.noreply.github.com>
Co-authored-by: youve <25477622+youve@users.noreply.github.com>
2024-12-16 18:32:55 +00:00
Matias Bordese
9241881122
Fix merge from main conflict (#5369) 2024-12-16 16:45:59 +00:00
Matias Bordese
d2b4f48150
Merge main to dev (#5368)
Merge main to dev and fix docs lint issues.

---------

Co-authored-by: Joey Orlando <joey.orlando@grafana.com>
Co-authored-by: GitHub Actions <actions@github.com>
Co-authored-by: Joey Orlando <joseph.t.orlando@gmail.com>
Co-authored-by: Vadim Stepanov <vadimkerr@gmail.com>
Co-authored-by: Dominik Broj <dominik.broj@grafana.com>
Co-authored-by: Michael Derynck <michael.derynck@grafana.com>
Co-authored-by: Yulya Artyukhina <Ferril.darkdiver@gmail.com>
Co-authored-by: Innokentii Konstantinov <innokenty.konstantinov@grafana.com>
Co-authored-by: Ildar Iskhakov <Ildar.iskhakov@grafana.com>
Co-authored-by: grafana-irm-app[bot] <165293418+grafana-irm-app[bot]@users.noreply.github.com>
Co-authored-by: youve <25477622+youve@users.noreply.github.com>
2024-12-16 16:01:02 +00:00
Innokentii Konstantinov
ae4ada01a6
Merge pull request #5257 from youve/patch-1
Explain setting the GRAFANA_CLOUD_ONCALL_API_URL
2024-12-16 22:39:38 +08:00
Matias Bordese
6bc7f7af6c
fix: validate grafana URL value during organization auth check (#5365)
Related to https://github.com/grafana/irm/issues/538
2024-12-13 21:11:52 +00:00
Alyssa Wada
a9acc4c5b2
docs: clarify MS Teams connect steps and limitations (#5361)
# What this PR does
Addressing a couple of docs support escalations related to the MS teams
integration.

## Which issue(s) this PR closes

https://github.com/grafana/support-escalations/issues/13489

## 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.
2024-12-12 23:10:30 +00:00
Matias Bordese
132bdf235b
feat: update service account auth not to require rbac enabled org (#5360)
Related to https://github.com/grafana/oncall-private/issues/2826

RBAC enabled or not (OSS or cloud), it is possible to get service
account permissions, enabling perm check (for service account tokens) in
public API.

Also allow empty value for users in sync (instead of returning a 400
response).
2024-12-12 22:11:59 +00:00
grafana-irm-app[bot]
f723d1621e
Merge pull request #5357 from grafana/helm-release/1.13.10
Merge: Release oncall Helm chart 1.13.10
2024-12-11 19:47:53 +00:00
GitHub Actions
c4aaaab0b6 Release oncall Helm chart 1.13.10 2024-12-11 19:47:34 +00:00
Matias Bordese
391cbd03de
Merge pull request #5356 from grafana/dev
v1.13.10
2024-12-11 16:31:09 -03:00
Matias Bordese
b8dc7af14a
fix: remove service account role check on sync requests (#5355)
External service accounts do not have a role set so async triggered
periodic org syncs were rejected. Improving role/perm check in a later
PR instead (restriction wasn't originally there).
2024-12-11 19:08:10 +00:00
Matias Bordese
ec874440ba
chore: update service account token auth organization setup check (#5354)
Ignore setup organization response (for now, since it can return a 400
when a sync is/was recently in progress) and base response on
organization being available or not instead.
2024-12-11 14:50:49 +00:00
Matias Bordese
59f531e967
chore: update public API docs authentication and perms (#5349)
Related to https://github.com/grafana/oncall-private/issues/2826
2024-12-11 11:54:00 +00:00
grafana-irm-app[bot]
75129401d8
Merge pull request #5345 from grafana/helm-release/1.13.9
Merge: Release oncall Helm chart 1.13.9
2024-12-06 20:18:41 +00:00
GitHub Actions
16c05bc842 Release oncall Helm chart 1.13.9 2024-12-06 20:18:17 +00:00
Joey Orlando
b09b069f70
v1.13.9 2024-12-06 15:02:08 -05:00
Joey Orlando
33913c5c58
chore: fix migration linter issue (#5342) 2024-12-06 14:59:20 -05:00
Joey Orlando
a8e3fddc56
v1.13.9 2024-12-06 14:32:55 -05:00
Joey Orlando
dd2393165d
chore: remove SlackMessage._channel_id and SlackMessage.organization fields (#5340)
# What this PR does

Follow-up cleanup PR for https://github.com/grafana/oncall/pull/5325
(and https://github.com/grafana/oncall/pull/5330)

## 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] 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.
2024-12-06 13:49:24 -05:00
grafana-irm-app[bot]
8aad9129ed
Merge pull request #5339 from grafana/helm-release/1.13.8
Merge: Release oncall Helm chart 1.13.8
2024-12-06 17:01:28 +00:00
GitHub Actions
63a4dfd662 Release oncall Helm chart 1.13.8 2024-12-06 17:00:59 +00:00
Joey Orlando
73a0a01715
v1.13.8 2024-12-06 11:45:04 -05:00
Joey Orlando
e115617528
chore: drop usage of SlackMessage.organization + drop orphaned SlackMessages (#5330)
# What this PR does

- Stops writing `SlackMessage.organization` + removes references to this
field. [As we
discussed](https://raintank-corp.slack.com/archives/C083TU81TCH/p1733315887463279?thread_ts=1733311105.095309&cid=C083TU81TCH),
we do not need this field on this model/table,
`SlackMessage._slack_team_identity` is sufficient (`organization` will
be dropped in a separate PR)
- Adds a data migration script which:
- drops orphaned `SlackMessage` records; ie. ones which, even after the
[`engine/apps/slack/migrations/0007_migrate_slackmessage_channel_id.py`](https://github.com/grafana/oncall/blob/dev/engine/apps/slack/migrations/0007_migrate_slackmessage_channel_id.py)
migration, still don't have a `SlackMessage.channel` id filled in (we
discussed + agreed on dropping these records
[here](https://raintank-corp.slack.com/archives/C083TU81TCH/p1733329914516859?thread_ts=1733311105.095309&cid=C083TU81TCH))
- fills in empty `SlackMessage.slack_team_identity` values (from
`slack_message.channel.slack_team_identity`)

### Other notes

On the `organization` topic.

We store records in `SlackMessage` for two purposes (AFAICT), and in
both cases, we have references back to the `organization`:
- alert groups - `slack_message.alert_group.channel.organization`
- shift swap requests - `shift_swap_request.schedule.organization`

## 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] 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.
2024-12-06 11:43:40 -05:00
Joey Orlando
3977c6e9ef
chore: remove references to SlackMessage._channel_id (#5325)
# What this PR does

- As a follow-up to https://github.com/grafana/oncall/pull/5292, and now
that `SlackMessage.channel` has been migrated via
[`engine/apps/slack/migrations/0007_migrate_slackmessage_channel_id.py`](https://github.com/grafana/oncall/pull/5292/files#diff-8aebe133401715a4262baad9b2c5c9fc59367c18d6bd6ac2b3c462fcdabafd66),
this PR removes reads/writes from `SlackMessage._channel_id` to
`SlackMessage.channel`. In a separate PR I will focus on dropping that
column from the model/db.
- Drops `SlackMessage.active_update_task_id`. There're zero references
to this column in the codebase.
- Removes two Django `manage.py` commands that're no longer needed:
- `engine/engine/management/commands/alertmanager_v2_migrate.py` (and
it's associated tests)
-
`engine/engine/management/commands/batch_migrate_slack_message_channel.py`

## 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] 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.
2024-12-06 09:28:26 -05:00
grafana-irm-app[bot]
2183a0380a
Merge pull request #5337 from grafana/helm-release/1.13.7
Merge: Release oncall Helm chart 1.13.7
2024-12-06 12:42:15 +00:00
GitHub Actions
7fa03cfd4d Release oncall Helm chart 1.13.7 2024-12-06 12:41:54 +00:00
Vadim Stepanov
8def2b746a
Merge pull request #5336 from grafana/dev
v1.13.7
2024-12-06 12:23:59 +00:00
Vadim Stepanov
710fb8bbc2
Inbound email additional logging (#5335)
# What this PR does

Adds some logging for inbound email + comment on why I disabled
`pytest-socket` in a [recent
PR](https://github.com/grafana/oncall/pull/5328)

## 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] 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.
2024-12-06 11:56:37 +00:00
Matias Bordese
cc0674ed45
fix: allow service account requests to access organization teams (#5326)
Related to https://github.com/grafana/oncall-private/issues/2826
2024-12-05 17:33:22 +00:00
Vadim Stepanov
03b791e743
Fix test connection on integration create (#5328)
Related to https://github.com/grafana/support-escalations/issues/13751

## 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] 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.
2024-12-05 16:46:37 +00:00
Joey Orlando
b0f6ad266d
chore: disable expensive e2e tests (#5332) 2024-12-05 09:06:10 -05:00
Matias Bordese
b2ec26c033
chore: upgrade django to 4.2.17 (#5331) 2024-12-05 13:11:07 +00:00
grafana-irm-app[bot]
56891f7d61
Merge pull request #5319 from grafana/helm-release/1.13.6
Merge: Release oncall Helm chart 1.13.6
2024-12-02 20:42:59 +00:00