* feat(task): impersonate user on task execution
Passing tokens to tasks is cumbersome and we needed a way to more easily create tasks. With this change we no longer need a token on task create. We take the user that created the task and pass that in as the "owner". As far as the task is concerned the owner is the source of permissions.
This is done by adding an additional field on task create that is OwnerID. We will no longer respect the token passed in and it will be deprecated soon.
Things to do still:
Task updates need to allow for owners to be set.
Current behavior is that the first execution of a task happens based on the create time
of the task when using a 'every' schedule. If you create a task at 12:02 and want
the task to run every 15m. The first execution would happen at 12:17, and the 2nd would happen
at 12:30.
To fix this behavior I refactored the kv task to give a single source of knowledge.
We now have one function for finding exactly what the last scheduled task was.
We also now have a single method that calculates when the next schedule is due.
By unifying the logic it should always work the same way weather your asking when to run
or when creating a task.
First pass at flux AST generation from check
Co-authored-by: Michael Desa <mjdesa@gmail.com>
Co-authored-by: Deniz Kusefoglu <deniz@influxdata.com>
fix(notification/check): format call expression
Co-authored-by: Michael Desa <mjdesa@gmail.com>
Co-authored-by: Deniz Kusefoglu <deniz@influxdata.com>
fix(notification/check): cleanup CheckDefinition
Co-authored-by: Michael Desa <mjdesa@gmail.com>
Co-authored-by: Deniz Kusefoglu <deniz@influxdata.com>
fix(notification/check): clean up threshold functions
Co-authored-by: Michael Desa <mjdesa@gmail.com>
Co-authored-by: Deniz Kusefoglu <deniz@influxdata.com>
fix(notification/check): clean up message function
Co-authored-by: Michael Desa <mjdesa@gmail.com>
Co-authored-by: Deniz Kusefoglu <deniz@influxdata.com>
fix(notification/check): misc fixes
Co-authored-by: Michael Desa <mjdesa@gmail.com>
Co-authored-by: Deniz Kusefoglu <deniz@influxdata.com>
fix(notification/check): remove dead code
Co-authored-by: Michael Desa <mjdesa@gmail.com>
Co-authored-by: Deniz Kusefoglu <deniz@influxdata.com>
fix(notification/check): move threshold flux generation to check pkg
Co-authored-by: Michael Desa <mjdesa@gmail.com>
Co-authored-by: Deniz Kusefoglu <deniz@influxdata.com>
fix(notification/check): move base ast generation to its own package
Co-authored-by: Michael Desa <mjdesa@gmail.com>
Co-authored-by: Deniz Kusefoglu <deniz@influxdata.com>
fix(notification/check): add comment for GenerateFluxAST
Co-authored-by: Michael Desa <mjdesa@gmail.com>
Co-authored-by: Deniz Kusefoglu <deniz@influxdata.com>
docs(notification/flux): add comments to each exported function
Co-authored-by: Michael Desa <mjdesa@gmail.com>
Co-authored-by: Deniz Kusefoglu <deniz@influxdata.com>
feat(notification/check): add tests for GenerateFlux
Co-authored-by: Michael Desa <mjdesa@gmail.com>
Co-authored-by: Deniz Kusefoglu <deniz@influxdata.com>
feat(notification/check): add task options to generated flux
fix(notification/check): use flux compatible duration type
test(notification/check): add task option to task definition
test(http): use check Duration in checks http handlers
feat(check): add TaskID to checks base
fix(notification/check): hack around issue with formatting ast package
wtih multiple files
test(check): create task when check is created
A lot of little changes had to happen as a result of this. This change
was rather painful.
feat(checks): add update and delete of task for check
fix(notifications/check): hack around the alerts package not being
available
test(kv): temporarily skip check tests while we merge the pr above
If the reader produces more than one table with the same group key, we
discard the later ones because the stream should never give us more than
one table with the same group key.
This is an error and it indicates the server sent us a bad set of data.
This change makes it so that the client is tolerant of that data and
will discard it if it exists.
* Move current check to TimeMachine alerting
* Unify RemoveButton actions in to ConvertFromCheckView
* Unify AddCheckDialog actions
* Switch saveCurrentCheck to saveCheckFromTimeMachine
* Remove current check from checks reducer
* Change getCurrentCheck to getCheckForTimeMachine
* Get Check along with view in EditcheckEO
* Tidy imports
* Import Actions With on...
* fix module name
* Remove check fixtures
* adding new templates; removing calls to create templates
* fixing quickstart dashboard creation
* Type dashboard template
* bump templates repo version
* add templateID to template meta in swagger
* Add templateID to document meta type in UI
* add templateID to telegrafPlugin and telegrafplugin info types
* Instantiate templates from static templates
* Get tests to pass
* Fix type conflicts
* Bump templates version
* update changelog
Disables running ESLint through the fork-ts-checker-webpack-plugin in
development, due to its tendency to overuse CPU.
I think this OK since linter errors, unlike typechecking errors, are
usually confined to the file you are working within. So they're a good
fit to run via an editor, rather than the build tool.
* refactor(ui): replace instaces of AutoInput with Clockface
* refactor(ui): delete local AutoInput component
* refactor(ui): ensure null gets passed back when bin count is set to auto
* refactor(ui): convert BinCountInput into a stateless component
* refactor(ui): convert BinCountInput to function component
* Fix editVEO check saving
* Get checks at dashboard load
* Fix check queries type
* save View before saving check in VEOs
* Get checks from checks list for checkPlot
* Add check view properties to backend
* Match Alerting Button to CheckAlertingButton
* Remove thresholds from default check
* Remove explicity declaration of check view type in query views
* Pass check down to CheckPlot
* Fix clashing action calls
* Fix calling check type change action from dispatch
* Only check for checkView if view is defined
* Remove type when spreading new check on to default check
* Fix check edit route in check cards
* Get checks for dashboard earlier
* Clean up getCheckForView selector
* refactor(ui): replace instace of local Form with clockface
* refactor(ui): replace Form in token overlay
* refactor(ui): replace Form in label overlay
* refactor(ui): replace Form in danger overlay
* refactor(ui): delete local form layout components