git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 2/3] t/*: avoid "whitelist"

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Jul 15, 2022, 11:02 UTC
Message-ID
<220715.86o7xqzkt3.gmgdl@evledraar.gmail.com>
In-Reply-To
<3c3c8c20bcb4e570d25a676ad1f29877762adb82.1657852722.git.gitgitgadget@gmail.com>
On Fri, Jul 15 2022, Derrick Stolee via GitGitGadget wrote:
Show 37 quoted lines
> From: Derrick Stolee <derrickstolee@github.com>
>
> The word "whitelist" has cultural implications that are not inclusive.
> Thankfully, it is not difficult to reword and avoid its use.
>
> Focus on changes in the test scripts, since most of the changes are in
> comments and test names. The renamed test_allow_var helper is only used
> once inside the widely-used test_proto helper.
>
> Signed-off-by: Derrick Stolee <derrickstolee@github.com>
> ---
>  t/README                        | 9 ++++-----
>  t/lib-proto-disable.sh          | 6 +++---
>  t/t5812-proto-disable-http.sh   | 2 +-
>  t/t5815-submodule-protos.sh     | 4 ++--
>  t/t9400-git-cvsserver-server.sh | 2 +-
>  t/test-lib-functions.sh         | 2 +-
>  t/test-lib.sh                   | 2 +-
>  7 files changed, 13 insertions(+), 14 deletions(-)
>
> diff --git a/t/README b/t/README
> index 309a31133c6..56d5ebb5798 100644
> --- a/t/README
> +++ b/t/README
> @@ -367,11 +367,10 @@ GIT_TEST_SPLIT_INDEX=<boolean> forces split-index mode on the whole
>  test suite. Accept any boolean values that are accepted by git-config.
>  
>  GIT_TEST_PASSING_SANITIZE_LEAK=<boolean> when compiled with
> -SANITIZE=leak will run only those tests that have whitelisted
> -themselves as passing with no memory leaks. Tests can be whitelisted
> -by setting "TEST_PASSES_SANITIZE_LEAK=true" before sourcing
> -"test-lib.sh" itself at the top of the test script. This test mode is
> -used by the "linux-leaks" CI target.
> +SANITIZE=leak will run only those tests that have marked themselves as
> +passing with no memory leaks by setting "TEST_PASSES_SANITIZE_LEAK=true"
> +before sourcing "test-lib.sh" itself at the top of the test script. This
> +test mode is used by the "linux-leaks" CI target.

It's hard to improve your own verbage, but I think in this case my original version can be improved still:

	GIT_TEST_PASSING_SANITIZE_LEAK=<bool> when compiled with
	SANITIZE=leak will, when true, only run those tests that declare
	themselves leak-free by setting "TEST_PASSES_SANITIZE_LEAK=true"
	before sourcing "test-lib.sh". This test mode is used by the
	"linux-leaks" CI target.
> -test_expect_success 'curl redirects respect whitelist' '
> +test_expect_success 'curl redirects respect allowed protocols' '

Isn't the real problem here that this is inaccurate with regards to "curl", i.e. AFAIK from browsing transport.c the whitelist of protocols has nothing to do with curl, we parse that out and apply it before we ever get to the specific transport layer.

So this should just be "http(s) transport respects GIT_ALLOW_PROTOCOL", no?

> -test_description='test protocol whitelisting with submodules'
> +test_description='test protocol restrictions with submodules'
Minor: I think this shows the awkwardness of using a word derived from
"allow". Before we could use "whitelist" and "whitelisting"
consistentlry, but now you have "allowed", "allowlist", "restrictions"
etc.
I guess you could say "test protocol allowances..." or something? Meh.
> -test_expect_success 'user can override whitelist' '
> +test_expect_success 'user can override with environment variable' '

Override what? This is a non-improvement. Saying "how" with "environment variable" is good, but we dropped any mention of what's being tested.

> -test_expect_success 'req_Root failure (export-all w/o whitelist)' \
> +test_expect_success 'req_Root failure (export-all w/o directory)' \
>    '! (cat request-anonymous | git-cvsserver --export-all pserver >log 2>&1 || false)'

Is it really that we don't have any directiory whatsoever, in that case I think this is a canditate for splitting up. I.e. the test didn't test what it was intending to test?

But if it's really "without <whatever you call the list of stuff you don't want>" we should still say that, no?

> -		# (Temporary?) whitelist of things we can't easily
> +		# (Temporary?) list of things we can't easily
>  		# pretend not to support

We've had this since my dfe1a17df9b (tests: add a special setup where prerequisites fail, 2019-05-13), so we can probably just drop "(Temporary?)" there while we're at it...

> -# skip non-whitelisted tests when compiled with SANITIZE=leak
> +# skip unmarked tests when compiled with SANITIZE=leak

This subtly changes the meaning in a way I didn't intend when writing this. I.e. the existing wording could be improved, but some of what we're skipping isn't "unmarked", it's explicitly marked as "false" (which we assume by default).

I.e. I read this new wording as saying "skip <unset>", whereas the previous can encompas "<unset,false>", just not "<true>"...

Previous: Derrick Stolee via GitGitGadgetNext: Derrick Stolee
Message 23 of 38 in “Use "allowlist" and "denylist" tree-wide”
  1. 0/3 Use "allowlist" and "denylist" tree-wideDerrick Stolee via GitGitGadget, Jul 13, 2022
  2. 1/3 Documentation: use allowlist and denylistDerrick Stolee via GitGitGadget, Jul 13, 2022
  3. Jeff KingJul 13, 2022
  4. Derrick StoleeJul 13, 2022
  5. Junio C HamanoJul 13, 2022
  6. 2/3 t/*: use allowlistDerrick Stolee via GitGitGadget, Jul 13, 2022
  7. 3/3 *: use allowlist and denylistDerrick Stolee via GitGitGadget, Jul 13, 2022
  8. Johannes SchindelinJul 13, 2022
  9. Jeff KingJul 13, 2022
  10. Johannes SchindelinJul 13, 2022
  11. Junio C HamanoJul 13, 2022
  12. Derrick StoleeJul 13, 2022
  13. Junio C HamanoJul 13, 2022
  14. Ævar Arnfjörð BjarmasonJul 13, 2022
  15. Junio C HamanoJul 13, 2022
  16. Derrick StoleeJul 15, 2022
  17. Ævar Arnfjörð BjarmasonJul 13, 2022
  18. 0/3 Remove use of "whitelist"Derrick Stolee via GitGitGadget, Jul 15, 2022
  19. 1/3 Documentation: remove use of whitelistDerrick Stolee via GitGitGadget, Jul 15, 2022
  20. Ævar Arnfjörð BjarmasonJul 15, 2022
  21. Derrick StoleeJul 19, 2022
  22. 2/3 t/*: avoid "whitelist"Derrick Stolee via GitGitGadget, Jul 15, 2022
  23. Ævar Arnfjörð BjarmasonJul 15, 2022
  24. Derrick StoleeJul 19, 2022
  25. Ævar Arnfjörð BjarmasonJul 19, 2022
  26. Derrick StoleeJul 19, 2022
  27. Junio C HamanoJul 19, 2022
  28. 3/3 *: avoid "whitelist"Derrick Stolee via GitGitGadget, Jul 15, 2022
  29. Ævar Arnfjörð BjarmasonJul 15, 2022
  30. Junio C HamanoJul 15, 2022
  31. Phillip WoodJul 15, 2022
  32. 0/5 Remove use of "whitelist"Derrick Stolee via GitGitGadget, Jul 19, 2022
  33. 1/5 daemon: clarify directory argumentsDerrick Stolee via GitGitGadget, Jul 19, 2022
  34. 2/5 git-cvsserver: clarify directory listDerrick Stolee via GitGitGadget, Jul 19, 2022
  35. 3/5 git.txt: remove redundant languageDerrick Stolee via GitGitGadget, Jul 19, 2022
  36. Jeff KingJul 31, 2022
  37. 4/5 t: avoid "whitelist"Derrick Stolee via GitGitGadget, Jul 19, 2022
  38. 5/5 transport.c: avoid "whitelist"Derrick Stolee via GitGitGadget, Jul 19, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.