Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*: s/whitelist/allowlist/, s/blacklist/blocklist/ #49946

Merged
merged 1 commit into from
Jun 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/RFCS/20170628_web_session_login.md
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ for incoming requests, but instead would simply need to verify the signature
on the token.

The major issue with JWT is that it does not provide a way to revoke login
sessions; to do this, we would need to store a blacklist of revoked session IDs,
sessions; to do this, we would need to store a blocklist of revoked session IDs,
which removes much of the advantage of not having the sessions table in the
first place.

Expand Down
2 changes: 1 addition & 1 deletion docs/RFCS/20190318_error_handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -2096,7 +2096,7 @@ To achieve this, the library introduce *error domains*, which are computed attri
its domain and preserves its message, structure, etc.
- domains are preserved across the network.
- a function `EnsureNotInDomain()` (described below) makes it possible to block
errors from one or more “blacklist” domains from escaping an API boundary,
errors from one or more “blocklist” domains from escaping an API boundary,
or conditionally transmute them into appropriate substitute errors,
in particular [barriers](#barriers-Error-barriers).

Expand Down
2 changes: 1 addition & 1 deletion pkg/ccl/partitionccl/partition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ type partitioningTest struct {

// scans are each a shorthand for an assertion of where data should live.
// The map key is the used for the `WHERE` clause of a `SELECT *` and the
// value is a comma separated whitelist of nodes that are allowed to serve
// value is a comma separated allowlist of nodes that are allowed to serve
// this query. Example: `map[string]string{`b = 1`: `n2`}` means that
// `SELECT * FROM t WHERE b = 1` is required to be served entirely by node2.
//
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/cert.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ func runCreateClientCert(cmd *cobra.Command, args []string) error {
var err error
var username string
// We intentionally allow the `node` user to have a cert.
if username, err = sql.NormalizeAndValidateUsernameNoBlacklist(args[0]); err != nil {
if username, err = sql.NormalizeAndValidateUsernameNoBlocklist(args[0]); err != nil {
return errors.Wrap(err, "failed to generate client certificate and key")
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/zip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ SELECT concat('crdb_internal.', table_name) as name
FROM [ SELECT table_name FROM [ SHOW TABLES FROM crdb_internal ] ]
WHERE
table_name NOT IN (
-- whitelisted tables that don't need to be in debug zip
-- allowlisted tables that don't need to be in debug zip
'backward_dependencies',
'builtin_functions',
'create_statements',
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/roachprod/install/cassandra_yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ num_tokens: 256
# May either be "true" or "false" to enable globally
hinted_handoff_enabled: true

# When hinted_handoff_enabled is true, a black list of data centers that will not
# When hinted_handoff_enabled is true, a blocklist of data centers that will not
# perform hinted handoff
# hinted_handoff_disabled_datacenters:
# - DC1
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/roachtest/bank.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,15 +336,15 @@ func isExpectedRelocateError(err error) bool {
// for more failure modes not caught here. We decided to avoid adding
// to this catchall and to fix the root causes instead.
// We've also seen "breaker open" errors here.
whitelist := []string{
allowlist := []string{
"descriptor changed",
"unable to remove replica .* which is not present",
"unable to add replica .* which is already present",
"received invalid ChangeReplicasTrigger .* to remove self",
"failed to apply snapshot: raft group deleted",
"snapshot failed:",
}
pattern := "(" + strings.Join(whitelist, "|") + ")"
pattern := "(" + strings.Join(allowlist, "|") + ")"
return testutils.IsError(err, pattern)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@ import (
)

const githubAPITokenEnv = "GITHUB_API_TOKEN"
const runBlacklistEnv = "RUN_BLACKLIST_TEST"
const runBlocklistEnv = "RUN_BLOCKLIST_TEST"

func TestBlacklists(t *testing.T) {
if _, ok := os.LookupEnv(runBlacklistEnv); !ok {
t.Skipf("Blackist test is only run if %s is set", runBlacklistEnv)
func TestBlocklists(t *testing.T) {
if _, ok := os.LookupEnv(runBlocklistEnv); !ok {
t.Skipf("Blocklist test is only run if %s is set", runBlocklistEnv)
}

blacklists := map[string]blacklist{
"hibernate": hibernateBlackList20_1,
"pgjdbc": pgjdbcBlackList20_1,
"psycopg": psycopgBlackList20_1,
"django": djangoBlacklist20_1,
"sqlAlchemy": sqlAlchemyBlacklist20_1,
"libpq": libPQBlacklist20_1,
"gopg": gopgBlackList20_1,
"pgx": pgxBlacklist20_1,
blocklists := map[string]blocklist{
"hibernate": hibernateBlockList20_1,
"pgjdbc": pgjdbcBlockList20_1,
"psycopg": psycopgBlockList20_1,
"django": djangoBlocklist20_1,
"sqlAlchemy": sqlAlchemyBlocklist20_1,
"libpq": libPQBlocklist20_1,
"gopg": gopgBlockList20_1,
"pgx": pgxBlocklist20_1,
}
type reasonCount struct {
reason string
Expand All @@ -48,7 +48,7 @@ func TestBlacklists(t *testing.T) {
}

var failureMap = make(map[string]*reasonCount, 200)
for suite, bl := range blacklists {
for suite, bl := range blocklists {
for _, reason := range bl {
if _, ok := failureMap[reason]; !ok {
failureMap[reason] = &reasonCount{
Expand Down Expand Up @@ -106,6 +106,6 @@ func TestBlacklists(t *testing.T) {
}

if anyClosed {
t.Fatal("Some closed issues appear in blacklists")
t.Fatal("Some closed issues appear in blocklists")
}
}
32 changes: 16 additions & 16 deletions pkg/cmd/roachtest/canary.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,35 +28,35 @@ import (
// TODO(bram): There are more common elements between all the canary tests,
// factor more of them into here.

// blacklist is a lists of known test errors and failures.
type blacklist map[string]string
// blocklist is a lists of known test errors and failures.
type blocklist map[string]string

// blacklistForVersion contains both a blacklist of known test errors and
// blocklistForVersion contains both a blocklist of known test errors and
// failures but also an optional ignorelist for flaky tests.
// When the test suite is run, the results are compared to this list.
// Any passed test that is not on this blacklist is reported as PASS - expected
// Any passed test that is on this blacklist is reported as PASS - unexpected
// Any failed test that is on this blacklist is reported as FAIL - expected
// Any failed test that is not on blackthis list is reported as FAIL - unexpected
// Any test on this blacklist that is not run is reported as FAIL - not run
// Any passed test that is not on this blocklist is reported as PASS - expected
// Any passed test that is on this blocklist is reported as PASS - unexpected
// Any failed test that is on this blocklist is reported as FAIL - expected
// Any failed test that is not on blocklist list is reported as FAIL - unexpected
// Any test on this blocklist that is not run is reported as FAIL - not run
// Ant test in the ignorelist is reported as SKIP if it is run
type blacklistForVersion struct {
type blocklistForVersion struct {
versionPrefix string
blacklistname string
blacklist blacklist
blocklistname string
blocklist blocklist
ignorelistname string
ignorelist blacklist
ignorelist blocklist
}

type blacklistsForVersion []blacklistForVersion
type blocklistsForVersion []blocklistForVersion

// getLists returns the appropriate blacklist and ignorelist based on the
// getLists returns the appropriate blocklist and ignorelist based on the
// cockroach version. This check only looks to ensure that the prefix that
// matches.
func (b blacklistsForVersion) getLists(version string) (string, blacklist, string, blacklist) {
func (b blocklistsForVersion) getLists(version string) (string, blocklist, string, blocklist) {
for _, info := range b {
if strings.HasPrefix(version, info.versionPrefix) {
return info.blacklistname, info.blacklist, info.ignorelistname, info.ignorelist
return info.blocklistname, info.blocklist, info.ignorelistname, info.ignorelist
}
}
return "", nil, "", nil
Expand Down
10 changes: 5 additions & 5 deletions pkg/cmd/roachtest/django.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,15 @@ func registerDjango(r *testRegistry) {
t.Fatal(err)
}

blacklistName, expectedFailureList, ignoredlistName, ignoredlist := djangoBlacklists.getLists(version)
blocklistName, expectedFailureList, ignoredlistName, ignoredlist := djangoBlocklists.getLists(version)
if expectedFailureList == nil {
t.Fatalf("No django blacklist defined for cockroach version %s", version)
t.Fatalf("No django blocklist defined for cockroach version %s", version)
}
if ignoredlist == nil {
t.Fatalf("No django ignorelist defined for cockroach version %s", version)
}
c.l.Printf("Running cockroach version %s, using blacklist %s, using ignoredlist %s",
version, blacklistName, ignoredlistName)
c.l.Printf("Running cockroach version %s, using blocklist %s, using ignoredlist %s",
version, blocklistName, ignoredlistName)

// TODO (rohany): move this to a file backed buffer if the output becomes
// too large.
Expand All @@ -197,7 +197,7 @@ func registerDjango(r *testRegistry) {
results := newORMTestsResults()
results.parsePythonUnitTestOutput(fullTestResults, expectedFailureList, ignoredlist)
results.summarizeAll(
t, "django" /* ormName */, blacklistName,
t, "django" /* ormName */, blocklistName,
expectedFailureList, version, djangoLatestTag,
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,18 +165,18 @@ var enabledDjangoTests = []string{
"view_tests",
}

var djangoBlacklists = blacklistsForVersion{
{"v19.2", "djangoBlacklist19_2", djangoBlacklist19_2, "djangoIgnoreList19_2", djangoIgnoreList19_2},
{"v20.1", "djangoBlacklist20_1", djangoBlacklist20_1, "djangoIgnoreList20_1", djangoIgnoreList20_1},
{"v20.2", "djangoBlacklist20_2", djangoBlacklist20_2, "djangoIgnoreList20_2", djangoIgnoreList20_2},
var djangoBlocklists = blocklistsForVersion{
{"v19.2", "djangoBlocklist19_2", djangoBlocklist19_2, "djangoIgnoreList19_2", djangoIgnoreList19_2},
{"v20.1", "djangoBlocklist20_1", djangoBlocklist20_1, "djangoIgnoreList20_1", djangoIgnoreList20_1},
{"v20.2", "djangoBlocklist20_2", djangoBlocklist20_2, "djangoIgnoreList20_2", djangoIgnoreList20_2},
}

// Maintain that this list is alphabetized.
var djangoBlacklist20_2 = blacklist{}
var djangoBlocklist20_2 = blocklist{}

var djangoBlacklist20_1 = blacklist{}
var djangoBlocklist20_1 = blocklist{}

var djangoBlacklist19_2 = blacklist{
var djangoBlocklist19_2 = blocklist{
"admin_views.tests.AdminViewBasicTest.test_date_hierarchy_timezone_dst": "unknown",
"admin_views.tests.SecureViewTests.test_secure_view_shows_login_if_not_logged_in": "unknown",
"admin_views.tests.SecureViewTests.test_staff_member_required_decorator_works_with_argument": "unknown",
Expand Down Expand Up @@ -218,8 +218,8 @@ var djangoBlacklist19_2 = blacklist{
//"postgres_tests.test_array.TestOtherTypesExactQuerying.test_exact_decimals": "23468",
}

var djangoIgnoreList20_2 = blacklist{}
var djangoIgnoreList20_2 = blocklist{}

var djangoIgnoreList20_1 = blacklist{}
var djangoIgnoreList20_1 = blocklist{}

var djangoIgnoreList19_2 = blacklist{}
var djangoIgnoreList19_2 = blocklist{}
16 changes: 8 additions & 8 deletions pkg/cmd/roachtest/gopg.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,21 +92,21 @@ func registerGopg(r *testRegistry) {
t.Fatal(err)
}

blacklistName, expectedFailures, ignorelistName, ignorelist := gopgBlacklists.getLists(version)
blocklistName, expectedFailures, ignorelistName, ignorelist := gopgBlocklists.getLists(version)
if expectedFailures == nil {
t.Fatalf("No gopg blacklist defined for cockroach version %s", version)
t.Fatalf("No gopg blocklist defined for cockroach version %s", version)
}
if ignorelist == nil {
t.Fatalf("No gopg ignorelist defined for cockroach version %s", version)
}
c.l.Printf("Running cockroach version %s, using blacklist %s, using ignorelist %s",
version, blacklistName, ignorelistName)
c.l.Printf("Running cockroach version %s, using blocklist %s, using ignorelist %s",
version, blocklistName, ignorelistName)

_ = c.RunE(ctx, node, fmt.Sprintf("mkdir -p %s", resultsDirPath))
t.Status("running gopg test suite")

// go test provides colorful output which - when redirected - interferes
// with matching of the blacklisted tests, so we will strip off all color
// with matching of the blocklisted tests, so we will strip off all color
// code escape sequences.
const removeColorCodes = `sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g"`
// Note that this is expected to return an error, since the test suite
Expand Down Expand Up @@ -145,7 +145,7 @@ func registerGopg(r *testRegistry) {

results.parseJUnitXML(t, expectedFailures, ignorelist, xmlResults)
results.summarizeFailed(
t, "gopg", blacklistName, expectedFailures, version, latestTag,
t, "gopg", blocklistName, expectedFailures, version, latestTag,
0, /* notRunCount */
)
}
Expand All @@ -166,7 +166,7 @@ func registerGopg(r *testRegistry) {
// test suites from gopg ORM tests. TestGinkgo is a test harness that runs
// several test suites described by gopg.
func gormParseTestGinkgoOutput(
r *ormTestsResults, rawResults []byte, expectedFailures, ignorelist blacklist,
r *ormTestsResults, rawResults []byte, expectedFailures, ignorelist blocklist,
) (err error) {
var (
totalRunCount, totalTestCount int
Expand Down Expand Up @@ -265,7 +265,7 @@ func gormParseTestGinkgoOutput(
}
}

// Blacklist contains both the expected failures for "global" tests as well
// Blocklist contains both the expected failures for "global" tests as well
// as TestGinkgo's tests. We need to figure the number of the latter ones.
testGinkgoExpectedFailures := 0
for failure := range expectedFailures {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@

package main

var gopgBlacklists = blacklistsForVersion{
{"v19.2", "gopgBlackList19_2", gopgBlackList19_2, "gopgIgnoreList19_2", gopgIgnoreList19_2},
{"v20.1", "gopgBlackList20_1", gopgBlackList20_1, "gopgIgnoreList20_1", gopgIgnoreList20_1},
{"v20.2", "gopgBlackList20_2", gopgBlackList20_2, "gopgIgnoreList20_2", gopgIgnoreList20_2},
var gopgBlocklists = blocklistsForVersion{
{"v19.2", "gopgBlockList19_2", gopgBlockList19_2, "gopgIgnoreList19_2", gopgIgnoreList19_2},
{"v20.1", "gopgBlockList20_1", gopgBlockList20_1, "gopgIgnoreList20_1", gopgIgnoreList20_1},
{"v20.2", "gopgBlockList20_2", gopgBlockList20_2, "gopgIgnoreList20_2", gopgIgnoreList20_2},
}

// These are lists of known gopg test errors and failures.
Expand All @@ -22,12 +22,12 @@ var gopgBlacklists = blacklistsForVersion{
// Any failed test that is not on this list is reported as FAIL - unexpected.
//
// Please keep these lists alphabetized for easy diffing.
// After a failed run, an updated version of this blacklist should be available
// After a failed run, an updated version of this blocklist should be available
// in the test log.

var gopgBlackList20_2 = gopgBlackList20_1
var gopgBlockList20_2 = gopgBlockList20_1

var gopgBlackList20_1 = blacklist{
var gopgBlockList20_1 = blocklist{
"pg | CopyFrom/CopyTo | copies corrupted data to a table": "41608",
"pg | CopyFrom/CopyTo | copies data from a table and to a table": "41608",
"pg | CountEstimate | works": "17511",
Expand All @@ -47,7 +47,7 @@ var gopgBlackList20_1 = blacklist{
"v9.TestUnixSocket": "31113",
}

var gopgBlackList19_2 = blacklist{
var gopgBlockList19_2 = blocklist{
"pg | CopyFrom/CopyTo | copies corrupted data to a table": "5807",
"pg | CopyFrom/CopyTo | copies data from a table and to a table": "5807",
"pg | CountEstimate | works": "17511",
Expand Down Expand Up @@ -97,7 +97,7 @@ var gopgIgnoreList20_2 = gopgIgnoreList20_1

var gopgIgnoreList20_1 = gopgIgnoreList19_2

var gopgIgnoreList19_2 = blacklist{
var gopgIgnoreList19_2 = blocklist{
// These "fetching" tests assume a particular order when ORDER BY clause is
// omitted from the query by the ORM itself.
"pg | ORM slice model | fetches Book relations": "41690",
Expand Down
8 changes: 4 additions & 4 deletions pkg/cmd/roachtest/hibernate.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ func registerHibernate(r *testRegistry) {
t.Fatal(err)
}

blacklistName, expectedFailures, _, _ := hibernateBlacklists.getLists(version)
blocklistName, expectedFailures, _, _ := hibernateBlocklists.getLists(version)
if expectedFailures == nil {
t.Fatalf("No hibernate blacklist defined for cockroach version %s", version)
t.Fatalf("No hibernate blocklist defined for cockroach version %s", version)
}
c.l.Printf("Running cockroach version %s, using blacklist %s", version, blacklistName)
c.l.Printf("Running cockroach version %s, using blocklist %s", version, blocklistName)

t.Status("running hibernate test suite, will take at least 3 hours")
// When testing, it is helpful to run only a subset of the tests. To do so
Expand Down Expand Up @@ -172,7 +172,7 @@ func registerHibernate(r *testRegistry) {

parseAndSummarizeJavaORMTestsResults(
ctx, t, c, node, "hibernate" /* ormName */, output,
blacklistName, expectedFailures, nil /* ignorelist */, version, latestTag,
blocklistName, expectedFailures, nil /* ignorelist */, version, latestTag,
)
}

Expand Down
Loading