Commit Graph

147 Commits (dd34f5fd9d43c87f690baba0927642f1e76befe6)

Author SHA1 Message Date
Sam Arnold 7b2e122869
refactor: refactor for tasks backport (#21117)
* chore: remove dead code

* refactor: move FluxLanguageService interface to fluxlang

* chore: run fmt

* refactor: move task.go from top level to task/taskmodel

* chore: run formatter

* chore: fix up import ordering with gci
2021-04-07 14:42:55 -04:00
Daniel Moran 00afd95cb7
refactor: automated move of errors and id from root to kit (#21101)
Co-authored-by: Sam Arnold <sarnold@influxdata.com>
2021-03-30 14:10:02 -04:00
Daniel Moran 15b9531273
fix: correct various typos (#19987)
Co-authored-by: kumakichi <xyesan@gmail.com>
2020-11-11 13:54:21 -05:00
George 3d643e0681
refactor(notification): move rule service into own package (#19804)
* refactor(notification): move rule service into own package

* chore(launcher): fix tests to use clients as opposed to direct kv service

* chore(influx): update task cli to consume core domain model task from client

* chore(kv): remove rule service behaviours from kv

This also introduces the org id resolver type. Which is transplanted
from the kv service. As this one function coupled all resource
capabilities onto the kv service. Making removing these capabilities
impossible. Moving this type out into its own package which depends on
each service explicitly ensures we don't have one type which has to
implement all the service contracts.

* fix(launcher): remove double reference to influxdb package
2020-10-27 11:45:05 +00:00
Brett Buddin 8c0643843f
chore(http): Let the callers convert these to http.Handler. 2020-05-08 09:02:06 -04:00
Brett Buddin 9e8f5a27bc
fix(http): Make common wrapper function capable of handling nil-valued proxies.
Pipeline tests in idpe are setting up an `http.APIBackend` directly
without a constructor function. This is causing this `AlgoWProxy` field
to be `nil` when exercising end-to-end tests. This just makes the
structure a bit more defensive and falls back to using the no-op proxy
in the presence of a nil value.
2020-05-06 13:04:31 -04:00
Brett Buddin c5c4e71dbd
feat(http): Add ability to proxy specific API handlers for Algo-W rollout. 2020-05-06 12:30:05 -04:00
Johnny Steenbergen d1af15c399 chore: remove extranenous fields on http.Task type
also drops a skipped test that has been skipped for over a year. Tried
unskipping it, but now it fails for all sorts of reasons, without the
race flag enabled.
2020-04-20 15:34:58 -07:00
Jonathan A. Sternberg 0ae8bebd75
refactor: rewrite imports to include the /v2 suffix for version 2 2020-04-03 12:39:20 -05:00
Alirie Gray 991002d83b
fix(labels): add check for write permissions to create label (#17174) 2020-03-12 10:51:50 -07:00
Jonathan A. Sternberg 834a8740e0
refactor(task/backend): move the task/backend constants to the global package (#17133)
This moves a few types and constants to the global package so it can be
used without importing the `task/backend` package. These constants are
referenced in non tasks-specific code.

This is needed to break a dependency chain where the task backend will
call into the flux runtime to perform parsing or evaluation of a script
and to prevent the http package from inheriting that dependency.
2020-03-06 16:19:32 -06:00
Alirie Gray 3120b4c47e
refactor(tasks): add Client to http TaskService (#16912) 2020-02-24 11:41:21 -08:00
Alirie Gray 4ad9e6b6b5
fix(tasks): add content length check to decode force run request (#16458) 2020-01-08 18:55:42 -08:00
Johnny Steenbergen 8729cd0959 chore(http): refactor api handler take advantage of route tree instead of switch statement
is very much WIP at this point
2019-12-11 09:53:29 -08:00
Jacob Marble 5f19c6cace
chore: Remove several instances of WithLogger (#15996)
* chore: Remove several instances of WithLogger

* chore: unexport Logger fields

* chore: unexport some more Logger fields

* chore: go fmt

chore: fix test

chore: s/logger/log

chore: fix test

chore: revert http.Handler.Handler constructor initialization

* refactor: integrate review feedback, fix all test nop loggers

* refactor: capitalize all log messages

* refactor: rename two logger to log
2019-12-04 15:10:23 -08:00
Alirie Gray 9417936069
feat(tasks): add ability to filter by active tasks (#15893) 2019-12-02 14:16:10 -08:00
George 3dbb9c0fd2
feat(tracing): dont trace spans with full request paths as operation name in ExtractFromHTTPRequest (#15971)
* feat(tracing): dont trace spans with full URL path names in ExtractFromHTTPRequest

* chore(multiple): replace all occurrences of julienschmidt/httprouter with influxdata/httprouter
2019-11-25 15:22:19 +01:00
Alirie Gray f0ecc0e89d
refactor(tasks): use go Time for Task CreatedAt, UpdatedAt, LatestCompleted, Offset (#15672) 2019-11-12 17:13:56 -08:00
Lyon Hill bb6aa1df3b
feat(task): Add a latestScheduled field for tasks (#15785)
Previously we overwrote the tasks existing latestCompleted to be used for latestCompleted as well as latestScheduled.
For obvious reasons this is confusing and missleading. I believe by seperating the two fields we can have a clear seperation
of concerns.
2019-11-06 15:10:52 -07:00
Gavin Cabbage 6fb8a67ff8
fix(api): change task ID runs success status from 200 to 201 2019-10-26 00:16:48 -04:00
Alirie Gray a8f5e5ba19
fix(tasks): create API facing interface for task runs (#15539) 2019-10-22 15:35:47 -07:00
Lyon Hill 3c6779f011
feat(task): Allow tasks to run more isolated from other task systems (#15384)
* feat(task): Allow tasks to run more isolated from other task systems

To allow the task internal system to be used for user created tasks as well
as checks, notification and other future additions we needed to take 2 actions:

1 - We need to use type as a first class citizen, meaning that task's have a type
and each system that will be creating tasks will set the task type through the api.
This is a change to the previous assumption that any user could set task types. This change
will allow us to have other service's white label the task service for their own purposes and not
have to worry about colissions between the types.

2 - We needed to allow other systems to add data specific to the problem they are trying to solve.
For this purpose adding a `metadata` field to the internal task system which should allow other systems to
use the task service.

These changes will allow us in the future to allow for the current check's and notifications implementations
to create a task with meta data instead of creating a check object and a task object in the database.
By allowing this new behavior checks, notifications, and user task's can all follow the same pattern:

Field an api request in a system specific http endpoint, use a small translation to the `TaskService` function call,
translate the results to what the api expects for this system, and return results.

* fix(task): undo additional check for ownerID because check is not ready
2019-10-11 08:53:38 -06:00
Johnny Steenbergen fc955c5abe chore(http): remove logging of senstive data
after discussion with team, dropping the request logging was decided on.
2019-09-25 09:49:09 -07:00
docmerlin (j. Emrys Landivar) 19fe098888 chore(ci): update go-tools 2019-08-22 10:55:05 -05:00
Alirie Gray 28089fdb59 feat(tasks): add ability to find tasks by name 2019-08-16 12:07:11 -07:00
Lyon Hill a8d7870689
feat(task): impersonate user on task execution (#14675)
* 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.
2019-08-15 18:31:52 -06:00
Lyon Hill e922c8a26f
feat(task): add task types (#14567) 2019-08-06 10:27:52 -06:00
zhulongcheng 17de20e80f fix(task): check ErrTaskNotFound err (#14489) 2019-08-06 10:17:30 -06:00
George b2fe0d1d63
fix(tasks): surface flux errors on pre-auth check (#14492) 2019-07-31 11:46:28 +02:00
Alirie Gray 7b96bd95f0 test(tasks): fix cypress tests for task creation with token 2019-07-26 09:51:33 -07:00
Alirie Gray c04f3a2b30 chore(tasks): remove old auth code and allow only token auth 2019-07-26 09:51:32 -07:00
Jorge Landivar 47cd6df834 fix(http): task runs and logs no longer use task token (#14416)
* fix(http): task runs and logs no longer use task token

* test(http): skip session tests

These tests are not using checking authorization correctly.
2019-07-23 10:31:39 -05:00
kelwang 99bfd05820
Merge pull request #14339 from influxdata/add_debug_log
feat(http): add auth debug log
2019-07-15 17:08:41 -04:00
Alirie Gray c7f09d6a56
chore(tasks): use pointers for task errors (#14343) 2019-07-15 13:57:51 -07:00
Kelvin Wang f55cf4c8b3 feat(http): add auth debug log 2019-07-15 12:09:59 -04:00
Kelvin Wang 9ecada4dce feat(http): convert errorEncode to use interface 2019-06-26 21:41:01 -04:00
Chris Goller 14e7daa6e4
fix client tracing propagation from doubly recording (#14204)
Closes #14203

* chore(vendor): update to opentracing 1.1.0

* fix(http): finish client span

* fix(http): remove extra span injection
2019-06-26 00:48:15 -05:00
Alirie Gray 66157c9d44 chore(tasks): consolidate task errors into task_errors.go 2019-06-17 16:03:18 -07:00
Alirie Gray 0ae2d318b1 chore(tasks): update run limits in swagger and FindRuns 2019-06-12 14:48:32 -07:00
Christopher M. Wolff c35c15f54d
refactor(http): move queryd http interface to idpe (#13862) 2019-05-09 10:41:14 -07:00
jlapacik fb47b8cd42 fix(http): use lang.Compile 2019-04-12 07:15:27 -07:00
Jade McGough 7bcff2e973 fix(http): remove newPatchLabelHandler, it should not exist
This was removed in the labels 2.0 rewrite, and looks like it was added back as a regression
2019-03-27 14:31:04 -07:00
Mark Rushakoff 3092faace8 test(task): ensure task can be created over HTTP using org name
Closes #12089.
2019-03-14 21:23:14 -07:00
Kelvin Wang dcc052b1c2 fix(query): fix same bucket name with different orgs 2019-03-08 20:37:05 -05:00
Jacob Marble 603a1f26e0 use tracing.StartSpanFromContext 2019-03-07 12:12:31 -07:00
Jacob Marble 9541e861a3 goimports -w -local github.com/influxdata/influxdb 2019-03-07 12:12:31 -07:00
Jacob Marble 92fa813c45 add spans to multiple services 2019-03-07 12:12:31 -07:00
Jorge Landivar 2d0ba57f4b
Merge pull request #12387 from zhulongcheng/task-paging
feat(http): add task paging links
2019-03-07 01:49:29 -06:00
Palak Bhojani ef440615e6 Update response to include event object for LogEvent type
Co-authored-by: Alex Paxton <thealexpaxton@gmail.com>
Co-authored-by: Chris Goller
2019-03-06 16:01:47 -08:00
zhulongcheng b8a9c9595d feat(http): add task paging links 2019-03-06 15:06:35 +08:00