Commit graph

409 commits

Author SHA1 Message Date
Rares Mardare
7195646413
Rares/webhook UI changes (#2419)
# 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-07-05 09:06:33 +00:00
Ildar Iskhakov
5cc06b7041
Remove url from sms notification, change format (#2317)
# What this PR does
Remove link from sms notification to avoid difficulties with different
countries anti-spam regulations


## 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: Joey Orlando <joey.orlando@grafana.com>
2023-07-05 16:32:54 +08:00
Innokentii Konstantinov
e0d8e7980e Fix date of 1.3.4 2023-07-05 14:31:37 +08:00
Innokentii Konstantinov
fe5b6516f0 Update CHANGELOG.md 2023-07-05 14:30:51 +08:00
Andrey Oleynik
aeb35009be
add zvonok integration (#2339)
Added integration with [zvonok.com](https://zvonok.com) service.

Features:
- Phone number validation
- Test calls
- Selection of pre-recorded audio
- Making calls
- Processing call status
- Acknowledgment alert group (optional)

To process the call status, it is required to add a postback with the
GET method on the side of the zvonok.com service with the following
format ([more info
here](https://zvonok.com/ru-ru/guide/guide_postback/)):

```${ONCALL_BASE_URL}/zvonok/call_status_events?campaign_id={ct_campaign_id}&call_id={ct_call_id}&status={ct_status}&user_choice={ct_user_choice}```

The names of the transmitted parameters can be redefined through environment variables.

---------

Co-authored-by: Innokentii Konstantinov <innokenty.konstantinov@grafana.com>
2023-07-05 05:55:53 +00:00
Joey Orlando
5cc9d5441f
include note about docker-compose rabbitmq version bump 2023-07-04 15:49:30 -04:00
Vadim Stepanov
44e1bef250
Add full avatar URL for on-call users in schedule internal API (#2414)
# What this PR does

Adds full avatar URL for on-call users in schedule internal API
(`avatar_full`).

## 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-30 14:45:40 +01:00
Michael Derynck
8ea5f93719
Update CHANGELOG.md 2023-06-29 14:46:05 -06:00
Michael Derynck
2b81dfd8c3
Remove attempt to check token when editor/viewers are accessing the plugin (#2410)
# What this PR does
Remove attempt to check token when editor/viewers are accessing the
plugin. Only check the token for reinstall during sync from the
PluginConfigPage since only Admins would have access to it.

## Which issue(s) this PR fixes

## 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:17:02 -06: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
952af0b36f
Update CHANGELOG.md 2023-06-29 07:42:36 -04:00
Michael Derynck
5b009563db
OnCall plugin use service accounts instead of api keys (#2385)
# What this PR does
Changes OnCall plugin to use service accounts and api tokens instead of
api keys. API keys will continue to work but if the plugin ever replaces
them it will use a service account instead. Previously this was thought
to be unnecessary but it was missing the case where the API key was
converted to a service account which it could no longer find when
searching the `/api/auth/keys` endpoint. That key would not be deleted
and it would conflict with a newly created one of the same name.

Now the behaviour is as follows: 
1. Anytime a new token is needed all API keys and tokens under the
service account matching the defined names will be deleted
2. A service account will be created named `sa-autogen-OnCall` if one
does not already exist
3. An api token will be created under that service account named
`OnCall`

## Which issue(s) this PR fixes
#1806 

## 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)

---------

Co-authored-by: Joey Orlando <joey.orlando@grafana.com>
2023-06-29 07:37:28 -04:00
Joey Orlando
8ff5af5e4a
update CHANGELOG 2023-06-29 13:01:59 +02:00
Innokentii Konstantinov
03663ea319 Update CHANGELOG.md 2023-06-28 17:52:17 +08:00
Yulya Artyukhina
f1fcb41fb4
Add "user_was_notified_of_alert_groups" metric (#2334)
This PR adds new metric for Prometheus exporter
"user_was_notified_of_alert_groups" which counts how many alert groups
user was notified of.

## 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)

---------

Co-authored-by: Joey Orlando <joey.orlando@grafana.com>
2023-06-28 08:15:19 +00:00
Ildar Iskhakov
8f5441b4c6
Update CHANGELOG.md 2023-06-28 09:41:45 +08:00
Joey Orlando
f75747ac23
For "You're Going OnCall" push notifications, show shift times in the user's configured timezone, otherwise UTC (#2351)
# Which issue(s) this PR fixes

closes #2350

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [ ] Documentation added (or `pr:no public docs` PR label added if not
required) (N/A)
- [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
2023-06-27 05:59:54 +00:00
Ildar Iskhakov
065cc9343a
Show 100000+ in stats when there are more than 100000 alert groups in the result (#1901)
# 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-27 02:58:16 +00:00
Michael Derynck
dd713bac55
Change permissions used for finishing plugin setup (#2242)
Fixes issue where user not having `plugins:install`permission were
unable to complete setup of OnCall.

- Check multiple Grafana permissions to complete OnCall setup instead of
`plugins:install` since the plugin is already installed at this point
- Use the following permissions
  - `plugins:write` - Plugin setup will write to plugin config
- `users:read` - Grafana API key being granted to OnCall will be used to
read users from Grafana
- `teams:read` - Grafana API key being granted to OnCall will be used to
read teams from Grafana
- `apikeys:create` - If Grafana API key does not exist it will be
created
- `apikeys:delete` - If existing Grafana API key does not work it will
be deleted and recreated

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

TODO:
- [x] Fix tests
2023-06-26 22:22:13 +00:00
Matias Bordese
d23e2f44da
Update CHANGELOG.md 2023-06-26 14:12:52 -03:00
Vadim Stepanov
1203b615c9
Fix phone call & SMS relay (#2345)
# What this PR does

Fix incorrect order of arguments for phone provider method invocations
when relaying phone calls and SMS from OSS instances.

## 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-26 16:09:21 +00:00
Joey Orlando
7638e75cab
Update CHANGELOG.md 2023-06-26 09:18:41 -04:00
Sergei Kuzmin
a8ce45ff0f
Set base oncall url as default for telegram.webhookUrl (#2322)
# What this PR does

## Which issue(s) this PR fixes

Grafana OnCall base_url is most likely the one to be used for Telegram
callback.

## Checklist

- [ ] Unit, integration, and e2e (if applicable) tests updated - Not
needed
- [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-26 09:23:00 +00:00
Matias Bordese
5f73af19f0
Minor updates to schedule rotation form and preview (#2316)
- When editing a shift, use `shiftStart` as `rotationStart` value
(originally, `rotationStart` was most of the time the timestamp of
creation, which is confusing in the new form; otoh, for newly created
shifts, the `shiftStart` will match `rotationStart`)
- Since shift preview is requested starting the day before the start of
the week, sometimes the displayed preview is missing the last day of the
week (preview returns 7 days by default)
2023-06-23 16:29:36 +00:00
Rares Mardare
e308b5298d
Switch old with new integrations page (#2310)
# What this PR does

- Removed old Integration usages
- Swaped old with new page

---------

Co-authored-by: Yulia Shanyrova <yulia.shanyrova@grafana.com>
2023-06-23 08:50:18 +00:00
Sergei Kuzmin
370d7b9867
Secrets consistency for the chart (#1016)
- Enabling existing secrets for external MySQL and Redis
- Tolerate existing secrets for bundled charts.
- README.md: secrets handling explained.
- Fixed multiple bugs where missing required field was replaced with
default instead of failing.
- PHONE_NOTIFICATIONS_LIMIT was on the wrong level: it was not set if
existingSecret was true.

Next are the cosmetic changes. They improve chart consistency, e.g.
prevent generation of multiple new lines in certain cases:
- Common approach to spaces trimming. This typically allows curly blocks
and actual strings indentation and nice `nindent` usage:
- Two curly blocks should not trim the same space. I.e. "{{ ... -}} {{-
... }}" shouldn't happen.
- Template generates either single line or multiline string. In both
cases, no new line appears on both sides of the output string. So we
delete unnecessary new lines inside and at the end of string with
"trim-to-left" (`{{-` ) and the leading new line using "trim-to-right"
(`-}}`).
Note that trimming both leading and trailing new line is not always
easily possible: https://github.com/Masterminds/sprig/issues/357

    Example.

    ```
    {{- define "mytemplate" -}}
    {{ if someBoolean -}}
      {{ .Value.some }}
    {{- else -}}
      some string
    {{- end }}
    {{- end }}
    ```

- `template` replaced with `include`. It is often recommended to use
`include` by default, as it allows pipelining.

## Checklist

- [ ] Tests updated - No tests for Helm chart
- [X] Documentation added
- [x] `CHANGELOG.md` updated

Co-authored-by: Ildar Iskhakov <Ildar.iskhakov@grafana.com>
2023-06-23 05:43:05 +00:00
Matias Bordese
3dfc30cf13
Update CHANGELOG.md 2023-06-22 12:19:56 -03:00
Matias Bordese
6f387557d6
Update CHANGELOG.md 2023-06-22 12:01:21 -03:00
Ildar Iskhakov
8bfaccf733
Fix broken markup on alert group page, declutter, make time format consistent (#2295)
# What this PR does

This PR changes Alert Group layout according to the feedback from this
issue https://github.com/grafana/oncall/issues/2008

Also it makes time format more consistent across OnCall

## 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-21 15:24:50 +00:00
Vadim Stepanov
eada4a4355
Fix duplicate orders for user notification policies (#2278)
# What this PR does

Fixes an issue when multiple user notification policies have duplicated
order values, leading to the following unexpected behaviours:
1. Not possible to rearrange notification policies that have duplicated
orders.
2. The notification system only executes the first policy from each
order group. For example, if there are policies with orders `[0, 0, 0,
0]`, only the first policy will be executed, and all others will be
skipped. So the user will see four policies in the UI, while only one of
them will be actually executed.

This PR fixes the issue by adding a unique index on `(user_id,
important, order)` for `UserNotificationPolicy` model. However, it's not
possible to add that unique index using the ordering library that we use
due to it's implementation details.
I added a new abstract Django model `OrderedModel` that's able to work
with such unique indices + under concurrent load.

Important info on this new `OrderedModel` abstract model:
- Orders are unique on the DB level
- Orders are allowed to be non-consecutive, for example order sequence
`[100, 150, 400]` is valid
- When deleting an instance, orders of other instances don't change.
This is a notable difference from the library we use. I think it's
better to only delete the instance without changing any other orders,
because it reduces the number of dependencies between instances (e.g.
Terraform drift will be much smaller this way if a policy is deleted via
the web UI).

## Which issue(s) this PR fixes

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

## 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-21 11:13:56 +00:00
Yulya Artyukhina
0c46b41498
Metrics doc (#2149)
# What this PR does

## Which issue(s) this PR fixes

## Checklist

- [ ] 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)

---------

Co-authored-by: Matias Bordese <mbordese@gmail.com>
2023-06-21 11:00:13 +00:00
Yulya Artyukhina
64976d6b8d
Add dashboard for oncall metrics to provisioning plugin settings (#1973)
Add dashboard for oncall metrics to the plugin settings by following
[this
instruction](https://community.grafana.com/t/how-to-include-dashboards-in-your-data-source-plugin/62749).
Dashboards files should be in `.json` format and stored in the plugin's
directory in `/src/dashboards/`.
As the result the dashboard can be imported from the `Dashboards` tab at
the plugin settings page:
<img width="1504" alt="Screenshot 2023-06-21 at 11 28 31"
src="https://github.com/grafana/oncall/assets/22730923/8c2bfe4a-f3c8-480a-b18c-7ba21a9b8e30">

---------

Co-authored-by: Joey Orlando <joey.orlando@grafana.com>
2023-06-21 10:11:04 +00:00
Matias Bordese
89834ee232
Changed web schedule updates to sync refresh ical (#2279)
Updating a schedule using the web UI sometimes you don't get the change
immediately available (since the ical refresh is async).
Related to https://github.com/grafana/oncall/issues/1968
2023-06-20 15:01:35 +00:00
Maxim Mordasov
9f0064f21b
Schedules 2nd iteration updates (#1720)
# What this PR does

Features and bugs related to [[Q1 2023] Iteration with
Schedules](https://github.com/grafana/oncall-private/issues/1660)
milestone

## Which issue(s) this PR fixes

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [ ] 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)

---------

Co-authored-by: Innokentii Konstantinov <innokenty.konstantinov@grafana.com>
Co-authored-by: Matias Bordese <mbordese@gmail.com>
2023-06-20 16:18:56 +03:00
Salvatore Giordano
0177301bb8
refactor title and subtitle of shift notifications (#2288)
# What this PR does

## Which issue(s) this PR fixes

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] 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: Joey Orlando <joseph.t.orlando@gmail.com>
Co-authored-by: Joey Orlando <joey.orlando@grafana.com>
2023-06-20 10:49:13 +00:00
Innokentii Konstantinov
79b17ad15a Update CHANGELOG.md 2023-06-19 13:39:40 +08:00
Ildar Iskhakov
c71ed490b4
Optmise autoresolve query (#2273)
# 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: Innokentii Konstantinov <innokenty.konstantinov@grafana.com>
2023-06-19 04:43:46 +00:00
Joey Orlando
111ecb9297
remove legacy permission strings (#2269)
# What this PR does

Remove deprecated `permissions` `List[str]` from internal API user
response. These permission strings are no longer used and AFAICT are not
referenced anywhere in the UI.

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [ ] Documentation added (or `pr:no public docs` PR label added if not
required) (N/A)
- [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
2023-06-16 10:00:14 +00:00
Ruslan Gainanov
691a503cfa
fix existingSecret for RabbitMQ to default value (see #761) (#864)
**What this PR does**:
The existing value brokes the release when using external RabbitMQ. 
```
 Warning  Failed     6s (x11 over 112s)  kubelet            Error: couldn't find key password in Secret monitoring/oncall-rabbitmq-external
```

**Which issue(s) this PR fixes**:
Related MR [#761](https://github.com/grafana/oncall/pull/761)

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

---------

Co-authored-by: Ildar Iskhakov <Ildar.iskhakov@grafana.com>
2023-06-16 03:14:36 +00:00
Matias Bordese
d38315def7
Handle non-UTC UNTIL datetime value when repeating ical events (#2241) 2023-06-15 13:53:53 +00:00
Joey Orlando
572131b921
add user locale field to mobile app user settings table + change going on call push notification text (#2131)
# What this PR does

- add user locale field to mobile app user settings table + add a test
that sends `PATCH` requests to this endpoint
- change "you're going on call" push notification text to include
localized shift time. The general format is now:
  ```python
f"You're going on call in {time_until_going_oncall} for schedule
{schedule.name}, {formatted_shift}"
  ```
- `time_until_going_oncall` is a "human-readable" format of the time
until the start)
  - `schedule.name` is self-explanatory
- `formatted_shift` this depends on the shift. If the shift starts and
ends on the same day, the format will be "HH:mm - HH:mm". Otherwise, if
the shift starts and ends on different days, the format will be
"YYYY-MM-DD HH:mm - YYYY-MM-DD HH:mm". **Note** that all datetime
related formatting will use the new `locale` field that we are now
storing in the mobile app user settings table. If no locale is yet
present we will fallback to "en"

## Which issue(s) this PR fixes

closes https://github.com/grafana/oncall/issues/2024
https://github.com/grafana/oncall-mobile-app/issues/187

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [ ] 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-14 12:19:58 -04:00
Matias Bordese
35b08a3544
Update CHANGELOG.md 2023-06-14 10:16:55 -03:00
Joey Orlando
072d43c3d2
make mobile app available to viewers (#1892)
# What this PR does
closes #2153 

## Which issue(s) this PR fixes

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [ ] 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-13 14:54:52 -04:00
Matias Bordese
6d77f598d6
Require users when creating a schedule rotation (#2220) 2023-06-13 16:50:37 +00:00
Matias Bordese
1e0bd4395d
Fix preview cutting overlapping events (#2218)
Also update schedules filter by type to allow multiple option selection
as OR.
2023-06-13 15:27:01 +00:00
Joey Orlando
90e0b21d3e
remove SlackActionRecord model/table (#2201)
# What this PR does

Closes #2169 

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [ ] 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-13 10:56:06 +00:00
Raz Amir
40890e26ba
Helm: Allow using existing secrets for redis and mysql (#2156)
# What this PR does
This PR adds the ability to use an existing secret for external Redis
and external MySQL and it follows the same changes that PR #761 did for
RabbitMQ (including the fix that was done for it later in #775)

## 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)

---------

Co-authored-by: Ildar Iskhakov <Ildar.iskhakov@grafana.com>
2023-06-13 05:42:22 +00:00
Ildar Iskhakov
30b8401f03
Add helm tests for rabbitmq and redis (#2165)
# 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-13 09:45:07 +08:00
Michael Derynck
363a3488a2
Update CHANGELOG.md 2023-06-12 15:19:24 -06:00