From f5ac7e5fb3e04e7956bc0611841944376add7cdf Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Mon, 19 Dec 2022 15:53:40 -0500 Subject: [PATCH] Document second step in non-random UUID generation Signed-off-by: Alex Nelson --- case_utils/local_uuid.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/case_utils/local_uuid.py b/case_utils/local_uuid.py index fd27fd2..1c8ae2b 100644 --- a/case_utils/local_uuid.py +++ b/case_utils/local_uuid.py @@ -33,6 +33,9 @@ def configure() -> None: + """ + This function is part of setting up demo_uuid() to generate non-random UUIDs. See demo_uuid() documentation for further setup notes. + """ global DEMO_UUID_BASE if os.getenv("DEMO_UUID_REQUESTING_NONRANDOM") == "NONRANDOM_REQUESTED": @@ -112,7 +115,10 @@ def demo_uuid() -> str: WARNING: This function was developed for use ONLY for reducing (but not eliminating) version-control edits to identifiers when generating sample data. It creates UUIDs that are decidedly NOT random, and should remain consistent on repeated calls to the importing script. - To prevent accidental non-random UUID usage, an environment variable, CASE_DEMO_NONRANDOM_UUID_BASE, must be set to a string provided by the caller. The variable's required value is the path to some directory. The variable's recommended value is the equivalent of the Make variable "top_srcdir" - that is, the root directory of the containing Git repository, some parent of the current process's current working directory. + To prevent accidental non-random UUID usage, two setup steps need to be done before calling this function: + + * An environment variable, CASE_DEMO_NONRANDOM_UUID_BASE, must be set to a string provided by the caller. The variable's required value is the path to some directory. The variable's recommended value is the equivalent of the Make variable "top_srcdir" - that is, the root directory of the containing Git repository, some parent of the current process's current working directory. + * The configure() function in this module must be called. """ global DEMO_UUID_BASE global DEMO_UUID_COUNTER