Commit graph

7 commits

Author SHA1 Message Date
Joey Orlando
7ebc9cbbf7
modify push notification settings + use fcm-django library (#998)
- swaps out `django-push-notifications` for
[`fcm-django`](https://github.com/grafana/fcm-django). Again.. this is a
fork of the parent repo for exactly the same reason.. the migrations
point to `auth_user` without letting us use our own user model, this has
been patched in the `grafana` fork. The reason why we are using
`fcm-django` vs `django-push-notifications` is that the latter does not
support the new FCM API, only the "legacy" API. The legacy FCM API does
not support certain push notification settings that we would like to
use.
- modifies the iOS/Android specific push notification settings
- adds a `flower` pod in the `docker-compose-developer.yml`, useful for
debugging tasks locally
- sets the mobile app verification token TTL to 5 minutes when
developing locally. The default of 1 minute makes working with device
emulators really tricky..

This PR also swaps out the base image in `engine/Dockerfile` from
`python:3.9-alpine3.16` to `python:3.9-slim-buster`.

As to why.. in short, with the introduction of the `fcm-django` library
there is now a peer-dependency on
[`grpcio`](https://github.com/grpc/grpc) (which is used by
`firebase_admin`.. which I am using in this PR to interact directly with
Firebase Cloud Messaging (FCM)). `grpcio` does not publish wheels (read:
compiled binaries) for the Alpine distro. It does publish wheels for
Debian and hence `pip install -r requirements.txt` does not need to
build this library from the source distribution.

This is a [known
"issue"](https://github.com/grpc/grpc/issues/22815#issuecomment-1107874367)
and the recommended solution in the community is to.. not use alpine.

These were the numbers, when building the image locally, in terms of
image size and build time:

| | Local image size (uncompressed | Build time (may differ based on
your network speed) |
| ------------------------- | -------------------------------------- |
---------- |
| `python:3.9-alpine3.16`   | 785MB  | 320s |
| `python:3.9-slim-buster` | 1.05GB  | 90s   |

Co-authored-by: Salvatore Giordano <salvatoregiordanoo@gmail.com>
2022-12-20 12:41:34 +01: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
Joey Orlando
6e5cb4e8a7
[UI] fix eslint/prettier warnings (#678)
* UI spring cleaning

- fix ~570 outstanding eslint warnings
- make eslint force user to correct warnings
- remove .css files that are not referenced
- remove dummy.tsx as it is not consumed anywhere
- remove a few functions that were "dead code" (ie. not consumed anywhere)
- remove commented out blocks of code that had no explanatory comments surrounding them

* add prettier to pre-commit configuration

* change ignoreRestSiblings to true

we have a few spots in the codebase where we destructure
an object key and then use something like ...restProps
setting this to true allows that

* upgrade from eslint 7.21.0 to 8.25.0
- add @grafana/eslint-config to dev dependencies and pre-commit eslint deps
- add @grafana/eslint-config peer dependencies to package.json

* fix remaining outstanding prettier warnings

* enable noUnusedLocals and noUnusedParameters and fix errors related to this

* make pre-commit complain about eslint warnings

* import from moment-timezone instead of moment

* fix react/display-name eslint warning

* add eslint-plugin-react-hooks to dev deps

this is a peer dependency from @grafana/eslint-config

* turn off react/prop-types

* temporarily turn off react-hooks/exhaustive-deps

add note that it will be turned back on and fixed in next PR

* fix unused import errors after rebase to dev

* fix more new prettier errors

* turn react/no-unescaped-entities eslint rule off

* address PR comment about useReducer

* remove includeTemplateGroup from src/components/AlertTemplates/AlertTemplatesForm.helper.tsx

* update arg typing for refreshPageError

* update handleSyncException typing

* fix strict equality in containers/IntegrationSettings/parts/Autoresolve.tsx

* enhance typing in components/AlertTemplates/AlertTemplatesForm.tsx

* revert small change per Maxim's comment
2022-10-24 20:27:03 +08:00
Rares Mardare
07d62bd309 sass working 2022-08-26 12:26:33 +03:00
Rares Mardare
df1423eca6 remove babelrc.js, rely on webpack config instead 2022-08-25 19:35:05 +03:00
Rares Mardare
5965606de0 huge package update + sass support 2022-08-25 19:31:42 +03: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