docs(settings): correct the config-precedence docstring - #1542
Open
dimitri-yatsenko wants to merge 1 commit into
Open
docs(settings): correct the config-precedence docstring#1542dimitri-yatsenko wants to merge 1 commit into
dimitri-yatsenko wants to merge 1 commit into
Conversation
The module docstring listed the configuration sources in the wrong order — secrets directories above datajoint.json — contradicting the loader, where _load_secrets only assigns when a value is still unset, so datajoint.json (and env) win over .secrets/. Fix the order to: runtime > env > datajoint.json > .secrets/ > defaults, and state explicitly that the file outranks the secrets directory. Also correct the .secrets/ example: the loader reads database.* and stores.<name>.<attr> files, not aws.secret_access_key. This is the upstream origin of the inverted-precedence docs corrected in datajoint-docs (#258).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the upstream origin of the inverted-precedence documentation corrected in datajoint-docs #258.
Problem
settings.py's module docstring listed the configuration sources as environment variables → secrets directories → datajoint.json, putting.secrets/abovedatajoint.json. That contradicts the loader:_load_secretsassigns a value only when the target is still unset (... and self.database.user is None; stores useif attr not in self.stores[store_name]), sodatajoint.jsonand environment variables win over.secrets/. The docstring was almost certainly the source of the same inversion that had spread to four docs pages.Fix
dj.config→ envDJ_*→datajoint.json→.secrets/→ defaults, and state explicitly that the config file outranks the secrets directory (the secrets dir only fills in what's left unset)..secrets/example in the project-structure block: the loader readsdatabase.*andstores.<name>.<attr>files — neveraws.secret_access_key— so the example now showsstores.main.secret_key.Docstring-only; no code or behavior change.
import datajointverified; pre-commit (ruff/mypy) clean.