sourcegraph/lib/errors/BUILD.bazel
Robert Lin ba29f2da26
lib/errors: document redaction, upgrade error deps (#53109)
Did you know: all args to `errors.Newf`, `errors.Wrapf`, etc are
considered sensitive, and redacted before errors are reported to Sentry?
That's where all the error reports that look useless come from:

```
x
x
x
x
x
```

This change documents how this works based on cockroachdb error docs,
and also registers a set of arg types that can automatically be
considered safe based on what is configured in cockroachdb itself
(basically most primitive types except string, such as ints for status
codes and whatnot).

Aside: PII is important to consider as we build out multi-tenant
services like Cody Gateway, and important if we want to consider using
nice third-party tools like Honeycomb/Sentry for Cloud instances in the
future.

Related: https://github.com/sourcegraph/sourcegraph/issues/51998

## Test plan


CI
2023-06-09 08:39:40 -07:00

35 lines
792 B
Python
Generated

load("//dev:go_defs.bzl", "go_test")
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "errors",
srcs = [
"cockroach.go",
"errors.go",
"filter.go",
"multi_error.go",
"warning.go",
],
importpath = "github.com/sourcegraph/sourcegraph/lib/errors",
visibility = ["//visibility:public"],
deps = [
"@com_github_cockroachdb_errors//:errors",
"@com_github_cockroachdb_redact//:redact",
],
)
go_test(
name = "errors_test",
timeout = "short",
srcs = [
"errors_test.go",
"filter_test.go",
"warning_test.go",
],
embed = [":errors"],
deps = [
"@com_github_stretchr_testify//assert",
"@com_github_stretchr_testify//require",
],
)