Commit Graph

76 Commits (e1d0102a6f990f7ad3d0f2aaf5e19f2c934e64bc)

Author SHA1 Message Date
Dane Strandboge 82d1123e78
build: upgrade to Go 1.18.1 (#23252) 2022-04-13 15:24:27 -05:00
Sam Arnold 5015297d40
fix: more expressive errors (#22448)
* fix: more expressive errors

Closes #22446

* fix: server only logging for untyped errors

* chore: fix formatting
2021-09-13 15:12:35 -04:00
Daniel Moran 01355a068c
refactor: move helper functions for setting up test stores into testing package (#22347)
* Move tenant.Service unit tests into its package
* Delete the top-level TenantService interface now that it's not used.
* Move helper funcs for setting up test stores into testing pkg
* Delete duplicate implementations scattered through the codebase
* Move error assertions into store-creation helpers
2021-08-31 16:43:45 -04:00
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
Sam Arnold 781fa0e846 chore: add goimports 2021-01-29 14:06:52 -05:00
George MacRorie 16d916a952 refactor(kv): delete deprecated kv service code
This includes removal of a lot of kv.Service responsibilities. However,
it does not finish the re-wiring. It removes documents, telegrafs,
notification rules + endpoints, checks, orgs, users, buckets, passwords,
urms, labels and authorizations. There are some oustanding pieces that
are needed to get kv service compiling (dashboard service urm
dependency). Then all the call sites for kv service need updating and
the new implementations of telegraf and notification rules + endpoints
needed installing (along with any necessary migrations).
2020-11-16 12:41:26 +00:00
Daniel Moran 15b9531273
fix: correct various typos (#19987)
Co-authored-by: kumakichi <xyesan@gmail.com>
2020-11-11 13:54:21 -05:00
Adrian Thurston 30ad7281aa
refactor: replace builtin package with fluxinit/static (#3304) (#19909)
A static initialization is not desirable in the main binaries, as it forces all
paths of code to init, but it is still useful in tests. It allows static
intialization to be performed once for all tests and eliminates the need to
always add the FluxInit call. Added a fluxinit/static package that calls
fluxinit.FluxInit() to replace the builtin package. This hides the nature of
the initialization and makes it clear that it is mandatory initialization code
getting called.
2020-11-05 16:54:28 -08:00
Stuart Carnie 7964f86ffc
fix: switch port to 8086
fix(readme): update the port and setup
2020-09-03 14:40:29 -07:00
Lyon Hill 46d4f7d7bb
chore(tenant): point tests to new tenant service (#19477)
Now that the tenant service is complete we should be using it for all
test instead of the kv.Service.
2020-09-02 11:50:26 -06:00
Lyon Hill a8fe07bfc7
chore(task): clean up old maxPermission code (#19432)
Tasks no longer uses the max permission system to pupulate an
authorization. We can safely remove this dead code.
2020-08-26 10:26:32 -06:00
Yiqun (Ethan) Zhang 41156ca646
feat(query): implement window count aggregate pushdown (#18043) 2020-05-28 13:42:38 -05: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
Jonathan A. Sternberg 0ae8bebd75
refactor: rewrite imports to include the /v2 suffix for version 2 2020-04-03 12:39:20 -05: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
Johnny Steenbergen 2b0b32abe8 chore(http): pull out eror handler into kit pkg for portability 2020-02-03 12:39:47 -08:00
Johnny Steenbergen e6f1805e5e chore(inmem): nuke the duplicative inmem store
use kv store... its a thing
2019-12-30 11:04:45 -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
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 552168d3ae
refactor(tasks): use Go time objects for timestamps on task Runs (#15406) 2019-10-17 17:23:45 -07:00
Jonathan A. Sternberg cbd04f2884
refactor: http error serialization matches the new error schema (#15196)
The http error schema has been changed to simplify the outward facing
API. The `op` and `error` attributes have been dropped because they
confused people. The `error` attribute will likely be readded in some
form in the future, but only as additional context and will not be
required or even suggested for the UI to use.

Errors are now output differently both when they are serialized to JSON
and when they are output as strings. The `op` is no longer used if it is
present. It will only appear as an optional attribute if at all. The
`message` attribute for an error is always output and it will be the
prefix for any nested error. When this is serialized to JSON, the
message is automatically flattened so a nested error such as:

    influxdb.Error{
        Msg: errors.New("something bad happened"),
        Err: io.EOF,
    }

This would be written to the message as:

    something bad happened: EOF

This matches a developers expectations much more easily as most
programmers assume that wrapping an error will act as a prefix for the
inner error.

This is flattened when written out to HTTP in order to make this logic
immaterial to a frontend developer.

The code is still present and plays an important role in categorizing
the error type. On the other hand, the code will not be output as part
of the message as it commonly plays a redundant and confusing role when
humans read it. The human readable message usually gives more context
and a message like with the code acting as a prefix is generally not
desired. But, the code plays a very important role in helping to
identify categories of errors and so it is very important as part of the
return response.
2019-09-19 10:06:47 -05:00
Lyon Hill 0b247cce5b
feat(task): Remove token's from task structures (#14712)
* feat(task): Remove token's from task structures

We had previously removed token's from the task api but left the token in place in several locations in the stack.
Now we can cleanly remove the extra tokens.
2019-08-20 08:42:40 -06: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
George b2fe0d1d63
fix(tasks): surface flux errors on pre-auth check (#14492) 2019-07-31 11:46:28 +02: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
Alirie Gray c7f09d6a56
chore(tasks): use pointers for task errors (#14343) 2019-07-15 13:57:51 -07:00
Kelvin Wang 9ecada4dce feat(http): convert errorEncode to use interface 2019-06-26 21:41:01 -04:00
Alirie Gray 66157c9d44 chore(tasks): consolidate task errors into task_errors.go 2019-06-17 16:03:18 -07:00
Alirie Gray 576da8f9d2 fix(swagger): add log property to task runs endpoint docs 2019-05-17 14:08:10 -07:00
Alirie Gray 77934b01c6 feat(tasks): add description field to tasks 2019-05-08 13:39:09 -07:00
Jade McGough c27a96da9a
chore(http): surface unmarshaling failures in tests (#13855) 2019-05-08 12:51:03 -07:00
Kelvin Wang 7a72c363f2 remove org from bucket 2019-04-22 18:39:05 -04:00
Todd Persen cd64ec8718 Fix typos in miscellaneous packages 2019-04-17 13:30:22 -07:00
kelwang be674622c6
Revert "fix(inmem): remove the old inmem implementation" 2019-04-09 14:24:40 -04:00
zhulongcheng cacd6a8223 fix(inmem): replace inmem.Service with kv.Service 2019-04-08 15:18:38 +08: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
zhulongcheng b8a9c9595d feat(http): add task paging links 2019-03-06 15:06:35 +08:00
Lyon Hill 17026c2053
change task logs from a string to a struct (#12363)
* change task logs from a string to a struct
2019-03-05 15:58:33 -07:00
Jorge Landivar 9e6a2247c0
Merge pull request #12134 from zhulongcheng/validate-task-status
fix(http): validate status for creating and updating a task
2019-02-27 13:08:06 -06:00
docmerlin (j. Emrys Landivar) 669c464335 feat(tasks): look up tasks by orgname 2019-02-25 15:57:01 -06:00
zhulongcheng efadd43886 fix(http): validate status for creating and updating a task 2019-02-24 15:34:32 +08:00
Mark Rushakoff f79d9cba4f fix(task): pass task's authorization to query system, if using sessions
The query system specifically expects an Authorization. When a request
comes in using a Session, use the target task's Authorization, if we are
allowed to read it, when executing a query against the system bucket.
2019-02-22 12:50:55 -08:00
Mark Rushakoff 12a604172f fix(task): create authorizations for tasks, which can read their task
Also set the generated token's description while we're here.

This enables us to use task's Authorization when we need to query the
system bucket to get run logs, etc. but we only have a Session.
2019-02-22 09:15:25 -08:00
Lyon Hill 3665feef38
Populate organization name on task create action (#12004)
* Populate organization name on task create action

* Move the responsiblity of organization lookup to the platform adaptor
2019-02-20 13:36:35 -07:00
Mark Rushakoff abd6fee757 fix(task): use HTTP 404 for no results when listing runs, logs 2019-02-19 11:00:43 -08:00
Lyon Hill c7f60271fd
remove task owner from task struct (#11968)
* remove task owner from the payload

* clean user references in store and tests
2019-02-19 11:19:06 -07:00
Mark Rushakoff cbef811c63 refactor(task): remove explicit org from run/log lookup
Task ID is now a required value on run and log filters. It was
effectively required by all implementations before anyway, so now those
types reflect that requirement.

Organization ID was removed from those same fields. The TaskService
looks up the organization ID via the task in cases where we need it at a
lower layer.
2019-02-16 14:34:49 -08:00