From 394d093a06764c9c151695ede2bcab0f7eaa5962 Mon Sep 17 00:00:00 2001 From: Jordan Lewis Date: Sat, 6 Jun 2020 23:04:20 -0400 Subject: [PATCH] *: s/whitelist/allowlist/, s/blacklist/blocklist/ Allow and block aren't hurtful terms, and they also happen to be clearer than white and black - they connote meaning instantly. c.f.: https://twitter.com/bradfitz/status/1269449722063773696?s=20 https://github.com/rails/rails/issues/33677 https://gitlab.com/gitlab-org/gitlab/-/issues/7554 https://github.com/lagom/lagom/issues/2532 https://bugs.chromium.org/p/chromium/issues/detail?id=981129 Release note: None --- docs/RFCS/20170628_web_session_login.md | 2 +- docs/RFCS/20190318_error_handling.md | 2 +- pkg/ccl/partitionccl/partition_test.go | 2 +- pkg/cli/cert.go | 2 +- pkg/cli/zip_test.go | 2 +- pkg/cmd/roachprod/install/cassandra_yaml.go | 2 +- pkg/cmd/roachtest/bank.go | 4 +- .../{blacklist_test.go => blocklist_test.go} | 30 ++++++------- pkg/cmd/roachtest/canary.go | 32 +++++++------- pkg/cmd/roachtest/django.go | 10 ++--- ...jango_blacklist.go => django_blocklist.go} | 20 ++++----- pkg/cmd/roachtest/gopg.go | 16 +++---- .../{gopg_blacklist.go => gopg_blocklist.go} | 18 ++++---- pkg/cmd/roachtest/hibernate.go | 8 ++-- ...te_blacklist.go => hibernate_blocklist.go} | 30 ++++++------- pkg/cmd/roachtest/java_helpers.go | 12 +++--- pkg/cmd/roachtest/libpq.go | 8 ++-- ...{libpq_blacklist.go => libpq_blocklist.go} | 16 +++---- pkg/cmd/roachtest/orm_helpers.go | 20 ++++----- pkg/cmd/roachtest/pgjdbc.go | 12 +++--- ...gjdbc_blacklist.go => pgjdbc_blocklist.go} | 30 ++++++------- pkg/cmd/roachtest/pgx.go | 14 +++---- .../{pgx_blacklist.go => pgx_blocklist.go} | 20 ++++----- pkg/cmd/roachtest/psycopg.go | 10 ++--- ...copg_blacklist.go => psycopg_blocklist.go} | 24 +++++------ pkg/cmd/roachtest/python_helpers.go | 2 +- pkg/cmd/roachtest/sqlalchemy.go | 10 ++--- ...y_blacklist.go => sqlalchemy_blocklist.go} | 20 ++++----- pkg/kv/kvserver/client_split_test.go | 12 +++--- pkg/kv/kvserver/replica_application_result.go | 26 ++++++------ pkg/kv/kvserver/replica_command.go | 4 +- pkg/kv/kvserver/replica_evaluate.go | 2 +- pkg/kv/kvserver/replica_proposal.go | 2 +- pkg/kv/kvserver/replica_read.go | 2 +- pkg/kv/kvserver/track_raft_protos.go | 10 ++--- pkg/server/authentication_test.go | 2 +- pkg/server/server_sql_test.go | 2 +- pkg/sql/create_role.go | 10 ++--- pkg/sql/distsql_physical_planner.go | 6 +-- pkg/sql/logictest/logic.go | 42 +++++++++---------- pkg/sql/opt/memo/expr.go | 2 +- pkg/sql/opt/norm/fold_constants_funcs.go | 10 ++--- pkg/sql/opt/optbuilder/builder.go | 2 +- pkg/sql/parser/scan.go | 4 +- pkg/sql/schema_changer.go | 10 ++--- pkg/sql/schema_changer_test.go | 4 +- pkg/sql/sem/builtins/builtins.go | 12 +++--- pkg/sql/sem/builtins/pg_builtins.go | 16 +++---- pkg/sql/sem/tree/expr.go | 6 +-- pkg/sql/sem/tree/function_definition.go | 6 +-- pkg/sql/telemetry_test.go | 30 ++++++------- pkg/sql/testdata/telemetry/error | 2 +- pkg/sql/testdata/telemetry/planning | 14 +++---- pkg/sql/testdata/telemetry/schema | 2 +- pkg/testutils/buildutil/build.go | 18 ++++---- pkg/workload/cli/cli.go | 6 +-- pkg/workload/dep_test.go | 4 +- 57 files changed, 323 insertions(+), 323 deletions(-) rename pkg/cmd/roachtest/{blacklist_test.go => blocklist_test.go} (79%) rename pkg/cmd/roachtest/{django_blacklist.go => django_blocklist.go} (94%) rename pkg/cmd/roachtest/{gopg_blacklist.go => gopg_blocklist.go} (93%) rename pkg/cmd/roachtest/{hibernate_blacklist.go => hibernate_blocklist.go} (99%) rename pkg/cmd/roachtest/{libpq_blacklist.go => libpq_blocklist.go} (92%) rename pkg/cmd/roachtest/{pgjdbc_blacklist.go => pgjdbc_blocklist.go} (99%) rename pkg/cmd/roachtest/{pgx_blacklist.go => pgx_blocklist.go} (94%) rename pkg/cmd/roachtest/{psycopg_blacklist.go => psycopg_blocklist.go} (99%) rename pkg/cmd/roachtest/{sqlalchemy_blacklist.go => sqlalchemy_blocklist.go} (97%) diff --git a/docs/RFCS/20170628_web_session_login.md b/docs/RFCS/20170628_web_session_login.md index 3ab394837318..e722dc1c2073 100644 --- a/docs/RFCS/20170628_web_session_login.md +++ b/docs/RFCS/20170628_web_session_login.md @@ -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. diff --git a/docs/RFCS/20190318_error_handling.md b/docs/RFCS/20190318_error_handling.md index f5a3bf06bbd9..83ff3b96548c 100644 --- a/docs/RFCS/20190318_error_handling.md +++ b/docs/RFCS/20190318_error_handling.md @@ -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). diff --git a/pkg/ccl/partitionccl/partition_test.go b/pkg/ccl/partitionccl/partition_test.go index 84ca48091c0f..09dc05af611e 100644 --- a/pkg/ccl/partitionccl/partition_test.go +++ b/pkg/ccl/partitionccl/partition_test.go @@ -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. // diff --git a/pkg/cli/cert.go b/pkg/cli/cert.go index ef054f3ced2a..2997d3f83f7c 100644 --- a/pkg/cli/cert.go +++ b/pkg/cli/cert.go @@ -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") } diff --git a/pkg/cli/zip_test.go b/pkg/cli/zip_test.go index 45f8b5fc4fde..3e6489e22c04 100644 --- a/pkg/cli/zip_test.go +++ b/pkg/cli/zip_test.go @@ -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', diff --git a/pkg/cmd/roachprod/install/cassandra_yaml.go b/pkg/cmd/roachprod/install/cassandra_yaml.go index d14346f61cf6..1676bd8c87b6 100644 --- a/pkg/cmd/roachprod/install/cassandra_yaml.go +++ b/pkg/cmd/roachprod/install/cassandra_yaml.go @@ -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 diff --git a/pkg/cmd/roachtest/bank.go b/pkg/cmd/roachtest/bank.go index a817446daadb..89ae1310de41 100644 --- a/pkg/cmd/roachtest/bank.go +++ b/pkg/cmd/roachtest/bank.go @@ -336,7 +336,7 @@ 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", @@ -344,7 +344,7 @@ func isExpectedRelocateError(err error) bool { "failed to apply snapshot: raft group deleted", "snapshot failed:", } - pattern := "(" + strings.Join(whitelist, "|") + ")" + pattern := "(" + strings.Join(allowlist, "|") + ")" return testutils.IsError(err, pattern) } diff --git a/pkg/cmd/roachtest/blacklist_test.go b/pkg/cmd/roachtest/blocklist_test.go similarity index 79% rename from pkg/cmd/roachtest/blacklist_test.go rename to pkg/cmd/roachtest/blocklist_test.go index 1fad6dec5796..8cf6e35e59ac 100644 --- a/pkg/cmd/roachtest/blacklist_test.go +++ b/pkg/cmd/roachtest/blocklist_test.go @@ -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 @@ -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{ @@ -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") } } diff --git a/pkg/cmd/roachtest/canary.go b/pkg/cmd/roachtest/canary.go index 8c0e823b7a09..350e0bb9cc5e 100644 --- a/pkg/cmd/roachtest/canary.go +++ b/pkg/cmd/roachtest/canary.go @@ -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 diff --git a/pkg/cmd/roachtest/django.go b/pkg/cmd/roachtest/django.go index 67895192558a..4d5d4746d260 100644 --- a/pkg/cmd/roachtest/django.go +++ b/pkg/cmd/roachtest/django.go @@ -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. @@ -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, ) } diff --git a/pkg/cmd/roachtest/django_blacklist.go b/pkg/cmd/roachtest/django_blocklist.go similarity index 94% rename from pkg/cmd/roachtest/django_blacklist.go rename to pkg/cmd/roachtest/django_blocklist.go index 26790e01ad39..bd465f57d101 100644 --- a/pkg/cmd/roachtest/django_blacklist.go +++ b/pkg/cmd/roachtest/django_blocklist.go @@ -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", @@ -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{} diff --git a/pkg/cmd/roachtest/gopg.go b/pkg/cmd/roachtest/gopg.go index a2ab7c975bdf..f40c4312d9b4 100644 --- a/pkg/cmd/roachtest/gopg.go +++ b/pkg/cmd/roachtest/gopg.go @@ -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 @@ -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 */ ) } @@ -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 @@ -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 { diff --git a/pkg/cmd/roachtest/gopg_blacklist.go b/pkg/cmd/roachtest/gopg_blocklist.go similarity index 93% rename from pkg/cmd/roachtest/gopg_blacklist.go rename to pkg/cmd/roachtest/gopg_blocklist.go index aae504c63ca8..7fb30add732e 100644 --- a/pkg/cmd/roachtest/gopg_blacklist.go +++ b/pkg/cmd/roachtest/gopg_blocklist.go @@ -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. @@ -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", @@ -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", @@ -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", diff --git a/pkg/cmd/roachtest/hibernate.go b/pkg/cmd/roachtest/hibernate.go index 51a9bb3a6774..5a89a932eee9 100644 --- a/pkg/cmd/roachtest/hibernate.go +++ b/pkg/cmd/roachtest/hibernate.go @@ -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 @@ -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, ) } diff --git a/pkg/cmd/roachtest/hibernate_blacklist.go b/pkg/cmd/roachtest/hibernate_blocklist.go similarity index 99% rename from pkg/cmd/roachtest/hibernate_blacklist.go rename to pkg/cmd/roachtest/hibernate_blocklist.go index 1a65feab8bce..656fe4791b14 100644 --- a/pkg/cmd/roachtest/hibernate_blacklist.go +++ b/pkg/cmd/roachtest/hibernate_blocklist.go @@ -10,26 +10,26 @@ package main -var hibernateBlacklists = blacklistsForVersion{ - {"v2.0", "hibernateBlackList2_0", hibernateBlackList2_0, "", nil}, - {"v2.1", "hibernateBlackList2_1", hibernateBlackList2_1, "", nil}, - {"v2.2", "hibernateBlackList19_1", hibernateBlackList19_1, "", nil}, - {"v19.1", "hibernateBlackList19_1", hibernateBlackList19_1, "", nil}, - {"v19.2", "hibernateBlackList19_2", hibernateBlackList19_2, "", nil}, - {"v20.1", "hibernateBlackList20_1", hibernateBlackList20_1, "", nil}, - {"v20.2", "hibernateBlackList20_2", hibernateBlackList20_2, "", nil}, +var hibernateBlocklists = blocklistsForVersion{ + {"v2.0", "hibernateBlockList2_0", hibernateBlockList2_0, "", nil}, + {"v2.1", "hibernateBlockList2_1", hibernateBlockList2_1, "", nil}, + {"v2.2", "hibernateBlockList19_1", hibernateBlockList19_1, "", nil}, + {"v19.1", "hibernateBlockList19_1", hibernateBlockList19_1, "", nil}, + {"v19.2", "hibernateBlockList19_2", hibernateBlockList19_2, "", nil}, + {"v20.1", "hibernateBlockList20_1", hibernateBlockList20_1, "", nil}, + {"v20.2", "hibernateBlockList20_2", hibernateBlockList20_2, "", nil}, } // 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 hibernateBlackList20_2 = blacklist{} +var hibernateBlockList20_2 = blocklist{} -var hibernateBlackList20_1 = blacklist{} +var hibernateBlockList20_1 = blocklist{} -var hibernateBlackList19_2 = blacklist{} +var hibernateBlockList19_2 = blocklist{} -var hibernateBlackList19_1 = blacklist{ +var hibernateBlockList19_1 = blocklist{ "org.hibernate.jpa.test.criteria.QueryBuilderTest.testDateTimeFunctions": "31708", "org.hibernate.jpa.test.indetifier.AssignedInitialValueTableGeneratorConfiguredTest.testTheFirstGeneratedIdIsEqualToTableGeneratorInitialValuePlusOne": "6583", "org.hibernate.jpa.test.indetifier.AssignedInitialValueTableGeneratorConfiguredTest.testTheGeneratedIdValuesAreCorrect": "6583", @@ -125,7 +125,7 @@ var hibernateBlackList19_1 = blacklist{ "org.hibernate.test.tool.schema.SchemaToolTransactionHandlingTest.testValidateInExistingJtaTransaction": "16769", } -var hibernateBlackList2_1 = blacklist{ +var hibernateBlockList2_1 = blocklist{ "org.hibernate.id.hhh12973.SequenceMismatchStrategyDefaultExceptionTest.test": "unknown", "org.hibernate.id.hhh12973.SequenceMismatchStrategyExceptionEnumTest.test": "unknown", "org.hibernate.id.hhh12973.SequenceMismatchStrategyFixWithSequenceGeneratorTest.test": "unknown", @@ -246,7 +246,7 @@ var hibernateBlackList2_1 = blacklist{ "org.hibernate.test.tool.schema.SchemaToolTransactionHandlingTest.testValidateInExistingJtaTransaction": "16769", } -var hibernateBlackList2_0 = blacklist{ +var hibernateBlockList2_0 = blocklist{ "org.hibernate.engine.spi.ExtraStateTest.shouldMaintainExtraStateWhenUsingIdentityIdGenerationStrategy": "unknown", "org.hibernate.event.EmbeddableCallbackTest.test": "unknown", "org.hibernate.id.CreateDeleteTest.createAndDeleteAnEntityInTheSameTransactionTest": "unknown", diff --git a/pkg/cmd/roachtest/java_helpers.go b/pkg/cmd/roachtest/java_helpers.go index c313ab26c12e..2e017942645a 100644 --- a/pkg/cmd/roachtest/java_helpers.go +++ b/pkg/cmd/roachtest/java_helpers.go @@ -114,7 +114,7 @@ func extractFailureFromJUnitXML(contents []byte) ([]string, []status, map[string // parseJUnitXML parses testOutputInJUnitXMLFormat and updates the receiver // accordingly. func (r *ormTestsResults) parseJUnitXML( - t *test, expectedFailures, ignorelist blacklist, testOutputInJUnitXMLFormat []byte, + t *test, expectedFailures, ignorelist blocklist, testOutputInJUnitXMLFormat []byte, ) { tests, statuses, issueHints, err := extractFailureFromJUnitXML(testOutputInJUnitXMLFormat) if err != nil { @@ -170,7 +170,7 @@ func (r *ormTestsResults) parseJUnitXML( // parseAndSummarizeJavaORMTestsResults parses the test output of running a // test suite for some Java ORM against cockroach and summarizes it. If an // unexpected result is observed (for example, a test unexpectedly failed or -// passed), a new blacklist is populated. +// passed), a new blocklist is populated. func parseAndSummarizeJavaORMTestsResults( ctx context.Context, t *test, @@ -178,9 +178,9 @@ func parseAndSummarizeJavaORMTestsResults( node nodeListOption, ormName string, testOutput []byte, - blacklistName string, - expectedFailures blacklist, - ignorelist blacklist, + blocklistName string, + expectedFailures blocklist, + ignorelist blocklist, version string, latestTag string, ) { @@ -214,6 +214,6 @@ func parseAndSummarizeJavaORMTestsResults( } results.summarizeAll( - t, ormName, blacklistName, expectedFailures, version, latestTag, + t, ormName, blocklistName, expectedFailures, version, latestTag, ) } diff --git a/pkg/cmd/roachtest/libpq.go b/pkg/cmd/roachtest/libpq.go index cc3776581bb4..c71c8b829616 100644 --- a/pkg/cmd/roachtest/libpq.go +++ b/pkg/cmd/roachtest/libpq.go @@ -81,11 +81,11 @@ func registerLibPQ(r *testRegistry) { _ = c.RunE(ctx, node, fmt.Sprintf("mkdir -p %s", resultsDir)) - blacklistName, expectedFailures, ignorelistName, ignoredFailures := libPQBlacklists.getLists(version) + blocklistName, expectedFailures, ignorelistName, ignoredFailures := libPQBlocklists.getLists(version) if expectedFailures == nil { - t.Fatalf("No lib/pq blacklist defined for cockroach version %s", version) + t.Fatalf("No lib/pq blocklist 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) t.Status("running lib/pq test suite and collecting results") @@ -98,7 +98,7 @@ func registerLibPQ(r *testRegistry) { parseAndSummarizeJavaORMTestsResults( ctx, t, c, node, "lib/pq" /* ormName */, []byte(resultsPath), - blacklistName, expectedFailures, ignoredFailures, version, latestTag, + blocklistName, expectedFailures, ignoredFailures, version, latestTag, ) } diff --git a/pkg/cmd/roachtest/libpq_blacklist.go b/pkg/cmd/roachtest/libpq_blocklist.go similarity index 92% rename from pkg/cmd/roachtest/libpq_blacklist.go rename to pkg/cmd/roachtest/libpq_blocklist.go index 30004c14f3ae..de54eafca864 100644 --- a/pkg/cmd/roachtest/libpq_blacklist.go +++ b/pkg/cmd/roachtest/libpq_blocklist.go @@ -10,15 +10,15 @@ package main -var libPQBlacklists = blacklistsForVersion{ - {"v19.2", "libPQBlacklist19_2", libPQBlacklist19_2, "libPQIgnorelist19_2", libPQIgnorelist19_2}, - {"v20.1", "libPQBlacklist20_1", libPQBlacklist20_1, "libPQIgnorelist20_1", libPQIgnorelist20_1}, - {"v20.2", "libPQBlacklist20_2", libPQBlacklist20_2, "libPQIgnorelist20_2", libPQIgnorelist20_2}, +var libPQBlocklists = blocklistsForVersion{ + {"v19.2", "libPQBlocklist19_2", libPQBlocklist19_2, "libPQIgnorelist19_2", libPQIgnorelist19_2}, + {"v20.1", "libPQBlocklist20_1", libPQBlocklist20_1, "libPQIgnorelist20_1", libPQIgnorelist20_1}, + {"v20.2", "libPQBlocklist20_2", libPQBlocklist20_2, "libPQIgnorelist20_2", libPQIgnorelist20_2}, } -var libPQBlacklist20_2 = libPQBlacklist20_1 +var libPQBlocklist20_2 = libPQBlocklist20_1 -var libPQBlacklist20_1 = blacklist{ +var libPQBlocklist20_1 = blocklist{ "pq.TestBinaryByteSliceToInt": "41547", "pq.TestBinaryByteSlicetoUUID": "41547", "pq.TestByteaOutputFormats": "26947", @@ -53,7 +53,7 @@ var libPQBlacklist20_1 = blacklist{ "pq.TestStringWithNul": "26366", } -var libPQBlacklist19_2 = blacklist{ +var libPQBlocklist19_2 = blocklist{ "pq.TestBinaryByteSliceToInt": "41547", "pq.TestBinaryByteSlicetoUUID": "41547", "pq.TestBindError": "5807", @@ -105,7 +105,7 @@ var libPQIgnorelist20_2 = libPQIgnorelist20_1 var libPQIgnorelist20_1 = libPQIgnorelist19_2 -var libPQIgnorelist19_2 = blacklist{ +var libPQIgnorelist19_2 = blocklist{ // TestFormatTsBacked fails due to not returning an error for accepting a // timestamp format that postgres does not. "pq.TestFormatTsBackend": "41690", diff --git a/pkg/cmd/roachtest/orm_helpers.go b/pkg/cmd/roachtest/orm_helpers.go index e0975156d9da..4af7759738dd 100644 --- a/pkg/cmd/roachtest/orm_helpers.go +++ b/pkg/cmd/roachtest/orm_helpers.go @@ -114,9 +114,9 @@ func newORMTestsResults() *ormTestsResults { // summarizeAll summarizes the result of running an ORM or a driver test suite // against a cockroach node. If an unexpected result is observed (for example, -// a test unexpectedly failed or passed), a new blacklist is populated. +// a test unexpectedly failed or passed), a new blocklist is populated. func (r *ormTestsResults) summarizeAll( - t *test, ormName, blacklistName string, expectedFailures blacklist, version, latestTag string, + t *test, ormName, blocklistName string, expectedFailures blocklist, version, latestTag string, ) { // Collect all the tests that were not run. notRunCount := 0 @@ -142,7 +142,7 @@ func (r *ormTestsResults) summarizeAll( t.l.Printf("------------------------\n") r.summarizeFailed( - t, ormName, blacklistName, expectedFailures, version, latestTag, notRunCount, + t, ormName, blocklistName, expectedFailures, version, latestTag, notRunCount, ) } @@ -152,8 +152,8 @@ func (r *ormTestsResults) summarizeAll( // If a test suite outputs only the failures, then this method should be used. func (r *ormTestsResults) summarizeFailed( t *test, - ormName, blacklistName string, - expectedFailures blacklist, + ormName, blocklistName string, + expectedFailures blocklist, version, latestTag string, notRunCount int, ) { @@ -193,11 +193,11 @@ func (r *ormTestsResults) summarizeFailed( if r.failUnexpectedCount > 0 || r.passUnexpectedCount > 0 || notRunCount > 0 || r.unexpectedSkipCount > 0 { - // Create a new blacklist so we can easily update this test. + // Create a new blocklist so we can easily update this test. sort.Strings(r.currentFailures) var b strings.Builder - fmt.Fprintf(&b, "Here is new %s blacklist that can be used to update the test:\n\n", ormName) - fmt.Fprintf(&b, "var %s = blacklist{\n", blacklistName) + fmt.Fprintf(&b, "Here is new %s blocklist that can be used to update the test:\n\n", ormName) + fmt.Fprintf(&b, "var %s = blocklist{\n", blocklistName) for _, test := range r.currentFailures { issue := expectedFailures[test] if len(issue) == 0 || issue == "unknown" { @@ -211,9 +211,9 @@ func (r *ormTestsResults) summarizeFailed( fmt.Fprintf(&b, "}\n\n") t.l.Printf("\n\n%s\n\n", b.String()) t.l.Printf("------------------------\n") - t.Fatalf("\n%s\nAn updated blacklist (%s) is available in the artifacts' %s log\n", + t.Fatalf("\n%s\nAn updated blocklist (%s) is available in the artifacts' %s log\n", bResults.String(), - blacklistName, + blocklistName, ormName, ) } diff --git a/pkg/cmd/roachtest/pgjdbc.go b/pkg/cmd/roachtest/pgjdbc.go index e295e4950731..5782dc8adff6 100644 --- a/pkg/cmd/roachtest/pgjdbc.go +++ b/pkg/cmd/roachtest/pgjdbc.go @@ -117,14 +117,14 @@ func registerPgjdbc(r *testRegistry) { t.Fatal(err) } - blacklistName, expectedFailures, ignorelistName, ignorelist := pgjdbcBlacklists.getLists(version) + blocklistName, expectedFailures, ignorelistName, ignorelist := pgjdbcBlocklists.getLists(version) if expectedFailures == nil { - t.Fatalf("No pgjdbc blacklist defined for cockroach version %s", version) + t.Fatalf("No pgjdbc blocklist defined for cockroach version %s", version) } - status := fmt.Sprintf("Running cockroach version %s, using blacklist %s", version, blacklistName) + status := fmt.Sprintf("Running cockroach version %s, using blocklist %s", version, blocklistName) if ignorelist != nil { - status = fmt.Sprintf("Running cockroach version %s, using blacklist %s, using ignorelist %s", - version, blacklistName, ignorelistName) + status = fmt.Sprintf("Running cockroach version %s, using blocklist %s, using ignorelist %s", + version, blocklistName, ignorelistName) } c.l.Printf("%s", status) @@ -173,7 +173,7 @@ func registerPgjdbc(r *testRegistry) { parseAndSummarizeJavaORMTestsResults( ctx, t, c, node, "pgjdbc" /* ormName */, output, - blacklistName, expectedFailures, ignorelist, version, latestTag, + blocklistName, expectedFailures, ignorelist, version, latestTag, ) } diff --git a/pkg/cmd/roachtest/pgjdbc_blacklist.go b/pkg/cmd/roachtest/pgjdbc_blocklist.go similarity index 99% rename from pkg/cmd/roachtest/pgjdbc_blacklist.go rename to pkg/cmd/roachtest/pgjdbc_blocklist.go index af42084cf901..4f8edb00edd6 100644 --- a/pkg/cmd/roachtest/pgjdbc_blacklist.go +++ b/pkg/cmd/roachtest/pgjdbc_blocklist.go @@ -10,21 +10,21 @@ package main -var pgjdbcBlacklists = blacklistsForVersion{ - {"v2.1", "pgjdbcBlackList2_1", pgjdbcBlackList2_1, "", nil}, - {"v2.2", "pgjdbcBlackList19_1", pgjdbcBlackList19_1, "", pgjdbcIgnoreList19_1}, - {"v19.1", "pgjdbcBlackList19_1", pgjdbcBlackList19_1, "", pgjdbcIgnoreList19_1}, - {"v19.2", "pgjdbcBlackList19_2", pgjdbcBlackList19_2, "pgjdbcIgnoreList19_2", pgjdbcIgnoreList19_2}, - {"v20.1", "pgjdbcBlackList20_1", pgjdbcBlackList20_1, "pgjdbcIgnoreList20_1", pgjdbcIgnoreList20_1}, - {"v20.2", "pgjdbcBlackList20_2", pgjdbcBlackList20_2, "pgjdbcIgnoreList20_2", pgjdbcIgnoreList20_2}, +var pgjdbcBlocklists = blocklistsForVersion{ + {"v2.1", "pgjdbcBlockList2_1", pgjdbcBlockList2_1, "", nil}, + {"v2.2", "pgjdbcBlockList19_1", pgjdbcBlockList19_1, "", pgjdbcIgnoreList19_1}, + {"v19.1", "pgjdbcBlockList19_1", pgjdbcBlockList19_1, "", pgjdbcIgnoreList19_1}, + {"v19.2", "pgjdbcBlockList19_2", pgjdbcBlockList19_2, "pgjdbcIgnoreList19_2", pgjdbcIgnoreList19_2}, + {"v20.1", "pgjdbcBlockList20_1", pgjdbcBlockList20_1, "pgjdbcIgnoreList20_1", pgjdbcIgnoreList20_1}, + {"v20.2", "pgjdbcBlockList20_2", pgjdbcBlockList20_2, "pgjdbcIgnoreList20_2", pgjdbcIgnoreList20_2}, } // 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 pgjdbcBlackList20_2 = pgjdbcBlackList20_1 +var pgjdbcBlockList20_2 = pgjdbcBlockList20_1 -var pgjdbcBlackList20_1 = blacklist{ +var pgjdbcBlockList20_1 = blocklist{ "org.postgresql.jdbc.DeepBatchedInsertStatementTest.testDeepInternalsBatchedQueryDecorator": "26508", "org.postgresql.jdbc.DeepBatchedInsertStatementTest.testUnspecifiedParameterType": "26508", "org.postgresql.jdbc.DeepBatchedInsertStatementTest.testVaryingTypeCounts": "26508", @@ -1149,7 +1149,7 @@ var pgjdbcBlackList20_1 = blacklist{ "org.postgresql.test.xa.XADataSourceTest.testWrapperEquals": "22329", } -var pgjdbcBlackList19_1 = blacklist{ +var pgjdbcBlockList19_1 = blocklist{ "org.postgresql.jdbc.DeepBatchedInsertStatementTest.testDeepInternalsBatchedQueryDecorator": "26508", "org.postgresql.jdbc.DeepBatchedInsertStatementTest.testUnspecifiedParameterType": "26508", "org.postgresql.jdbc.DeepBatchedInsertStatementTest.testVaryingTypeCounts": "26508", @@ -2666,7 +2666,7 @@ var pgjdbcBlackList19_1 = blacklist{ "org.postgresql.test.xa.XADataSourceTest.testWrapperEquals": "22329", } -var pgjdbcBlackList19_2 = blacklist{ +var pgjdbcBlockList19_2 = blocklist{ "org.postgresql.jdbc.DeepBatchedInsertStatementTest.testDeepInternalsBatchedQueryDecorator": "26508", "org.postgresql.jdbc.DeepBatchedInsertStatementTest.testUnspecifiedParameterType": "26508", "org.postgresql.jdbc.DeepBatchedInsertStatementTest.testVaryingTypeCounts": "26508", @@ -4138,7 +4138,7 @@ var pgjdbcBlackList19_2 = blacklist{ "org.postgresql.test.xa.XADataSourceTest.testWrapperEquals": "22329", } -var pgjdbcBlackList2_1 = blacklist{ +var pgjdbcBlockList2_1 = blocklist{ "org.postgresql.jdbc.DeepBatchedInsertStatementTest.testDeepInternalsBatchedQueryDecorator": "26508", "org.postgresql.jdbc.DeepBatchedInsertStatementTest.testUnspecifiedParameterType": "26508", "org.postgresql.jdbc.DeepBatchedInsertStatementTest.testVaryingTypeCounts": "26508", @@ -5551,14 +5551,14 @@ var pgjdbcIgnoreList20_2 = pgjdbcIgnoreList20_1 var pgjdbcIgnoreList20_1 = pgjdbcIgnoreList19_2 -var pgjdbcIgnoreList19_2 = blacklist{ +var pgjdbcIgnoreList19_2 = blocklist{ "org.postgresql.replication.ReplicationTestSuite.org.postgresql.replication.ReplicationTestSuite": "expected fail - no replication", "org.postgresql.test.core.LogServerMessagePropertyTest.testWithDefaults": "expected fail - checks error message", "org.postgresql.test.core.LogServerMessagePropertyTest.testWithExplicitlyEnabled": "expected fail - checks error message", "org.postgresql.test.core.LogServerMessagePropertyTest.testWithLogServerErrorDetailDisabled": "expected fail - checks error message", } -var pgjdbcIgnoreList19_1 = blacklist{ +var pgjdbcIgnoreList19_1 = blocklist{ "org.postgresql.replication.ReplicationTestSuite.org.postgresql.replication.ReplicationTestSuite": "expected fail - no replication", "org.postgresql.test.core.LogServerMessagePropertyTest.testWithDefaults": "expected fail - checks error message", "org.postgresql.test.core.LogServerMessagePropertyTest.testWithExplicitlyEnabled": "expected fail - checks error message", diff --git a/pkg/cmd/roachtest/pgx.go b/pkg/cmd/roachtest/pgx.go index 231362d16624..c6f88dc75605 100644 --- a/pkg/cmd/roachtest/pgx.go +++ b/pkg/cmd/roachtest/pgx.go @@ -66,15 +66,15 @@ func registerPgx(r *testRegistry) { t.Fatal(err) } - t.Status("checking blacklist") - blacklistName, expectedFailures, ignorelistName, ignorelist := pgxBlacklists.getLists(version) + t.Status("checking blocklist") + blocklistName, expectedFailures, ignorelistName, ignorelist := pgxBlocklists.getLists(version) if expectedFailures == nil { - t.Fatalf("No pgx blacklist defined for cockroach version %s", version) + t.Fatalf("No pgx blocklist defined for cockroach version %s", version) } - status := fmt.Sprintf("Running cockroach version %s, using blacklist %s", version, blacklistName) + status := fmt.Sprintf("Running cockroach version %s, using blocklist %s", version, blocklistName) if ignorelist != nil { - status = fmt.Sprintf("Running cockroach version %s, using blacklist %s, using ignorelist %s", - version, blacklistName, ignorelistName) + status = fmt.Sprintf("Running cockroach version %s, using blocklist %s, using ignorelist %s", + version, blocklistName, ignorelistName) } c.l.Printf("%s", status) @@ -109,7 +109,7 @@ func registerPgx(r *testRegistry) { results := newORMTestsResults() results.parseJUnitXML(t, expectedFailures, ignorelist, xmlResults) results.summarizeAll( - t, "pgx", blacklistName, expectedFailures, version, latestTag, + t, "pgx", blocklistName, expectedFailures, version, latestTag, ) } diff --git a/pkg/cmd/roachtest/pgx_blacklist.go b/pkg/cmd/roachtest/pgx_blocklist.go similarity index 94% rename from pkg/cmd/roachtest/pgx_blacklist.go rename to pkg/cmd/roachtest/pgx_blocklist.go index 6d7b33325542..3f3830a19029 100644 --- a/pkg/cmd/roachtest/pgx_blacklist.go +++ b/pkg/cmd/roachtest/pgx_blocklist.go @@ -10,18 +10,18 @@ package main -var pgxBlacklists = blacklistsForVersion{ - {"v19.2", "pgxBlacklist19_2", pgxBlacklist19_2, "pgxIgnorelist19_2", pgxIgnorelist19_2}, - {"v20.1", "pgxBlacklist20_1", pgxBlacklist20_1, "pgxIgnorelist20_1", pgxIgnorelist20_1}, - {"v20.2", "pgxBlacklist20_2", pgxBlacklist20_2, "pgxIgnorelist20_2", pgxIgnorelist20_2}, +var pgxBlocklists = blocklistsForVersion{ + {"v19.2", "pgxBlocklist19_2", pgxBlocklist19_2, "pgxIgnorelist19_2", pgxIgnorelist19_2}, + {"v20.1", "pgxBlocklist20_1", pgxBlocklist20_1, "pgxIgnorelist20_1", pgxIgnorelist20_1}, + {"v20.2", "pgxBlocklist20_2", pgxBlocklist20_2, "pgxIgnorelist20_2", pgxIgnorelist20_2}, } // 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 pgxBlacklist20_2 = pgxBlacklist20_1 +var pgxBlocklist20_2 = pgxBlocklist20_1 -var pgxBlacklist20_1 = blacklist{ +var pgxBlocklist20_1 = blocklist{ "v4.Example_CustomType": "27796", "v4.TestConnBeginBatchDeferredError": "31632", "v4.TestConnCopyFromFailServerSideMidway": "19603", @@ -65,12 +65,12 @@ var pgxBlacklist20_1 = blacklist{ var pgxIgnorelist20_2 = pgxIgnorelist20_1 -var pgxIgnorelist20_1 = blacklist{ +var pgxIgnorelist20_1 = blocklist{ "v4.TestBeginIsoLevels": "We don't support isolation levels", "v4.TestQueryEncodeError": "This test checks the exact error message", } -var pgxBlacklist19_2 = blacklist{ +var pgxBlocklist19_2 = blocklist{ "v4.Example_CustomType": "27796", "v4.TestConnBeginBatchDeferredError": "31632", "v4.TestConnCopyFromCopyFromSourceErrorEnd": "5807", @@ -129,7 +129,7 @@ var pgxBlacklist19_2 = blacklist{ "v4.TestUnregisteredTypeUsableAsStringArgumentAndBaseResult": "27796", } -var pgxIgnorelist19_2 = blacklist{ +var pgxIgnorelist19_2 = blocklist{ "v4.TestBeginIsoLevels": "We don't support isolation levels", "v4.TestQueryEncodeError": "This test checks the exact error message", } diff --git a/pkg/cmd/roachtest/psycopg.go b/pkg/cmd/roachtest/psycopg.go index 8bb2271d9ebc..7384a7fcf7b8 100644 --- a/pkg/cmd/roachtest/psycopg.go +++ b/pkg/cmd/roachtest/psycopg.go @@ -90,15 +90,15 @@ func registerPsycopg(r *testRegistry) { t.Fatal(err) } - blacklistName, expectedFailures, ignoredlistName, ignoredlist := psycopgBlacklists.getLists(version) + blocklistName, expectedFailures, ignoredlistName, ignoredlist := psycopgBlocklists.getLists(version) if expectedFailures == nil { - t.Fatalf("No psycopg blacklist defined for cockroach version %s", version) + t.Fatalf("No psycopg blocklist defined for cockroach version %s", version) } if ignoredlist == nil { t.Fatalf("No psycopg 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) t.Status("running psycopg test suite") // Note that this is expected to return an error, since the test suite @@ -119,7 +119,7 @@ func registerPsycopg(r *testRegistry) { results := newORMTestsResults() results.parsePythonUnitTestOutput(rawResults, expectedFailures, ignoredlist) results.summarizeAll( - t, "psycopg" /* ormName */, blacklistName, expectedFailures, + t, "psycopg" /* ormName */, blocklistName, expectedFailures, version, latestTag, ) } diff --git a/pkg/cmd/roachtest/psycopg_blacklist.go b/pkg/cmd/roachtest/psycopg_blocklist.go similarity index 99% rename from pkg/cmd/roachtest/psycopg_blacklist.go rename to pkg/cmd/roachtest/psycopg_blocklist.go index 56dcea06ec8d..0417167c3432 100644 --- a/pkg/cmd/roachtest/psycopg_blacklist.go +++ b/pkg/cmd/roachtest/psycopg_blocklist.go @@ -10,12 +10,12 @@ package main -var psycopgBlacklists = blacklistsForVersion{ - {"v2.2", "psycopgBlackList19_1", psycopgBlackList19_1, "psycopgIgnoreList19_1", psycopgIgnoreList19_1}, - {"v19.1", "psycopgBlackList19_1", psycopgBlackList19_1, "psycopgIgnoreList19_1", psycopgIgnoreList19_1}, - {"v19.2", "psycopgBlackList19_2", psycopgBlackList19_2, "psycopgIgnoreList19_2", psycopgIgnoreList19_2}, - {"v20.1", "psycopgBlackList20_1", psycopgBlackList20_1, "psycopgIgnoreList20_1", psycopgIgnoreList20_1}, - {"v20.2", "psycopgBlackList20_2", psycopgBlackList20_2, "psycopgIgnoreList20_2", psycopgIgnoreList20_2}, +var psycopgBlocklists = blocklistsForVersion{ + {"v2.2", "psycopgBlockList19_1", psycopgBlockList19_1, "psycopgIgnoreList19_1", psycopgIgnoreList19_1}, + {"v19.1", "psycopgBlockList19_1", psycopgBlockList19_1, "psycopgIgnoreList19_1", psycopgIgnoreList19_1}, + {"v19.2", "psycopgBlockList19_2", psycopgBlockList19_2, "psycopgIgnoreList19_2", psycopgIgnoreList19_2}, + {"v20.1", "psycopgBlockList20_1", psycopgBlockList20_1, "psycopgIgnoreList20_1", psycopgIgnoreList20_1}, + {"v20.2", "psycopgBlockList20_2", psycopgBlockList20_2, "psycopgIgnoreList20_2", psycopgIgnoreList20_2}, } // These are lists of known psycopg test errors and failures. @@ -27,11 +27,11 @@ var psycopgBlacklists = blacklistsForVersion{ // Any test on this list that is not run is reported as FAIL - not run // // 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 psycopgBlackList20_2 = psycopgBlackList20_1 +var psycopgBlockList20_2 = psycopgBlockList20_1 -var psycopgBlackList20_1 = blacklist{ +var psycopgBlockList20_1 = blocklist{ "tests.test_async.AsyncTests.test_async_callproc": "44701", "tests.test_async.AsyncTests.test_error": "44706", "tests.test_async.AsyncTests.test_flush_on_write": "44709", @@ -240,7 +240,7 @@ var psycopgBlackList20_1 = blacklist{ "tests.test_with.WithCursorTestCase.test_named_with_noop": "30352", } -var psycopgBlackList19_2 = blacklist{ +var psycopgBlockList19_2 = blocklist{ "tests.test_async.AsyncTests.test_async_after_async": "5807", "tests.test_async.AsyncTests.test_async_callproc": "5807", "tests.test_async.AsyncTests.test_async_connection_error_message": "5807", @@ -527,7 +527,7 @@ var psycopgBlackList19_2 = blacklist{ "tests.test_with.WithCursorTestCase.test_named_with_noop": "30352", } -var psycopgBlackList19_1 = blacklist{ +var psycopgBlockList19_1 = blocklist{ "tests.test_async.AsyncTests.test_async_after_async": "5807", "tests.test_async.AsyncTests.test_async_callproc": "5807", "tests.test_async.AsyncTests.test_async_connection_error_message": "5807", @@ -825,7 +825,7 @@ var psycopgIgnoreList20_1 = psycopgIgnoreList19_2 var psycopgIgnoreList19_2 = psycopgIgnoreList19_1 -var psycopgIgnoreList19_1 = blacklist{ +var psycopgIgnoreList19_1 = blocklist{ "tests.test_green.GreenTestCase.test_flush_on_write": "flakey", "tests.test_connection.TestConnectionInfo.test_backend_pid": "we return -1 for pg_backend_pid()", } diff --git a/pkg/cmd/roachtest/python_helpers.go b/pkg/cmd/roachtest/python_helpers.go index 53040104536b..98d19ce9d580 100644 --- a/pkg/cmd/roachtest/python_helpers.go +++ b/pkg/cmd/roachtest/python_helpers.go @@ -20,7 +20,7 @@ import ( var pythonUnitTestOutputRegex = regexp.MustCompile(`(?P.*) \((?P.*)\) \.\.\. (?P[^ ']*)(?: u?['"](?P.*)['"])?`) func (r *ormTestsResults) parsePythonUnitTestOutput( - input []byte, expectedFailures blacklist, ignoredList blacklist, + input []byte, expectedFailures blocklist, ignoredList blocklist, ) { scanner := bufio.NewScanner(bytes.NewReader(input)) for scanner.Scan() { diff --git a/pkg/cmd/roachtest/sqlalchemy.go b/pkg/cmd/roachtest/sqlalchemy.go index bee053fd7f70..101253b29ce9 100644 --- a/pkg/cmd/roachtest/sqlalchemy.go +++ b/pkg/cmd/roachtest/sqlalchemy.go @@ -155,12 +155,12 @@ func registerSQLAlchemy(r *testRegistry) { t.Fatal(err) } - blacklistName, expectedFailures, ignoredlistName, ignoredlist := sqlAlchemyBlacklists.getLists(version) + blocklistName, expectedFailures, ignoredlistName, ignoredlist := sqlAlchemyBlocklists.getLists(version) if expectedFailures == nil { - t.Fatalf("No sqlalchemy blacklist defined for cockroach version %s", version) + t.Fatalf("No sqlalchemy blocklist 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) t.Status("running sqlalchemy test suite") // Note that this is expected to return an error, since the test suite @@ -222,7 +222,7 @@ func registerSQLAlchemy(r *testRegistry) { } results.summarizeAll( - t, "sqlalchemy" /* ormName */, blacklistName, expectedFailures, version, latestTag) + t, "sqlalchemy" /* ormName */, blocklistName, expectedFailures, version, latestTag) } r.Add(testSpec{ diff --git a/pkg/cmd/roachtest/sqlalchemy_blacklist.go b/pkg/cmd/roachtest/sqlalchemy_blocklist.go similarity index 97% rename from pkg/cmd/roachtest/sqlalchemy_blacklist.go rename to pkg/cmd/roachtest/sqlalchemy_blocklist.go index b7c21dcf9b21..12c87d484341 100644 --- a/pkg/cmd/roachtest/sqlalchemy_blacklist.go +++ b/pkg/cmd/roachtest/sqlalchemy_blocklist.go @@ -10,17 +10,17 @@ package main -var sqlAlchemyBlacklists = blacklistsForVersion{ - {"v2.1", "sqlAlchemyBlacklist", sqlAlchemyBlacklist, "sqlAlchemyIgnoreList", sqlAlchemyIgnoreList}, - {"v19.1", "sqlAlchemyBlacklist", sqlAlchemyBlacklist, "sqlAlchemyIgnoreList", sqlAlchemyIgnoreList}, - {"v19.2", "sqlAlchemyBlacklist", sqlAlchemyBlacklist, "sqlAlchemyIgnoreList", sqlAlchemyIgnoreList}, - {"v20.1", "sqlAlchemyBlacklist20_1", sqlAlchemyBlacklist20_1, "sqlAlchemyIgnoreList20_1", sqlAlchemyIgnoreList20_1}, - {"v20.2", "sqlAlchemyBlacklist20_2", sqlAlchemyBlacklist20_2, "sqlAlchemyIgnoreList20_2", sqlAlchemyIgnoreList20_2}, +var sqlAlchemyBlocklists = blocklistsForVersion{ + {"v2.1", "sqlAlchemyBlocklist", sqlAlchemyBlocklist, "sqlAlchemyIgnoreList", sqlAlchemyIgnoreList}, + {"v19.1", "sqlAlchemyBlocklist", sqlAlchemyBlocklist, "sqlAlchemyIgnoreList", sqlAlchemyIgnoreList}, + {"v19.2", "sqlAlchemyBlocklist", sqlAlchemyBlocklist, "sqlAlchemyIgnoreList", sqlAlchemyIgnoreList}, + {"v20.1", "sqlAlchemyBlocklist20_1", sqlAlchemyBlocklist20_1, "sqlAlchemyIgnoreList20_1", sqlAlchemyIgnoreList20_1}, + {"v20.2", "sqlAlchemyBlocklist20_2", sqlAlchemyBlocklist20_2, "sqlAlchemyIgnoreList20_2", sqlAlchemyIgnoreList20_2}, } -var sqlAlchemyBlacklist20_2 = sqlAlchemyBlacklist20_1 +var sqlAlchemyBlocklist20_2 = sqlAlchemyBlocklist20_1 -var sqlAlchemyBlacklist20_1 = blacklist{ +var sqlAlchemyBlocklist20_1 = blocklist{ "test/dialect/test_suite.py::ComponentReflectionTest_cockroachdb+psycopg2_9_5_0::test_autoincrement_col": "5807", "test/dialect/test_suite.py::ComponentReflectionTest_cockroachdb+psycopg2_9_5_0::test_deprecated_get_primary_keys": "5807", "test/dialect/test_suite.py::ComponentReflectionTest_cockroachdb+psycopg2_9_5_0::test_dialect_initialize": "5807", @@ -90,7 +90,7 @@ var sqlAlchemyBlacklist20_1 = blacklist{ "test/dialect/test_suite.py::TableDDLTest_cockroachdb+psycopg2_9_5_0::test_create_table_schema": "unknown", } -var sqlAlchemyBlacklist = blacklist{ +var sqlAlchemyBlocklist = blocklist{ "test/dialect/test_suite.py::ComponentReflectionTest_cockroachdb+psycopg2_9_5_0::test_autoincrement_col": "5807", "test/dialect/test_suite.py::ComponentReflectionTest_cockroachdb+psycopg2_9_5_0::test_deprecated_get_primary_keys": "5807", "test/dialect/test_suite.py::ComponentReflectionTest_cockroachdb+psycopg2_9_5_0::test_dialect_initialize": "5807", @@ -164,7 +164,7 @@ var sqlAlchemyIgnoreList20_2 = sqlAlchemyIgnoreList var sqlAlchemyIgnoreList20_1 = sqlAlchemyIgnoreList -var sqlAlchemyIgnoreList = blacklist{ +var sqlAlchemyIgnoreList = blocklist{ "test/dialect/test_suite.py::ExceptionTest_cockroachdb+psycopg2_9_5_0::test_integrity_error": "passes, but can't parse result", "test/dialect/test_suite.py::TableDDLTest_cockroachdb+psycopg2_9_5_0::test_create_table": "flaky", } diff --git a/pkg/kv/kvserver/client_split_test.go b/pkg/kv/kvserver/client_split_test.go index a69c3709b579..dd94107152a5 100644 --- a/pkg/kv/kvserver/client_split_test.go +++ b/pkg/kv/kvserver/client_split_test.go @@ -1705,9 +1705,9 @@ func TestStoreSplitTimestampCacheDifferentLeaseHolder(t *testing.T) { } return replica } - blacklistedLeaseHolder := leaseHolder(leftKey) - log.Infof(ctx, "blacklisting replica %+v for leases", blacklistedLeaseHolder) - noLeaseForDesc.Store(&blacklistedLeaseHolder) + blocklistedLeaseHolder := leaseHolder(leftKey) + log.Infof(ctx, "blocklisting replica %+v for leases", blocklistedLeaseHolder) + noLeaseForDesc.Store(&blocklistedLeaseHolder) // Pull the trigger. This actually also reads the RHS descriptor after the // split, so when this returns, we've got the leases set up already. @@ -1727,9 +1727,9 @@ func TestStoreSplitTimestampCacheDifferentLeaseHolder(t *testing.T) { } if currentLHSLeaseHolder := leaseHolder(leftKey); !reflect.DeepEqual( - currentLHSLeaseHolder, blacklistedLeaseHolder) { + currentLHSLeaseHolder, blocklistedLeaseHolder) { t.Fatalf("lease holder changed from %+v to %+v, should de-flake this test", - blacklistedLeaseHolder, currentLHSLeaseHolder) + blocklistedLeaseHolder, currentLHSLeaseHolder) } // This write (to the right-hand side of the split) should hit the @@ -1755,7 +1755,7 @@ func TestStoreSplitTimestampCacheDifferentLeaseHolder(t *testing.T) { // that it's the same ReplicaID, which is not required but should always // hold). if rhsLease := leaseHolder(rightKey); !reflect.DeepEqual( - rhsLease, blacklistedLeaseHolder, + rhsLease, blocklistedLeaseHolder, ) { t.Errorf("expected LHS and RHS to have same lease holder") } diff --git a/pkg/kv/kvserver/replica_application_result.go b/pkg/kv/kvserver/replica_application_result.go index 801c0a09ab6e..95ad607c0e02 100644 --- a/pkg/kv/kvserver/replica_application_result.go +++ b/pkg/kv/kvserver/replica_application_result.go @@ -46,7 +46,7 @@ import ( func isTrivial(r *kvserverpb.ReplicatedEvalResult) bool { // Check if there are any non-trivial State updates. if r.State != nil { - stateWhitelist := *r.State + stateAllowlist := *r.State // ReplicaState.Stats was previously non-nullable which caused nodes to // send a zero-value MVCCStats structure. If the proposal was generated by // an old node, we'll have decoded that zero-value structure setting @@ -54,23 +54,23 @@ func isTrivial(r *kvserverpb.ReplicatedEvalResult) bool { // field in ReplicatedEvalResult" assertion to fire if we didn't clear it. // TODO(ajwerner): eliminate this case that likely can no longer occur as of // at least 19.1. - if stateWhitelist.Stats != nil && (*stateWhitelist.Stats == enginepb.MVCCStats{}) { - stateWhitelist.Stats = nil + if stateAllowlist.Stats != nil && (*stateAllowlist.Stats == enginepb.MVCCStats{}) { + stateAllowlist.Stats = nil } - if stateWhitelist != (kvserverpb.ReplicaState{}) { + if stateAllowlist != (kvserverpb.ReplicaState{}) { return false } } - // Set whitelist to the value of r and clear the whitelisted fields. - // If whitelist is zero-valued after clearing the whitelisted fields then + // Set allowlist to the value of r and clear the allowlisted fields. + // If allowlist is zero-valued after clearing the allowlisted fields then // it is trivial. - whitelist := *r - whitelist.Delta = enginepb.MVCCStatsDelta{} - whitelist.Timestamp = hlc.Timestamp{} - whitelist.DeprecatedDelta = nil - whitelist.PrevLeaseProposal = nil - whitelist.State = nil - return whitelist.Equal(kvserverpb.ReplicatedEvalResult{}) + allowlist := *r + allowlist.Delta = enginepb.MVCCStatsDelta{} + allowlist.Timestamp = hlc.Timestamp{} + allowlist.DeprecatedDelta = nil + allowlist.PrevLeaseProposal = nil + allowlist.State = nil + return allowlist.Equal(kvserverpb.ReplicatedEvalResult{}) } // clearTrivialReplicatedEvalResultFields is used to zero out the fields of a diff --git a/pkg/kv/kvserver/replica_command.go b/pkg/kv/kvserver/replica_command.go index 5eea9f930352..10aabe75219b 100644 --- a/pkg/kv/kvserver/replica_command.go +++ b/pkg/kv/kvserver/replica_command.go @@ -2037,12 +2037,12 @@ func (s *Store) AdminRelocateRange( rangeDesc = *newDesc canRetry := func(err error) bool { - whitelist := []string{ + allowlist := []string{ snapshotApplySemBusyMsg, IntersectingSnapshotMsg, } errStr := err.Error() - for _, substr := range whitelist { + for _, substr := range allowlist { if strings.Contains(errStr, substr) { return true } diff --git a/pkg/kv/kvserver/replica_evaluate.go b/pkg/kv/kvserver/replica_evaluate.go index 1058e5f8c061..20989bc074d3 100644 --- a/pkg/kv/kvserver/replica_evaluate.go +++ b/pkg/kv/kvserver/replica_evaluate.go @@ -187,7 +187,7 @@ func evaluateBatch( // has already been aborted. // - heartbeats don't check the abort span. If the txn is aborted, they'll // return an aborted proto in their otherwise successful response. - // TODO(nvanbenschoten): Let's remove heartbeats from this whitelist when + // TODO(nvanbenschoten): Let's remove heartbeats from this allowlist when // we rationalize the TODO in txnHeartbeater.heartbeat. if !ba.IsSingleAbortTxnRequest() && !ba.IsSingleHeartbeatTxnRequest() { if pErr := checkIfTxnAborted(ctx, rec, readWriter, *baHeader.Txn); pErr != nil { diff --git a/pkg/kv/kvserver/replica_proposal.go b/pkg/kv/kvserver/replica_proposal.go index 9dea22aa6d01..1e326c2e06cf 100644 --- a/pkg/kv/kvserver/replica_proposal.go +++ b/pkg/kv/kvserver/replica_proposal.go @@ -751,7 +751,7 @@ func (r *Replica) evaluateProposal( } // Failed proposals can't have any Result except for what's - // whitelisted here. + // allowlisted here. res.Local = result.LocalResult{ EncounteredIntents: res.Local.DetachEncounteredIntents(), EndTxns: res.Local.DetachEndTxns(true /* alwaysOnly */), diff --git a/pkg/kv/kvserver/replica_read.go b/pkg/kv/kvserver/replica_read.go index 464d92401357..6d04e0d884ac 100644 --- a/pkg/kv/kvserver/replica_read.go +++ b/pkg/kv/kvserver/replica_read.go @@ -137,7 +137,7 @@ func (r *Replica) executeReadOnlyBatchWithServersideRefreshes( if pErr != nil { // Failed read-only batches can't have any Result except for what's - // whitelisted here. + // allowlisted here. res.Local = result.LocalResult{ EncounteredIntents: res.Local.DetachEncounteredIntents(), Metrics: res.Local.Metrics, diff --git a/pkg/kv/kvserver/track_raft_protos.go b/pkg/kv/kvserver/track_raft_protos.go index 6cb428fc0333..b77b1927b412 100644 --- a/pkg/kv/kvserver/track_raft_protos.go +++ b/pkg/kv/kvserver/track_raft_protos.go @@ -37,7 +37,7 @@ func TrackRaftProtos() func() []reflect.Type { applyRaftEntryFunc := funcName((*apply.Task).ApplyCommittedEntries) // We only need to track protos that could cause replica divergence // by being written to disk downstream of raft. - whitelist := []string{ + allowlist := []string{ // Some raft operations trigger gossip, but we don't require // strict consistency there. funcName((*gossip.Gossip).AddInfoProto), @@ -92,14 +92,14 @@ func TrackRaftProtos() func() []reflect.Type { for { f, more := frames.Next() - whitelisted := false - for _, s := range whitelist { + allowlisted := false + for _, s := range allowlist { if strings.Contains(f.Function, s) { - whitelisted = true + allowlisted = true break } } - if whitelisted { + if allowlisted { break } diff --git a/pkg/server/authentication_test.go b/pkg/server/authentication_test.go index ac540ccfef43..4e8867a4c40b 100644 --- a/pkg/server/authentication_test.go +++ b/pkg/server/authentication_test.go @@ -73,7 +73,7 @@ func (insecureCtx) HTTPRequestScheme() string { return "https" } -// Verify client certificate enforcement and user whitelisting. +// Verify client certificate enforcement and user allowlisting. func TestSSLEnforcement(t *testing.T) { defer leaktest.AfterTest(t)() s, _, _ := serverutils.StartServer(t, base.TestServerArgs{ diff --git a/pkg/server/server_sql_test.go b/pkg/server/server_sql_test.go index e836eb1585c1..5ff9fa72f359 100644 --- a/pkg/server/server_sql_test.go +++ b/pkg/server/server_sql_test.go @@ -34,7 +34,7 @@ import ( // and must not rely on having a NodeID/NodeDescriptor/NodeLiveness/... // // In short, it should not rely on the test server through anything other than a -// `*kv.DB` and a small number of whitelisted RPCs. +// `*kv.DB` and a small number of allowlisted RPCs. func TestSQLServer(t *testing.T) { defer leaktest.AfterTest(t)() ctx := context.Background() diff --git a/pkg/sql/create_role.go b/pkg/sql/create_role.go index 9bc1938ad81f..97c1cce6b3cc 100644 --- a/pkg/sql/create_role.go +++ b/pkg/sql/create_role.go @@ -235,7 +235,7 @@ const usernameHelp = "Usernames are case insensitive, must start with a letter, var usernameRE = regexp.MustCompile(`^[\p{Ll}0-9_][---\p{Ll}0-9_.]*$`) -var blacklistedUsernames = map[string]struct{}{ +var blocklistedUsernames = map[string]struct{}{ security.NodeUser: {}, } @@ -243,19 +243,19 @@ var blacklistedUsernames = map[string]struct{}{ // it validates according to the usernameRE regular expression. // It rejects reserved user names. func NormalizeAndValidateUsername(username string) (string, error) { - username, err := NormalizeAndValidateUsernameNoBlacklist(username) + username, err := NormalizeAndValidateUsernameNoBlocklist(username) if err != nil { return "", err } - if _, ok := blacklistedUsernames[username]; ok { + if _, ok := blocklistedUsernames[username]; ok { return "", pgerror.Newf(pgcode.ReservedName, "username %q reserved", username) } return username, nil } -// NormalizeAndValidateUsernameNoBlacklist case folds the specified username and verifies +// NormalizeAndValidateUsernameNoBlocklist case folds the specified username and verifies // it validates according to the usernameRE regular expression. -func NormalizeAndValidateUsernameNoBlacklist(username string) (string, error) { +func NormalizeAndValidateUsernameNoBlocklist(username string) (string, error) { username = tree.Name(username).Normalize() if !usernameRE.MatchString(username) { return "", errors.WithHint(pgerror.Newf(pgcode.InvalidName, "username %q invalid", username), usernameHelp) diff --git a/pkg/sql/distsql_physical_planner.go b/pkg/sql/distsql_physical_planner.go index cc84652464da..112c87988ee0 100644 --- a/pkg/sql/distsql_physical_planner.go +++ b/pkg/sql/distsql_physical_planner.go @@ -172,7 +172,7 @@ func (dsp *DistSQLPlanner) SetSpanResolver(spanResolver physicalplan.SpanResolve } // distSQLExprCheckVisitor is a tree.Visitor that checks if expressions -// contain things not supported by distSQL, like distSQL-blacklisted functions. +// contain things not supported by distSQL, like distSQL-blocklisted functions. type distSQLExprCheckVisitor struct { err error } @@ -185,7 +185,7 @@ func (v *distSQLExprCheckVisitor) VisitPre(expr tree.Expr) (recurse bool, newExp } switch t := expr.(type) { case *tree.FuncExpr: - if t.IsDistSQLBlacklist() { + if t.IsDistSQLBlocklist() { v.err = newQueryNotSupportedErrorf("function %s cannot be executed with distsql", t) return false, expr } @@ -206,7 +206,7 @@ func (v *distSQLExprCheckVisitor) VisitPre(expr tree.Expr) (recurse bool, newExp func (v *distSQLExprCheckVisitor) VisitPost(expr tree.Expr) tree.Expr { return expr } // checkExpr verifies that an expression doesn't contain things that are not yet -// supported by distSQL, like distSQL-blacklisted functions. +// supported by distSQL, like distSQL-blocklisted functions. func checkExpr(expr tree.Expr) error { if expr == nil { return nil diff --git a/pkg/sql/logictest/logic.go b/pkg/sql/logictest/logic.go index bc6124d539e7..7dcfbd1ab0e1 100644 --- a/pkg/sql/logictest/logic.go +++ b/pkg/sql/logictest/logic.go @@ -109,12 +109,12 @@ import ( // logicTestConfigs. If the directive is missing, the test is run in the // default configuration. // -// The directive also supports blacklists, i.e. running all specified -// configurations apart from a blacklisted configuration: +// The directive also supports blocklists, i.e. running all specified +// configurations apart from a blocklisted configuration: // // # LogicTest: default-configs !3node-tenant // -// If a blacklist is specified without an accompanying configuration, the +// If a blocklist is specified without an accompanying configuration, the // default config is assumed. i.e., the following directive is equivalent to the // one above: // @@ -1397,17 +1397,17 @@ CREATE DATABASE test; t.unsupported = 0 } -// applyBlacklistToConfigIdxs applies the given blacklist to config idxs, +// applyBlocklistToConfigIdxs applies the given blocklist to config idxs, // returning the result. -func applyBlacklistToConfigIdxs( - configIdxs []logicTestConfigIdx, blacklist map[string]struct{}, +func applyBlocklistToConfigIdxs( + configIdxs []logicTestConfigIdx, blocklist map[string]struct{}, ) []logicTestConfigIdx { - if len(blacklist) == 0 { + if len(blocklist) == 0 { return configIdxs } var newConfigIdxs []logicTestConfigIdx for _, idx := range configIdxs { - if _, ok := blacklist[logicTestConfigIdxToName[idx]]; ok { + if _, ok := blocklist[logicTestConfigIdxToName[idx]]; ok { continue } newConfigIdxs = append(newConfigIdxs, idx) @@ -1418,28 +1418,28 @@ func applyBlacklistToConfigIdxs( // processConfigs, given a list of configNames, returns the list of // corresponding logicTestConfigIdxs. func processConfigs(t *testing.T, path string, configNames []string) []logicTestConfigIdx { - const blacklistChar = '!' - blacklist := make(map[string]struct{}) - allConfigNamesAreBlacklistDirectives := true + const blocklistChar = '!' + blocklist := make(map[string]struct{}) + allConfigNamesAreBlocklistDirectives := true for _, configName := range configNames { - if configName[0] != blacklistChar { - allConfigNamesAreBlacklistDirectives = false + if configName[0] != blocklistChar { + allConfigNamesAreBlocklistDirectives = false continue } - blacklist[configName[1:]] = struct{}{} + blocklist[configName[1:]] = struct{}{} } var configs []logicTestConfigIdx - if len(blacklist) != 0 && allConfigNamesAreBlacklistDirectives { - // No configs specified, this blacklist applies to the default config. - return applyBlacklistToConfigIdxs(defaultConfig, blacklist) + if len(blocklist) != 0 && allConfigNamesAreBlocklistDirectives { + // No configs specified, this blocklist applies to the default config. + return applyBlocklistToConfigIdxs(defaultConfig, blocklist) } for _, configName := range configNames { - if configName[0] == blacklistChar { + if configName[0] == blocklistChar { continue } - if _, ok := blacklist[configName]; ok { + if _, ok := blocklist[configName]; ok { continue } @@ -1447,9 +1447,9 @@ func processConfigs(t *testing.T, path string, configNames []string) []logicTest if !ok { switch configName { case defaultConfigName: - configs = append(configs, applyBlacklistToConfigIdxs(defaultConfig, blacklist)...) + configs = append(configs, applyBlocklistToConfigIdxs(defaultConfig, blocklist)...) case fiveNodeDefaultConfigName: - configs = append(configs, applyBlacklistToConfigIdxs(fiveNodeDefaultConfig, blacklist)...) + configs = append(configs, applyBlocklistToConfigIdxs(fiveNodeDefaultConfig, blocklist)...) default: t.Fatalf("%s: unknown config name %s", path, configName) } diff --git a/pkg/sql/opt/memo/expr.go b/pkg/sql/opt/memo/expr.go index 88b98efbd42d..c2b14711cbd6 100644 --- a/pkg/sql/opt/memo/expr.go +++ b/pkg/sql/opt/memo/expr.go @@ -631,7 +631,7 @@ func (prj *ProjectExpr) initUnexportedFields(mem *Memo) { // // We only add the FD if composite types are not involved. // - // TODO(radu): add a whitelist of expressions/operators that are ok, like + // TODO(radu): add a allowlist of expressions/operators that are ok, like // arithmetic. composite := false for i, ok := from.Next(0); ok; i, ok = from.Next(i + 1) { diff --git a/pkg/sql/opt/norm/fold_constants_funcs.go b/pkg/sql/opt/norm/fold_constants_funcs.go index 7f3d6dac9a3c..bbf269d3f3c9 100644 --- a/pkg/sql/opt/norm/fold_constants_funcs.go +++ b/pkg/sql/opt/norm/fold_constants_funcs.go @@ -404,7 +404,7 @@ func (c *CustomFuncs) FoldColumnAccess(input opt.ScalarExpr, idx memo.TupleOrdin // FoldFunction evaluates a function expression with constant inputs. It // returns a constant expression as long as the function is contained in the -// FoldFunctionWhitelist, and the evaluation causes no error. +// FoldFunctionAllowlist, and the evaluation causes no error. func (c *CustomFuncs) FoldFunction( args memo.ScalarListExpr, private *memo.FunctionPrivate, ) opt.ScalarExpr { @@ -413,9 +413,9 @@ func (c *CustomFuncs) FoldFunction( if private.Properties.Class != tree.NormalClass { return nil } - // Functions that aren't immutable and also not in the whitelist cannot + // Functions that aren't immutable and also not in the allowlist cannot // be folded. - if _, ok := FoldFunctionWhitelist[private.Name]; !ok && private.Overload.Volatility > tree.VolatilityImmutable { + if _, ok := FoldFunctionAllowlist[private.Name]; !ok && private.Overload.Volatility > tree.VolatilityImmutable { return nil } @@ -442,9 +442,9 @@ func (c *CustomFuncs) FoldFunction( return c.f.ConstructConstVal(result, private.Typ) } -// FoldFunctionWhitelist contains non-immutable functions that are nevertheless +// FoldFunctionAllowlist contains non-immutable functions that are nevertheless // known to be safe for folding. -var FoldFunctionWhitelist = map[string]struct{}{ +var FoldFunctionAllowlist = map[string]struct{}{ // The SQL statement is generated in the optbuilder phase, so the remaining // function execution is immutable. "addgeometrycolumn": {}, diff --git a/pkg/sql/opt/optbuilder/builder.go b/pkg/sql/opt/optbuilder/builder.go index 137066619bd4..eb5d83bb4ce6 100644 --- a/pkg/sql/opt/optbuilder/builder.go +++ b/pkg/sql/opt/optbuilder/builder.go @@ -231,7 +231,7 @@ func (b *Builder) buildStmt( stmt tree.Statement, desiredTypes []*types.T, inScope *scope, ) (outScope *scope) { if b.insideViewDef { - // A black list of statements that can't be used from inside a view. + // A blocklist of statements that can't be used from inside a view. switch stmt := stmt.(type) { case *tree.Delete, *tree.Insert, *tree.Update, *tree.CreateTable, *tree.CreateView, *tree.Split, *tree.Unsplit, *tree.Relocate, diff --git a/pkg/sql/parser/scan.go b/pkg/sql/parser/scan.go index f91c0f8f1629..ceb9e5851547 100644 --- a/pkg/sql/parser/scan.go +++ b/pkg/sql/parser/scan.go @@ -568,12 +568,12 @@ func (s *scanner) scanIdent(lval *sqlSymType) { if lval.id != lex.IDENT { if isExperimental { if _, ok := lex.AllowedExperimental[kw]; !ok { - // If the parsed token is not on the whitelisted set of keywords, + // If the parsed token is not on the allowlisted set of keywords, // then it might have been intended to be parsed as something else. // In that case, re-tokenize the original string. lval.id = lex.GetKeywordID(lval.str) } else { - // It is a whitelisted keyword, so remember the shortened + // It is a allowlisted keyword, so remember the shortened // keyword for further processing. lval.str = kw } diff --git a/pkg/sql/schema_changer.go b/pkg/sql/schema_changer.go index 9f668ddf5713..ed5fef1d3b24 100644 --- a/pkg/sql/schema_changer.go +++ b/pkg/sql/schema_changer.go @@ -118,8 +118,8 @@ func NewSchemaChangerForTesting( } // isPermanentSchemaChangeError returns true if the error results in -// a permanent failure of a schema change. This function is a whitelist -// instead of a blacklist: only known safe errors are confirmed to not be +// a permanent failure of a schema change. This function is a allowlist +// instead of a blocklist: only known safe errors are confirmed to not be // permanent errors. Anything unknown is assumed to be permanent. func isPermanentSchemaChangeError(err error) bool { if err == nil { @@ -1550,7 +1550,7 @@ func (*SchemaChangerTestingKnobs) ModuleTestingKnobs() {} // createSchemaChangeEvalCtx creates an extendedEvalContext() to be used for backfills. // // TODO(andrei): This EvalContext() will be broken for backfills trying to use -// functions marked with distsqlBlacklist. +// functions marked with distsqlBlocklist. // Also, the SessionTracing inside the context is unrelated to the one // used in the surrounding SQL session, so session tracing is unable // to capture schema change activity. @@ -1690,7 +1690,7 @@ func (r schemaChangeResumer) Resume( ) return nil case !isPermanentSchemaChangeError(scErr): - // Check if the error is on a whitelist of errors we should retry on, + // Check if the error is on a allowlist of errors we should retry on, // including the schema change not having the first mutation in line. default: // All other errors lead to a failed job. @@ -1808,7 +1808,7 @@ func (r schemaChangeResumer) OnFailOrCancel(ctx context.Context, phs interface{} // wrapping it in a retry error. return rollbackErr case !isPermanentSchemaChangeError(rollbackErr): - // Check if the error is on a whitelist of errors we should retry on, and + // Check if the error is on a allowlist of errors we should retry on, and // have the job registry retry. return jobs.NewRetryJobError(rollbackErr.Error()) default: diff --git a/pkg/sql/schema_changer_test.go b/pkg/sql/schema_changer_test.go index fd88e00ce3a2..fb98d800e072 100644 --- a/pkg/sql/schema_changer_test.go +++ b/pkg/sql/schema_changer_test.go @@ -6000,7 +6000,7 @@ CREATE UNIQUE INDEX i ON t.test(v); return nil } injectedError = true - // Any error not on the whitelist of retriable errors is considered permanent. + // Any error not on the allowlist of retriable errors is considered permanent. return errors.New("permanent error") }, }, @@ -6025,7 +6025,7 @@ CREATE UNIQUE INDEX i ON t.test(v); return nil } injectedError = true - // Any error not on the whitelist of retriable errors is considered permanent. + // Any error not on the allowlist of retriable errors is considered permanent. return errors.New("permanent error") }, }, diff --git a/pkg/sql/sem/builtins/builtins.go b/pkg/sql/sem/builtins/builtins.go index a5e67f046c8d..11566457770f 100644 --- a/pkg/sql/sem/builtins/builtins.go +++ b/pkg/sql/sem/builtins/builtins.go @@ -1735,7 +1735,7 @@ CockroachDB supports the following flags: "nextval": makeBuiltin( tree.FunctionProperties{ Category: categorySequences, - DistsqlBlacklist: true, + DistsqlBlocklist: true, Impure: true, }, tree.Overload{ @@ -1761,7 +1761,7 @@ CockroachDB supports the following flags: "currval": makeBuiltin( tree.FunctionProperties{ Category: categorySequences, - DistsqlBlacklist: true, + DistsqlBlocklist: true, Impure: true, }, tree.Overload{ @@ -1809,7 +1809,7 @@ CockroachDB supports the following flags: "setval": makeBuiltin( tree.FunctionProperties{ Category: categorySequences, - DistsqlBlacklist: true, + DistsqlBlocklist: true, Impure: true, }, tree.Overload{ @@ -3023,7 +3023,7 @@ may increase either contention or retry errors, or both.`, "current_schema": makeBuiltin( tree.FunctionProperties{ Category: categorySystemInfo, - DistsqlBlacklist: true, + DistsqlBlocklist: true, }, tree.Overload{ Types: tree.ArgTypes{}, @@ -3060,7 +3060,7 @@ may increase either contention or retry errors, or both.`, "current_schemas": makeBuiltin( tree.FunctionProperties{ Category: categorySystemInfo, - DistsqlBlacklist: true, + DistsqlBlocklist: true, }, tree.Overload{ Types: tree.ArgTypes{{"include_pg_catalog", types.Bool}}, @@ -3801,7 +3801,7 @@ may increase either contention or retry errors, or both.`, "crdb_internal.is_admin": makeBuiltin( tree.FunctionProperties{ Category: categorySystemInfo, - DistsqlBlacklist: true, + DistsqlBlocklist: true, }, tree.Overload{ Types: tree.ArgTypes{}, diff --git a/pkg/sql/sem/builtins/pg_builtins.go b/pkg/sql/sem/builtins/pg_builtins.go index 2d1273d027b9..96b2d625d9ce 100644 --- a/pkg/sql/sem/builtins/pg_builtins.go +++ b/pkg/sql/sem/builtins/pg_builtins.go @@ -389,7 +389,7 @@ func makePGPrivilegeInquiryDef( } return builtinDefinition{ props: tree.FunctionProperties{ - DistsqlBlacklist: true, + DistsqlBlocklist: true, }, overloads: variants, } @@ -645,7 +645,7 @@ var pgBuiltins = map[string]builtinDefinition{ // pg_get_constraintdef functions like SHOW CREATE CONSTRAINT would if we // supported that statement. - "pg_get_constraintdef": makeBuiltin(tree.FunctionProperties{DistsqlBlacklist: true}, + "pg_get_constraintdef": makeBuiltin(tree.FunctionProperties{DistsqlBlocklist: true}, makePGGetConstraintDef(tree.ArgTypes{ {"constraint_oid", types.Oid}, {"pretty_bool", types.Bool}}), makePGGetConstraintDef(tree.ArgTypes{{"constraint_oid", types.Oid}}), @@ -726,14 +726,14 @@ var pgBuiltins = map[string]builtinDefinition{ // pg_get_indexdef functions like SHOW CREATE INDEX would if we supported that // statement. - "pg_get_indexdef": makeBuiltin(tree.FunctionProperties{DistsqlBlacklist: true}, + "pg_get_indexdef": makeBuiltin(tree.FunctionProperties{DistsqlBlocklist: true}, makePGGetIndexDef(tree.ArgTypes{{"index_oid", types.Oid}}), makePGGetIndexDef(tree.ArgTypes{{"index_oid", types.Oid}, {"column_no", types.Int}, {"pretty_bool", types.Bool}}), ), // pg_get_viewdef functions like SHOW CREATE VIEW but returns the same format as // PostgreSQL leaving out the actual 'CREATE VIEW table_name AS' portion of the statement. - "pg_get_viewdef": makeBuiltin(tree.FunctionProperties{DistsqlBlacklist: true}, + "pg_get_viewdef": makeBuiltin(tree.FunctionProperties{DistsqlBlocklist: true}, makePGGetViewDef(tree.ArgTypes{{"view_oid", types.Oid}}), makePGGetViewDef(tree.ArgTypes{{"view_oid", types.Oid}, {"pretty_bool", types.Bool}}), ), @@ -766,7 +766,7 @@ var pgBuiltins = map[string]builtinDefinition{ }, ), - "pg_get_userbyid": makeBuiltin(tree.FunctionProperties{DistsqlBlacklist: true}, + "pg_get_userbyid": makeBuiltin(tree.FunctionProperties{DistsqlBlocklist: true}, tree.Overload{ Types: tree.ArgTypes{ {"role_oid", types.Oid}, @@ -791,7 +791,7 @@ var pgBuiltins = map[string]builtinDefinition{ }, ), - "pg_sequence_parameters": makeBuiltin(tree.FunctionProperties{DistsqlBlacklist: true}, + "pg_sequence_parameters": makeBuiltin(tree.FunctionProperties{DistsqlBlocklist: true}, // pg_sequence_parameters is an undocumented Postgres builtin that returns // information about a sequence given its OID. It's nevertheless used by // at least one UI tool, so we provide an implementation for compatibility. @@ -1717,7 +1717,7 @@ SELECT description "current_setting": makeBuiltin( tree.FunctionProperties{ Category: categorySystemInfo, - DistsqlBlacklist: true, + DistsqlBlocklist: true, }, tree.Overload{ Types: tree.ArgTypes{{"setting_name", types.String}}, @@ -1743,7 +1743,7 @@ SELECT description "set_config": makeBuiltin( tree.FunctionProperties{ Category: categorySystemInfo, - DistsqlBlacklist: true, + DistsqlBlocklist: true, Impure: true, }, tree.Overload{ diff --git a/pkg/sql/sem/tree/expr.go b/pkg/sql/sem/tree/expr.go index 769164a12281..1b12b32a9430 100644 --- a/pkg/sql/sem/tree/expr.go +++ b/pkg/sql/sem/tree/expr.go @@ -1401,9 +1401,9 @@ func (node *FuncExpr) IsImpure() bool { return node.fnProps != nil && node.fnProps.Impure } -// IsDistSQLBlacklist returns whether the function is not supported by DistSQL. -func (node *FuncExpr) IsDistSQLBlacklist() bool { - return node.fnProps != nil && node.fnProps.DistsqlBlacklist +// IsDistSQLBlocklist returns whether the function is not supported by DistSQL. +func (node *FuncExpr) IsDistSQLBlocklist() bool { + return node.fnProps != nil && node.fnProps.DistsqlBlocklist } // CanHandleNulls returns whether or not the function can handle null diff --git a/pkg/sql/sem/tree/function_definition.go b/pkg/sql/sem/tree/function_definition.go index 7e2203de6f4d..ad2eec54682f 100644 --- a/pkg/sql/sem/tree/function_definition.go +++ b/pkg/sql/sem/tree/function_definition.go @@ -65,15 +65,15 @@ type FunctionProperties struct { // as impure. Impure bool - // DistsqlBlacklist is set to true when a function depends on + // DistsqlBlocklist is set to true when a function depends on // members of the EvalContext that are not marshaled by DistSQL // (e.g. planner). Currently used for DistSQL to determine if // expressions can be evaluated on a different node without sending // over the EvalContext. // // TODO(andrei): Get rid of the planner from the EvalContext and then we can - // get rid of this blacklist. - DistsqlBlacklist bool + // get rid of this blocklist. + DistsqlBlocklist bool // Class is the kind of built-in function (normal/aggregate/window/etc.) Class FunctionClass diff --git a/pkg/sql/telemetry_test.go b/pkg/sql/telemetry_test.go index fd5ccb9d6fd9..de0171eab248 100644 --- a/pkg/sql/telemetry_test.go +++ b/pkg/sql/telemetry_test.go @@ -45,19 +45,19 @@ import ( // Executes SQL statements against the database. Outputs no results on // success. In case of error, outputs the error message. // -// - feature-whitelist +// - feature-allowlist // // The input for this command is not SQL, but a list of regular expressions. -// Tests that follow (until the next feature-whitelist command) will only -// output counters that match a regexp in this white list. +// Tests that follow (until the next feature-allowlist command) will only +// output counters that match a regexp in this allow list. // // - feature-usage, feature-counters // // Executes SQL statements and then outputs the feature counters from the -// white list that have been reported to the diagnostic server. The first +// allowlist that have been reported to the diagnostic server. The first // variant outputs only the names of the counters that changed; the second // variant outputs the counts as well. It is necessary to use -// feature-whitelist before these commands to avoid test flakes (e.g. because +// feature-allowlist before these commands to avoid test flakes (e.g. because // of counters that are changed by looking up descriptors) // // - schema @@ -103,7 +103,7 @@ func TestTelemetry(t *testing.T) { // issued multiple times. runner.Exec(t, "SET CLUSTER SETTING sql.query_cache.enabled = false") - var whitelist featureWhitelist + var allowlist featureAllowlist datadriven.RunTest(t, path, func(t *testing.T, td *datadriven.TestData) string { switch td.Cmd { case "exec": @@ -125,9 +125,9 @@ func TestTelemetry(t *testing.T) { } return buf.String() - case "feature-whitelist": + case "feature-allowlist": var err error - whitelist, err = makeWhitelist(strings.Split(td.Input, "\n")) + allowlist, err = makeAllowlist(strings.Split(td.Input, "\n")) if err != nil { td.Fatalf(t, "error parsing feature regex: %s", err) } @@ -150,8 +150,8 @@ func TestTelemetry(t *testing.T) { // Ignore zero values (shouldn't happen in practice) continue } - if !whitelist.Match(k) { - // Feature key not in whitelist. + if !allowlist.Match(k) { + // Feature key not in allowlist. continue } keys = append(keys, k) @@ -193,10 +193,10 @@ func TestTelemetry(t *testing.T) { }) } -type featureWhitelist []*regexp.Regexp +type featureAllowlist []*regexp.Regexp -func makeWhitelist(strings []string) (featureWhitelist, error) { - w := make(featureWhitelist, len(strings)) +func makeAllowlist(strings []string) (featureAllowlist, error) { + w := make(featureAllowlist, len(strings)) for i := range strings { var err error w[i], err = regexp.Compile("^" + strings[i] + "$") @@ -207,9 +207,9 @@ func makeWhitelist(strings []string) (featureWhitelist, error) { return w, nil } -func (w featureWhitelist) Match(feature string) bool { +func (w featureAllowlist) Match(feature string) bool { if w == nil { - // Unset whitelist matches all counters. + // Unset allowlist matches all counters. return true } for _, r := range w { diff --git a/pkg/sql/testdata/telemetry/error b/pkg/sql/testdata/telemetry/error index acc46d357955..1c7a035a9a5c 100644 --- a/pkg/sql/testdata/telemetry/error +++ b/pkg/sql/testdata/telemetry/error @@ -1,6 +1,6 @@ # This file contains telemetry tests for counters triggered by errors. -feature-whitelist +feature-allowlist othererror.* errorcodes.* unimplemented.* diff --git a/pkg/sql/testdata/telemetry/planning b/pkg/sql/testdata/telemetry/planning index ad25bcc04492..1c9674accacc 100644 --- a/pkg/sql/testdata/telemetry/planning +++ b/pkg/sql/testdata/telemetry/planning @@ -6,7 +6,7 @@ CREATE TABLE x (a INT PRIMARY KEY) # Tests for EXPLAIN counters. -feature-whitelist +feature-allowlist sql.plan.explain sql.plan.explain-analyze sql.plan.explain-opt @@ -45,7 +45,7 @@ sql.plan.explain-opt-verbose # Tests for hints. -feature-whitelist +feature-allowlist sql.plan.hints.* ---- @@ -84,7 +84,7 @@ sql.plan.hints.index.delete # Tests for tracking important setting changes. -feature-whitelist +feature-allowlist sql.plan.reorder-joins.* sql.plan.automatic-stats.* ---- @@ -125,7 +125,7 @@ RESET CLUSTER SETTING sql.stats.automatic_collection.enabled sql.plan.automatic-stats.enabled # Test telemetry for manual statistics creation. -feature-whitelist +feature-allowlist sql.plan.stats.created ---- @@ -135,7 +135,7 @@ CREATE STATISTICS stats FROM x sql.plan.stats.created # Test various planning counters. -feature-whitelist +feature-allowlist sql.plan.cte.* sql.plan.lateral-join sql.plan.subquery.* @@ -174,7 +174,7 @@ sql.plan.subquery.correlated # Test some sql.plan.ops counters, using some esoteric operators unlikely to be # executed in background activity). -feature-whitelist +feature-allowlist sql.plan.ops.cast.string::inet sql.plan.ops.bin.jsonb - string sql.plan.ops.array.* @@ -202,7 +202,7 @@ INSERT INTO x SELECT unnest(ARRAY[9, 10, 11, 12]) sql.plan.ops.array.cons # Test a few sql.plan.opt.node counters. -feature-whitelist +feature-allowlist sql.plan.opt.node.project-set sql.plan.opt.node.join.* ---- diff --git a/pkg/sql/testdata/telemetry/schema b/pkg/sql/testdata/telemetry/schema index 89f8e6ababc4..70f6bea8217a 100644 --- a/pkg/sql/testdata/telemetry/schema +++ b/pkg/sql/testdata/telemetry/schema @@ -36,7 +36,7 @@ table:_ ├── _: _ └── _: _ -feature-whitelist +feature-allowlist sql.schema.* ---- diff --git a/pkg/testutils/buildutil/build.go b/pkg/testutils/buildutil/build.go index 4270b0b22a51..299bd8e7aa1e 100644 --- a/pkg/testutils/buildutil/build.go +++ b/pkg/testutils/buildutil/build.go @@ -38,7 +38,7 @@ func short(in string) string { // indirectly) on forbidden packages. The forbidden packages are specified as // either exact matches or prefix matches. // A match is not reported if the package that includes the forbidden package -// is listed in the whitelist. +// is listed in the allowlist. // If GOPATH isn't set, it is an indication that the source is not available and // the test is skipped. func VerifyNoImports( @@ -46,7 +46,7 @@ func VerifyNoImports( pkgPath string, cgo bool, forbiddenPkgs, forbiddenPrefixes []string, - whitelist ...string, + allowlist ...string, ) { // Skip test if source is not available. @@ -68,14 +68,14 @@ func VerifyNoImports( for _, imp := range pkg.Imports { for _, forbidden := range forbiddenPkgs { if forbidden == imp { - whitelisted := false - for _, w := range whitelist { + allowlisted := false + for _, w := range allowlist { if path == w { - whitelisted = true + allowlisted = true break } } - if !whitelisted { + if !allowlisted { return errors.Errorf("%s imports %s, which is forbidden", short(path), short(imp)) } } @@ -129,10 +129,10 @@ func VerifyNoImports( } } -// VerifyTransitiveWhitelist checks that the entire set of transitive -// dependencies of the given package is in a whitelist. Vendored and stdlib +// VerifyTransitiveAllowlist checks that the entire set of transitive +// dependencies of the given package is in a allowlist. Vendored and stdlib // packages are always allowed. -func VerifyTransitiveWhitelist(t testing.TB, pkg string, allowedPkgs []string) { +func VerifyTransitiveAllowlist(t testing.TB, pkg string, allowedPkgs []string) { // Skip test if source is not available. if build.Default.GOPATH == "" { t.Skip("GOPATH isn't set") diff --git a/pkg/workload/cli/cli.go b/pkg/workload/cli/cli.go index b8a786e70a8d..8d276cf8ca46 100644 --- a/pkg/workload/cli/cli.go +++ b/pkg/workload/cli/cli.go @@ -28,18 +28,18 @@ func WorkloadCmd(userFacing bool) *cobra.Command { rootCmd.AddCommand(subCmdFn(userFacing)) } if userFacing { - whitelist := map[string]struct{}{ + allowlist := map[string]struct{}{ `workload`: {}, `init`: {}, `run`: {}, } for _, m := range workload.Registered() { - whitelist[m.Name] = struct{}{} + allowlist[m.Name] = struct{}{} } var addExperimental func(c *cobra.Command) addExperimental = func(c *cobra.Command) { c.Short = `[experimental] ` + c.Short - if _, ok := whitelist[c.Name()]; !ok { + if _, ok := allowlist[c.Name()]; !ok { c.Hidden = true } for _, sub := range c.Commands() { diff --git a/pkg/workload/dep_test.go b/pkg/workload/dep_test.go index 44449e8d7b0f..3016b803c338 100644 --- a/pkg/workload/dep_test.go +++ b/pkg/workload/dep_test.go @@ -17,12 +17,12 @@ import ( "github.com/cockroachdb/cockroach/pkg/util/leaktest" ) -func TestDepWhitelist(t *testing.T) { +func TestDepAllowlist(t *testing.T) { defer leaktest.AfterTest(t)() // We want workload to be lightweight. If you need to add a package to this // set of deps, run it by danhhz first. - buildutil.VerifyTransitiveWhitelist(t, "github.com/cockroachdb/cockroach/pkg/workload", + buildutil.VerifyTransitiveAllowlist(t, "github.com/cockroachdb/cockroach/pkg/workload", []string{ `github.com/cockroachdb/cockroach/pkg/col/coldata`, `github.com/cockroachdb/cockroach/pkg/col/typeconv`,