Commit graph

62 commits

Author SHA1 Message Date
Travis Turner
d2856bfeee
Linters! (#2314)
* Add (commented out) linters that we should introduce

I went through the available linters and added (commented out) the ones
I think we should work on in the near term. In other words, fix them,
then uncomment them so they are enabled in CI.

* linter: errchkjson

* linter: ineffassign

* linter: gosimple

* linter: errname
2023-03-10 15:13:15 -06:00
Fletcher Haynes
5c39a49285 Sync from private repo to commit 12d608c80d 2022-12-12 09:01:20 -08:00
Lory Cloutier
b6ae088f24 FB-1766: cleaning up the CmdIO objects passing alternate stdin/
stdout/stderr around

A lot of functions in the cmd and ctl packages were passing these
around and barely using them. Replaced them with a logger for most
functions. Some functions get an io.Writer instead so that their
tests can find the output they're looking for.

More cleanup on fb-1766: reworked the tests that were using io.Pipe
or os.Pipe to check their results so they now use a bytes.Buffer.

Unexported some variables that didn't need to be exported.
Fixed NewConfigCommand to use the provided stderr, not os.Stderr.
Added tests for rbf_dump, rbf_page, and keygen, since those weren't
being tested at all.

Added chksum_test, final cleanup.

(cherry picked from commit f627199acb)
2022-12-12 09:01:20 -08:00
Seebs
3c05f1ff37 Distinguish between usage errors and other errors
Cobra automatically displays usage messages, and also a gratuitous
"Error: [...]" line in some cases, when any error at all occurs
running a command. To suppress the usage message, you have to set
cmd.SilenceUsage to true. But the code that would do this doesn't
have access to it. To address this, we introduce a category of
"usage error", implemented with stdlib error wrapping (%w) and
use errors.Is to check for it. There's also utility functions
to do this checking automatically, or indeed, to handle wrapping
of the ctl.SomethingCommand and handle running it with a suitable
context and everything.

In fact, several of the places we're checking for usage errors,
we can never actually report one, but we're checking consistently
so that if we want to report usage errors, we can.

For instance, server.Start and (dax)server.Start don't ever
return usage errors, right now, but we're checking their responses
anyway.

(cherry picked from commit c681642734)
2022-12-12 09:01:20 -08:00
Garrison Davis
ab2b48da0d Stop using string keys in contexts
This fixes the OriginalIP and RequestUserID in the main featurebase
package, and the Access and Refresh tokens, the UserInfo, and the
[]string of Indexes passed with context.Context(s) in the authn package.

An empty struct was used for all of these keys (and relevant helper
functions we added) to avoid allocations where possible while still
using the context functionality.

Some of the logic in the server.GetIndexes function was fixed.

(cherry picked from commit 0f5a56c958)
2022-11-15 11:32:03 -08:00
Fletcher Haynes
da9b57bd45 Updated dependency paths to reflect new repo location 2022-09-06 09:39:22 -07:00
Fletcher Haynes
eb06bb50ae Updated code to latest version for open-sourcing. 2022-09-02 13:23:39 -07:00
Ben Johnson
c7c9c1e1d7
v2.0.0
Co-authored-by: Cody Soyland <codysoyland@gmail.com>
2019-10-08 14:56:17 -06:00
Cody Soyland
be91ee2103 Copy dependency into project and use pilosa's logger 2019-10-03 09:44:48 -05:00
Matt Jaffee
daa87d8e12
fix staticcheck warnings 2019-01-21 14:24:11 -06:00
Yuce Tekol
fc231ff802
Fixes #1731 2018-11-08 17:01:05 +03:00
Travis Turner
a7a15c64a2
support clear imports to int fields. fix bug in fragment.sum 2018-10-23 17:37:57 -05:00
Travis Turner
caf8e06712
add clear functional option for imports 2018-10-23 17:37:57 -05:00
Yuce Tekol
81f126dd34
Added field options to pilosa import 2018-09-06 17:04:07 +03:00
Yuce Tekol
48bd76b967
Removed --string-keys option from pilosa import 2018-09-05 22:58:23 +03:00
Yuce Tekol
7b872e00cb
Implements #1570 2018-09-05 17:10:56 +03:00
Travis Turner
bf4e2e598b
add support for column keys when importing to int fields 2018-08-15 16:00:31 -05:00
Travis Turner
2f892e5e80
change string-keys DEPRECATED message to REMOVED 2018-08-15 14:55:02 -05:00
Travis Turner
6a327a26fe
add deprecation warnings for --string-keys flag 2018-08-15 10:31:27 -05:00
Travis Turner
862dabe27d
address review comments 2018-08-14 14:37:51 -05:00
Travis Turner
fd96d3a02e
This commit ensures that keyed imports are sent to the coordinator
node (as opposed to sending to shard0, which may or may not be the
coordinator). It adds a `Nodes()` method to the `InternalClient`
which is used by the importer to determine which node is the
coordinator.
2018-08-14 12:34:17 -05:00
Ben Johnson
a31a08c330
Support keys on import CLI. 2018-08-14 09:32:39 -05:00
Cody Soyland
f01d850b17 Fix linter issues: gosimple 2018-07-20 09:06:43 -05:00
Cody Soyland
de99b5720f Fix linter issues: vet 2018-07-19 11:37:50 -05:00
Cody Soyland
187ded0a52 Fix linter issues: maligned 2018-07-19 11:07:59 -05:00
Cody Soyland
eea29f664f Unexport ctl.ImportCommand.Client 2018-07-05 23:11:56 -05:00
Cody Soyland
f9a792ea49 Unexport ctl.ImportCommand.IndexOptions 2018-07-05 23:11:56 -05:00
Cody Soyland
7185c0f791 Unexport ctl.CommandClient 2018-07-05 23:11:56 -05:00
Travis Turner
5dd7a9556a
rename slice to shard 2018-06-28 14:07:07 -05:00
Travis Turner
028e95d914
Allow a single functional option for field options.
Move field type specific validation to functional options.
2018-06-26 10:37:56 -05:00
Travis Turner
50794bf63b
move fieldOptions unmarshal to the handler
validate fieldOptions in http package
2018-06-25 15:14:22 -05:00
Cody Soyland
f2c104dfef Migrate HTTP handler and client into http subpackage. 2018-06-12 13:22:40 -05:00
Travis Turner
2a9b1e9e5b
final Frame to Field rename 2018-06-06 01:27:12 -05:00
Travis Turner
6dbe80350f
GoRename Frame to Field in client.go 2018-06-05 23:02:15 -05:00
Travis Turner
3531c128c4
GoRename Frame to Field in index.go 2018-06-05 22:33:48 -05:00
Travis Turner
1d3c4d6fcb
first pass at GoRename Frame to Field in frame.go 2018-06-05 17:52:22 -05:00
Travis Turner
80d656ae9c
final removal of field instances 2018-06-05 16:56:16 -05:00
Travis Turner
96208283df
remove final instances of Field 2018-06-05 16:38:29 -05:00
Travis Turner
0d44e586cc
remove field flag from pilosa import command 2018-06-05 16:14:26 -05:00
Travis Turner
2111a3d521
more Field removal/rename 2018-06-05 11:13:51 -05:00
Matt Jaffee
4ef266e5cc
revert a bunch of stuff and fix some comments 2018-05-24 16:35:27 -05:00
Todd Gruben
e3da6efe3c revert to old labels on BSI; revert MustSetColumns 2018-05-24 12:48:24 -05:00
Todd Gruben
fb7bf11825 Bit -> Column migration 2018-05-23 15:05:22 -05:00
Alan Bernstein
f5a4fd82b1 Wrap errors in ctl/*.go 2018-05-08 17:10:36 -05:00
Matthew Jaffee
876ed56e30
move pilosa.Config to pilosa/server.Config
step 1 of #1203

The Config object is really just a specification of the options to pilosa
server, so it makes sense to have it in that package.
2018-04-19 14:51:42 -05:00
Travis Turner
d8559ae469
refactor to remove BitK (in favor of Bit) 2018-01-22 15:35:10 -06:00
Travis Turner
a56410a70b
WIP: Modify pilosa import to support string rows/columns
This PR adds a flag `pilosa import --string-keys=true` which treats the
payload CSV as comma separated strings.
2018-01-22 15:34:45 -06:00
Cody Soyland
27748259a2 Fix field value import: Use signed int and respect field minimum. Fixes #875 2017-10-31 13:32:26 -05:00
Yuce Tekol
e201afe241
Replaced all http.Clients with InternalClient; updated InternalClient interface. 2017-10-17 15:53:42 +03:00
Yuce Tekol
aa8cbe8ae3
Add TLS support for commands 2017-10-11 08:30:11 +03:00