Commit graph

97 commits

Author SHA1 Message Date
Joey Orlando
babacf4da8
refactor the is_rbac_permissions_enabled check to be more robust (#1099)
# What this PR does
Checks the `is_rbac_permissions_enabled` flag differently based on
whether we are dealing with an open-source, or cloud installation:
- for open-source installations, simply continue making a `HEAD` request
to the list RBAC permissions Grafana API endpoint.
- for cloud installations, use the `config` object returned from `GET
/instances/{instance_id}?config=true` and check whether
`instance_info["config"]["feature_toggles"]["accessControlOnCall"] ==
"true"`

## Which issue(s) this PR fixes
Resolves the issue in hosted grafana where when a stack is inactive, the
hosted grafana gateway, returns 200 to the `HEAD` request (which
erroneously sets the `is_rbac_permissions_enabled` flag to `true`)

## Checklist

- [x] Tests updated (N/A)
- [ ] Documentation added
- [x] `CHANGELOG.md` updated
2023-01-11 12:48:30 +01:00
Rares Mardare
2ac4d88e88
v1.1.15 CHANGELOG (#1116)
# What this PR does

`v1.1.15`
2023-01-10 10:37:52 +02:00
Joey Orlando
923bee1f8f
update changelog (#1091) 2023-01-05 17:58:40 +01:00
Innokentii Konstantinov
bf9e5c0ad7 Update Changelog 2023-01-05 13:39:23 +08:00
Vadim Stepanov
0d4701bd81
Change wording from "incident" to "alert group" in the Telegram app (#1052)
# What this PR does
Makes Telegram integration consistent with the rest of the system so it
uses the word "alert group" instead of "incident" when referring to
alert groups.

## Checklist

- [x] Tests updated
- [ ] Documentation added (N/A)
- [x] `CHANGELOG.md` updated
2023-01-04 17:44:01 +00:00
Ildar Iskhakov
01f3e19e02
Update CHANGELOG.md 2023-01-04 10:11:33 +08:00
Ildar Iskhakov
0e54a9f253
Update CHANGELOG.md 2023-01-04 10:02:29 +08:00
Ildar Iskhakov
89144692d3
Update CHANGELOG.md 2023-01-04 09:09:51 +08:00
Michael Derynck
cc31af20dc
Update CHANGELOG.md 2023-01-03 14:07:32 -07:00
Ildar Iskhakov
da51edefcc
Update CHANGELOG.md 2023-01-03 21:50:53 +08:00
Ildar Iskhakov
4a32b21c46
Update CHANGELOG.md 2023-01-03 21:09:00 +08:00
Ildar Iskhakov
d778710469
Update CHANGELOG.md 2023-01-03 21:07:36 +08:00
Ildar Iskhakov
100a18ab1c
Update CHANGELOG.md 2023-01-03 19:46:12 +08:00
Juris Pavļučenkovs
327b7121ac
Helm: define engine update strategy in values.yaml (#985)
# What this PR does

Now it is possible to change engine deployment update strategy in
values.yaml.
## Which issue(s) this PR fixes

This is due to #334 and #316, as with rolling update, race conditions
might happen when there is still an old engine pod running.

Co-authored-by: Joey Orlando <joey.orlando@grafana.com>
2022-12-20 13:59:19 +01:00
Joey Orlando
ed4be171f6
add make command to configure mobile app feature (#988)
Adds a make command, `enable-mobile-app-feature-flags`, which sets the
backend feature flag in `./dev/.env.dev`, and updates a record in the
`base_dynamicsetting` database table, which are needed to enable the
mobile app backend features.
2022-12-14 09:36:35 +01:00
Matias Bordese
2b763f376e
Update CHANGELOG.md 2022-12-13 10:18:18 -03:00
Matias Bordese
684375a3eb
Update CHANGELOG.md 2022-12-13 10:16:59 -03:00
Joey Orlando
5967d5af63
remove apns + fix django-push-notifications migrations (#984)
- removes APNS support
- changes the `django-push-notification` library from the `iskhakov`
fork to the [`grafana`
fork](https://github.com/grafana/django-push-notifications). This new
fork basically just patches an issue which affected the database
migrations of this django app (previously the library would not respect
the `USER_MODEL` setting when creating its tables and would instead
reference the `auth_user` table.. which we don't want)
- add `--no-cache` flag to the `make build` command

**NOTE**
A migration should be applied as follows:
```bash
# remove the four push_notifications tables, which have improper foreign key references
python manage.py migrate push_notifications zero

# recreate the tables with the proper foreign key references
python manage.py migrate
```
2022-12-13 13:00:59 +01:00
Matias Bordese
5036d719d7
Update CHANGELOG.md 2022-12-09 15:16:33 -03:00
Joey Orlando
635168afb9
hide mobile app verification tab in the user settings modal for unauthed users (#970) 2022-12-09 12:53:20 +01:00
Erikas Truskauskas
c1307a44d7
Make job-migrate ttlSecondsAfterFinished customizable (#957)
Co-authored-by: Joey Orlando <joey.orlando@grafana.com>
2022-12-07 09:10:10 +01:00
Joey Orlando
ffda80ae34
add permalinks.web attribute to alert group internal/public api response (#953) 2022-12-06 11:06:05 +01:00
Joey Orlando
427dd4b5f7
helm chart v1.0.13 - update appVersion to v1.1.5 + change image.pullPolicy to "Always" (#937) 2022-12-02 13:27:37 +01: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
Joey Orlando
9a7b8acd5a
centralize timezone validation + add serializer validation for on call shifts and schedules (#924)
* Centralize timezone validation into one spot + add serializer validation
for schedules and oncall shifts (both public and internal API)

* add engine-manage make command
2022-12-01 14:13:39 +01:00
Joey Orlando
9e598385f4
Add RBAC Support (#777)
* Modify plugin.json to support RBAC role registration

* defines 26 new custom roles in plugin.json. The main roles are:

- Admin: read/write access to everything in OnCall
- Reader: read access to everything in OnCall
- OnCaller : read access to everything in OnCall + edit access to Alert Groups and Schedules
- <object-type> Editor: read/write access to everything related to <object-type>
- <object-type> Reader: read access for <object-type>
- User Settings Admin: read/write access to all user's settings, not just own settings. This is in comparison to User Settings Editor which can only read/write own settings

* update changelog and documentation (#686)

* implement RBAC for OnCall backend

This commit refactors backend authorization. It trys to use RBAC authorization if the org's grafana instance supports it, otherwise it falls back to basic role authorization.

* update RBAC backend tests

* add tests for RBAC changes
- run backend tests as matrix where RBAC is enabled/disabled. When RBAC is enabled, the permissions granted are read from the role grants in the frontend's plugin.json file (instead of relying what we specify in RBACPermission.Permissions)
- remove --reuse-db --nomigrations flags from engine/tox.ini
- minor autoformatting changes to docker-compose-developer.yml

* remove --ds=settings.ci-test from pytest CI command

DJANGO_SETTINGS_MODULE is already specified as an env var so this is just unecessary duplication

* update gitignore

* update github action job name for "test"

* RBAC frontend changes

* refactors the use of basic roles (ex. Viewer, Editor, Admin) use RBAC permissions (when supported), or falling back to basic roles when RBAC is not supported.

- updates the UserAction enum in grafana-plugin/src/state/userAction.ts. Previously this was hardcoded to a list of strings that were being returned by the OnCall API. Now the values here correspond to the permissions in plugin.json (plus a fallback role)

* changes per Gabriel's comments:
- get rid of group attribute in rbac roles
- remove displayName role attribute
- remove hidden role attribute
- add back role to includes section

* don't try to update user timezone if they don't have permission
2022-11-29 09:41:56 +01:00
Joey Orlando
eb97797d43
Merge pull request #880 from grafana/jorlando/mobile-app-qr-code
Fetch/Display Mobile App QR Code
2022-11-28 18:54:05 +01:00
Joey Orlando
5a4fc90fa4
fetch/render mobile app QR code in user settings modal 2022-11-28 18:47:59 +01:00
Michael Derynck
3582f9b08f
Improve Jinja Template feedback and error handling (#884)
* Improve feedback so template errors are given to user

* Add security error logging

* Add limits for templates, payloads, results

* Show popup error notification for webhook errors and template errors that don't have a result

* Update tests

* Split exceptions into warnings/errors to give more control when previewing, rendering, saving templates

* Limit title lengths

* Make TypeError a warning

* Adjust title length limit

* Remove length limiting on urlize since it is being done on template render

* Fix tests

* Add KeyError and ValueError to warnings

* No longer enforcing json result when saving webhook in case it is dependent on payload

* Add tests for expected exceptions coming from apply_jinja_template

* Update changelog

* Send raw post if template result is not JSON
2022-11-28 09:46:51 -07:00
Vadim Stepanov
c23de808cb
Update CHANGELOG.md 2022-11-24 14:03:14 +00:00
Joey Orlando
d50db0dd80
[Hotfix] UI not handling invalid grafana tokens properly (#892)
* bug-fix

fix issue where frontend would not properly handle
scenario where Grafana API token was not yet available/valid
2022-11-23 13:29:58 +01:00
Michael Derynck
2edd88cbe3 Update changelog 2022-11-22 11:27:41 -07:00
Yulya Artyukhina
381520ee13
Get rid of installation token + add a bunch of tests (#624)
* Get rid of installation token (for OSS installations)

This is done by being required to supply the grafana API URL as an
environment variable on the backend. Additionally, optionally an OnCall
API URL environment variable can be passed in to the frontend (this basically
allows completely skipping the need to configure anything).
- deduplicated a lot of the sync logic on the frontend + made
error message more useful and consistent
- Split PluginConfigPage component into several subcomponents
(making it easier to test each individual component)
- Moved RootWithLoader (from plugin/GrafanaPluginRootPage) into its own
subcomponent (making it easier to test)
- Added tests for pre-existing components that were touched:
  - PluginConfigPage component (and its new subcomponents)
  - state/plugin and state/rootBaseStore functions
  - apps.grafana_plugin django app

Helm changes:
- add GRAFANA_API_URL to oncall.env
- some yaml autoformatting changes
- remove reference to python manage.py issue_invite_for_the_frontend --override

Co-authored-by: Joey Orlando <joseph.t.orlando@gmail.com>
2022-11-21 16:26:00 +01:00
Innokentii Konstantinov
671c3a74b9 Update Changelod 2022-11-18 17:39:23 +08:00
Innokentii Konstantinov
0b645b2835 Update changelog 2022-11-16 19:11:13 +08:00
Matias Bordese
4dc8adee1f
Update CHANGELOG.md 2022-11-09 15:05:55 -03:00
Joey Orlando
fd4877408a
remove grafana_plugin_management django app (#812)
* remove grafana_plugin_management django app

it seems to be no longer used or referenced. In addition apps.api.serializers.organization.PluginOrganizationSerializer was only
referenced from within grafana_plugin_management and is thereby safe
to remove.
2022-11-09 13:53:59 +01:00
Michael Derynck
f01d754851 Merge dev 2022-11-08 10:14:35 -07:00
Michael Derynck
9311b530c2 Update changelog 2022-11-05 00:44:55 -06:00
Michael Derynck
81702ba52d Merge dev 2022-11-03 12:42:36 -06:00
Matias Bordese
54204bad3b
Update CHANGELOG.md 2022-11-03 15:33:34 -03:00
Michael Derynck
71c8d17c78 Changelog cleanup 2022-11-01 18:29:28 -06:00
Michael Derynck
2905423bad Merge dev 2022-11-01 17:56:03 -06:00
Vadim Stepanov
ae485beded
Update CHANGELOG.md 2022-11-01 14:34:31 +00:00
Innokentii Konstantinov
ca6f7ef691 Update changelog 2022-11-01 19:03:01 +08:00
Innokentii Konstantinov
6d5853d1ff Update changelog 2022-11-01 19:02:10 +08:00
Innokentii Konstantinov
882851e0b8 Revert "Modify CHANGELOG.md"
This reverts commit fd8ad47a55.
2022-11-01 17:39:18 +08:00
Innokentii Konstantinov
fd8ad47a55 Modify CHANGELOG.md 2022-11-01 17:13:39 +08:00
Joey Orlando
5a4c3d6d77
remove POST /api/internal/v1/custom_buttons/{id}/action (#734)
* remove POST /api/internal/v1/custom_buttons/{id}/action
2022-10-28 10:44:37 +02:00
Ildar Iskhakov
00315e5c2d
Merge branch 'main' into dev 2022-10-27 21:28:44 +08:00