Skip to content

Commit

Permalink
Merge pull request #100 from casework/update_local_uuid_documentation
Browse files Browse the repository at this point in the history
Document second step in non-random UUID generation
  • Loading branch information
kchason authored Dec 19, 2022
2 parents 9bae915 + f5ac7e5 commit bb18283
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion case_utils/local_uuid.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit bb18283

Please sign in to comment.