Commit graph

1892 commits

Author SHA1 Message Date
Matias Bordese
cebfec5ef9
Add support for web overrides to Terraform schedules (#1222)
Related to #828 

- Enable web UI for API/Terraform schedules to add overrides
- Refactor backend to add a flag toggling between web-based and
iCal-based overrides (these options are mutually exclusive)

Also updated read-only tooltips (related to #1483)
2023-03-10 16:21:50 +00:00
Joey Orlando
b6615c087f
improve e2e tests authentication flow (#1470)
# What this PR does

This PR makes the Grafana login portion of the e2e tests much
faster/more reliable.

Currently we use CSS selectors to go to the login form, input the
username/password, and proceed as such. This PR refactors to instead
make a call to `POST ${GRAFANA_API_URL}/login` and then stores that
authentication state that is then reused by subsequent browsers. This
was inspired by [how the Incident team does their playwright
authentication](https://github.com/grafana/incident/blob/main/plugin/e2e/global-setup.ts)
+ the recommendation from the [Playwright
docs](https://playwright.dev/docs/auth#basic-shared-account-in-all-tests)

## Which issue(s) this PR fixes

Slow/flaky Grafana login flow

## Checklist

- [x] Tests updated
- [ ] Documentation added (N/A)
- [ ] `CHANGELOG.md` updated (N/A)
2023-03-10 06:45:15 +01:00
Matias Bordese
2048e783ba
Add webhooks app and initial models (#1101) 2023-03-09 19:39:25 +00:00
Matias Bordese
9709cfbc73
Add force option to delete web schedule shifts (#1519)
Related to #1505
Add force param to shift delete endpoint in plugin internal API.
2023-03-09 18:39:25 +00:00
Vadim Stepanov
302586792f
Update dev/README.md (#1516)
# What this PR does
Fix `cp` command usage in `dev/README.md` + add `npx playwright install`
step to integration tests instruction
2023-03-09 17:09:02 +00:00
Vadim Stepanov
ed448e3a69
Update CHANGELOG.md 2023-03-09 13:45:24 +00:00
Vadim Stepanov
e7652ab583
Make current day default for override creation modal (#1515)
# What this PR does
Makes current day default for override creation modal + adds a simple
integration test

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

## Checklist

- [x] Tests updated
- [x] `CHANGELOG.md` updated
2023-03-09 13:23:13 +00:00
Ildar Iskhakov
6614d50427
Rename Incident to Alert Group (#1512)
# What this PR does

## Which issue(s) this PR fixes

## Checklist

- [ ] Tests updated
- [ ] Documentation added
- [ ] `CHANGELOG.md` updated
2023-03-09 08:57:13 +00:00
Innokentii Konstantinov
89017bd874 Merge remote-tracking branch 'origin/main' into dev
# Conflicts:
#	CHANGELOG.md
2023-03-09 16:34:28 +08:00
Innokentii Konstantinov
2555a61c1c Update CHANGELOG.md 2023-03-09 16:28:21 +08:00
Innokentii Konstantinov
f0ce08bd67
Check stack cluster for insight_logs (#1469)
# What this PR does
This PR modify is_insight_logs_enabled to check for a stack cluster
instead of DynamicSetting

## Checklist

- [ ] Tests updated
- [ ] Documentation added
- [ ] `CHANGELOG.md` updated
2023-03-09 06:30:54 +00:00
Innokentii Konstantinov
fbb83daf21
Store org cluster_slug (#1480)
# What this PR does
Store org cluster slug to write insight logs
2023-03-09 04:10:19 +00:00
Innokentii Konstantinov
0a3dfeef7d
Fix ratelimit message: incident -> alert groups (#1481) 2023-03-09 03:37:16 +00:00
Matvey Kukuy
df215d20bf
ALert Flow basic explanation. (#1239)
# What this PR does

Updating docs with basic alert flow explanation.

## Which issue(s) this PR fixes

## Checklist

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

---------

Co-authored-by: Joey Orlando <joey.orlando@grafana.com>
Co-authored-by: Ildar Iskhakov <Ildar.iskhakov@grafana.com>
2023-03-09 10:38:20 +08:00
Vadim Stepanov
7604ed3956
Add test for newlines in email subject (#1510)
# What this PR does
Adds a simple test for https://github.com/grafana/oncall/pull/1499

## Checklist

- [x] Tests updated
2023-03-09 01:25:44 +00:00
Manu Vamadevan
3680e5b591
grafana ticketing 81244 : Emails fails if the alert title has a newline char (#1499)
# What this PR does
Emails fails if the alert title has a newline char
## Which issue(s) this PR fixes
Grafana tickets : 81244
## Checklist

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

---------

Co-authored-by: Vadim Stepanov <vadimkerr@gmail.com>
2023-03-08 17:08:19 +00:00
Matias Bordese
ef66cab597
Fix involved users filter, add missing test (#1500)
Fixes https://github.com/grafana/oncall-private/issues/1673
2023-03-08 15:27:03 +00:00
github-actions[bot]
c3cdb772e0
Merge: Release oncall Helm chart 1.1.34 (#1497)
Merge this PR to `main` branch to start another [github actions
job](https://github.com/grafana/oncall/blob/dev/.github/workflows/helm_release.yml)
that will release the updated version of the chart (version: 1.1.34,
appVersion: v1.1.34) into `grafana/helm-charts` helm repository.

This PR was created automatically by this [github
action](https://github.com/grafana/oncall/blob/dev/.github/workflows/helm_release_pr.yml).

Co-authored-by: GitHub Actions <actions@github.com>
2023-03-08 21:43:39 +08:00
Innokentii Konstantinov
747a2b2bc0
FIx insight_logs for mobile app backend (#1498) 2023-03-08 13:38:59 +00:00
Joey Orlando
0f23a449c7
add unique idx on user column in mobileapp authtoken table (#1482)
# Which issue(s) this PR fixes
Solves the (rare) issue where a user could potentially have > 1
mobileapp auth token, leading to 500 errors when trying to interact w/
the authtoken (ex. disconnect a mobile app from a user's profile):
```shell
2023-03-07 10:12:13 source=engine:app google_trace_id=e14bf933d634068a48caf093ce43c7f5/5550677047491218352 logger=django.request Internal Server Error: /api/internal/v1/users/U6WJ3BRLM1TR7/unlink_backend
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/lib/python3.9/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
    return view_func(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/rest_framework/viewsets.py", line 125, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/rest_framework/views.py", line 509, in dispatch
    response = self.handle_exception(exc)
  File "/usr/local/lib/python3.9/site-packages/rest_framework/views.py", line 469, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/usr/local/lib/python3.9/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
    raise exc
  File "/usr/local/lib/python3.9/site-packages/rest_framework/views.py", line 506, in dispatch
    response = handler(request, *args, **kwargs)
  File "/etc/app/apps/api/views/user.py", line 453, in unlink_backend
    backend.unlink_user(user)
  File "/etc/app/apps/mobile_app/backend.py", line 34, in unlink_user
    token = MobileAppAuthToken.objects.get(user=user)
  File "/usr/local/lib/python3.9/site-packages/django/db/models/manager.py", line 85, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/django/db/models/query.py", line 439, in get
    raise self.model.MultipleObjectsReturned(
apps.mobile_app.models.MobileAppAuthToken.MultipleObjectsReturned: get() returned more than one MobileAppAuthToken -- it returned 2!
```

## Checklist

- [x] Tests updated
- [ ] Documentation added (N/A)
- [x] `CHANGELOG.md` updated
2023-03-08 13:50:57 +01:00
Ildar Iskhakov
2c10fa583b
merge dev to main (#1496)
# What this PR does

## Which issue(s) this PR fixes

## Checklist

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

---------

Co-authored-by: Vadim Stepanov <vadimkerr@gmail.com>
Co-authored-by: Joey Orlando <joey.orlando@grafana.com>
2023-03-08 20:23:09 +08:00
Ildar Iskhakov
c4c5953f85
Merge branch 'main' into dev 2023-03-08 20:19:34 +08:00
Ildar Iskhakov
33159b0b6a
Update CHANGELOG.md 2023-03-08 20:18:37 +08:00
Ildar Iskhakov
eb37c3d13d
Hide edit button for default route (#1485)
# What this PR does

## Which issue(s) this PR fixes

## Checklist

- [ ] Tests updated
- [ ] Documentation added
- [ ] `CHANGELOG.md` updated
2023-03-08 18:52:34 +08:00
Joey Orlando
7c8722e714
remove mobile app feature flag (#1484)
# What this PR does

## Which issue(s) this PR fixes

## Checklist

- [x] Tests updated
- [ ] Documentation added (N/A)
- [x] `CHANGELOG.md` updated
2023-03-08 11:22:44 +01: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
Vadim Stepanov
98ccd3eca5
Prohibit creating & updating past overrides (#1474)
# What this PR does
Prohibits creating & updating overrides in the past when using the web
UI.

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

## Checklist

- [x] Tests updated
- [x] `CHANGELOG.md` updated
2023-03-07 15:54:20 +00:00
Vadim Stepanov
4e2076be97
Merge pull request #1478 from grafana/helm-release/1.1.33
Merge: Release oncall Helm chart 1.1.33
2023-03-07 15:48:54 +00:00
GitHub Actions
d371e26958 Release oncall Helm chart 1.1.33 2023-03-07 13:46:45 +00:00
Vadim Stepanov
a958fe836b
Merge pull request #1477 from grafana/dev
Dev to main
2023-03-07 13:44:16 +00:00
Vadim Stepanov
3921a62780
Update CHANGELOG.md 2023-03-07 13:43:14 +00:00
Yulia Shanyrova
d6dbfad999
Chat-ops fix (#1472)
# What this PR does
Fix for the crash of Chat-ops page

## Which issue(s) this PR fixes
https://github.com/grafana/oncall/issues/1467
2023-03-07 12:26:50 +00:00
Matias Bordese
f5fb5d34dc
Rework alert group mine filter query (#1466)
Rework query to make it more efficient.
2023-03-07 11:38:50 +00:00
Kristian Bremberg
b6d65ebb66
Chore: add integrity hash to templates (#1473)
# What this PR does

Adds integrity hash for scripts loaded from CDN's.
2023-03-07 11:17:07 +00:00
Innokentii Konstantinov
7bad073626
Remove OSS_INSTALATION env var (#881)
It's a duplicate of LICENSE env var

**What this PR does**:
Remove OSS_INSTALLATION env var in favour of LICENSE env var. Also, I
refactored features tests a little. From my point of view it makes
little sense to test if all features are disabled or enabled. Better to
test specific use-case (e.g. oss installation).
Also to test that all features are disabled it is needed to set LICENSE
equals cloud license, which makes test confusing.

**Checklist**
- [x] Tests updated
- [ ] Documentation added
- [ ] `CHANGELOG.md` updated
2023-03-07 11:07:42 +00:00
ak0nst
44e93b6ab4
Email and phone limits now environment variable (#1219)
# What this PR does
Email and phone limits now environment variables:
EMAIL_NOTIFICATIONS_LIMIT=200, PHONE_NOTIFICATIONS_LIMIT=200

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

## Checklist

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

---------

Co-authored-by: Vadim Stepanov <vadimkerr@gmail.com>
2023-03-07 10:48:05 +00:00
Innokentii Konstantinov
a50ec8fed2
Refactor get_user_verbal_for_team_for_slack. (#809)
Remove unused params from signature, rename
2023-03-07 10:09:37 +00:00
Innokentii Konstantinov
249e4067c4 Remove unused def render_resolution_notes_for_csv_report 2023-03-07 13:47:49 +08:00
Joey Orlando
6ad30bfd33
remove dependabot config 2023-03-06 17:40:23 +01:00
Joey Orlando
8f22b2fd74
first UI integration test - phone verification + receive SMS alert flow (#900)
**What this PR does**:
Adds our first UI integration test using
[Playwright](https://playwright.dev/) and runs the test on CI. Right now
the test:
- logs into Grafana
- configures the plugin (if it isn't already)
- creates an OnCall schedule, where the current user will be OnCall
- creates an escalation chain to notify based on the newly created
OnCall schedule
- creates a webhook integration, attached to the created escalation
chain
- sends a demo alert for the new integration
- goes to the alert groups page and validates that the escalation step
to alert the OnCall user actually happened

Currently the Playwright tests are run against the 3 default headless
browsers, chromium, Firefox, and webkit. The CI job that runs these
tests is run as a matrix against 3 tagged versions of `grafana`; `main`,
`latest`, and `9.2.6`.

Secondly, it adds most of the logic for a second test which:
- logs into Grafana
- configures the plugin (if it isn't already)
- goes to the user's settings, verifies their phone number (using a tool
called [MailSlurp](https://www.mailslurp.com/))
- configures the current user's default escalation policy to send alerts
via SMS
- creates an escalation policy and configures it to send alerts to our
current user
- creates an integration and assigns the created escalation policy
- triggers a test alert + verifies that we receive the SMS alert text
(again, using MailSlurp)

**Which issue(s) this PR fixes**:
Closes #873 

**Checklist**
- [x] Tests updated
- [ ] Documentation added (N/A)
- [ ] `CHANGELOG.md` updated (N/A)
2023-03-06 16:28:52 +00:00
Vadim Stepanov
ab493def5f
Schedule quality backend improvements (#1461)
# What this PR does

Changes the schedule quality API so it also returns types of comments
(this is needed to address
https://github.com/grafana/oncall/issues/118#issuecomment-1436954708).

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

## Checklist

- [x] Tests updated
2023-03-06 14:27:49 +00:00
Vadim Stepanov
a194bdc72b
PD migrator: fix layer levels (#1455)
# What this PR does
Current implementation of PD migrator creates schedule layers with
priority levels starting from 0.
This PR makes so layers start from 1, so it's closer to original PD
schedules that are starting from 1.

## Checklist

- [x] Tests updated
2023-03-06 14:01:35 +00:00
Vadim Stepanov
c20229fefd
PD migrator: migrate overrides (#1454)
# What this PR does
Allows PD migrator to migrate overrides (the current implementation only
migrates rotation layers).
Also tweaks public API so created overrides are consistent with the web
UI.

## Checklist

- [x] Tests updated
2023-03-06 13:44:28 +00:00
Innokentii Konstantinov
19f1491e3a
Fix wording for cloud notifications (#1458)
# What this PR does
Fix message on Phone Verification tab.
2023-03-06 09:43:00 +00:00
Innokentii Konstantinov
4b91203eca
Add validation of hostname for recapctha (#1445)
# What this PR does

- Implement recapthca v3 check. DRF_RECAPTCHA didn't support hostname
validation and it's too complicated to add it.
- Add validation of verification code on oncall side to not to call
twilio with obviously invalid codes

## Checklist

- [x] Tests updated
- [ ] Documentation added
- [ ] `CHANGELOG.md` updated
2023-03-06 08:59:48 +00:00
Rares Mardare
d182e71f62
fix for #1273, added component for showing permission restricted acce… (#1422)
# What this PR does

- Removed unused code
- Added another component for displaying Error Messages based on
permissions access (so that we do not duplicate this code everywhere
it's needed)
- Fix for #1273 

## Which issue(s) this PR fixes

- #1273 

## Checklist

- [ ] Tests updated
- [ ] Documentation added
- [ ] `CHANGELOG.md` updated
2023-03-02 15:32:59 +00:00
Matvey Kukuy
2a311c6289
Incident -> Alert Group wording (#1450) 2023-03-02 15:03:58 +00:00
Vadim Stepanov
323597670c
Merge pull request #1439 from grafana/helm-release/1.1.32
Merge: Release oncall Helm chart 1.1.32
2023-03-01 17:37:00 +00:00
GitHub Actions
b6cf19ede1 Release oncall Helm chart 1.1.32 2023-03-01 17:05:50 +00:00
Vadim Stepanov
5f0ba6b445
Merge pull request #1438 from grafana/dev
Dev to main
2023-03-01 17:02:21 +00:00