refactor: give the settings #984 could not reach the Ascender name - #998
Merged
Merged
Conversation
ctrliq#984 renamed the eleven settings the database registers. Seventeen more were left, because they are not registered: thirteen are defined in defaults.py and overridden in a settings file, and four are read from the environment. The thirteen take the same route as ctrliq#984: renamed at the definition and every use, with the old name added to the _FORMER_NAMES table so a conf.d file that writes AWX_NOTIFICATION_REQUEST_TIMEOUT still lands on the current name. The four from the environment could not, and this is the part worth reading. That table runs after the settings modules have loaded, and AWX_SETTINGS_FILE and AWX_SETTINGS_DIR decide which settings file loads at all, so an alias applied afterwards would be too late to matter. They read both names directly instead, through one helper, in the same shape as the ASCENDER_ variables ascender-kit took in its ctrliq#72. Nothing has to move to the new names. AWX_SETTINGS_FILE is what the Dockerfile passes to collectstatic, AWX_LOGGING_MODE is what the three installers write into their compose environments, and AWX_WEB_PROCESS is what supervisor sets. Those keep working for as long as they exist rather than for a release. A test asserts that no settings module reads one of the four with a bare os.environ.get, since that would answer to one name only, which is the failure the helper exists to prevent. Both directions are checked against a real production settings load: the old environment name still selects the settings file, and a file written with the old setting name still carries over.
blaipr
added a commit
to blaipr/ascender
that referenced
this pull request
Sep 14, 2026
/etc/tower holds the settings files and /var/log/tower the logs, and they are /etc/ascender and /var/log/ascender now, with the Tower names as aliases onto them. Same shape as the data directory, the development tree and the receptor socket: the real directory takes the Ascender name so retiring the old one is a deleted symlink. The aliases are needed rather than tidy. ascender-install names /etc/tower thirty seven times and the operator thirty eight, mounting individual files at /etc/tower/SECRET_KEY, /etc/tower/settings.py and /etc/tower/conf.d/*.py. A file mounted through a symlinked parent is a different case from the directory mounts the other aliases rely on, so it was checked rather than assumed: both a SECRET_KEY and a conf.d file mounted at the old paths land in /etc/ascender and the symlink survives the mount. production.py keeps naming /etc/tower in its two defaults. Those lines are rewritten by ctrliq#998 and resolve through the alias in the meantime, so they move when that lands rather than conflicting with it now. One thing worth naming, because I did it: the sweep that moved the tooling paths also rewrote the two ln -s lines that create the aliases, leaving symlinks pointing at themselves. Every symlink the image creates is now checked for that.
# Conflicts: # ascender/main/notifications/pagerduty_backend.py # ascender/main/notifications/twilio_backend.py # ascender/main/tests/unit/settings/test_environment_names.py # ascender/main/tests/unit/settings/test_logging_mode.py # ascender/settings/environment.py
ctrliq#997 landed while this branch was open, so the module this adds now lives at ascender/settings/environment.py and the five imports of it named the old package. They resolved, because the awx shim aliases the whole package, but a settings module that cannot load without the compatibility layer is the wrong dependency to take on: production.py and defaults.py are imported to decide which settings file loads at all, and this is the branch that gives those settings the Ascender name in the first place.
Contributor
Author
|
Rebuilt on the post-#997 main: mergeable now, full suite green at 4238 passed, 6 skipped. |
cigamit
approved these changes
Sep 15, 2026
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.
#984 renamed the eleven settings the database registers. Seventeen more were left, because they are not registered: thirteen are defined in
defaults.pyand overridden in a settings file, and four are read from the environment.The thirteen
ASCENDER_AUTO_DEPROVISION_INSTANCES,ASCENDER_CALLBACK_PROFILE, the fiveASCENDER_CONTAINER_GROUP_*,ASCENDER_CONTROL_NODE_TASK_IMPACT,ASCENDER_NOTIFICATION_REQUEST_TIMEOUT,ASCENDER_REBUILD_SMART_MEMBERSHIP,ASCENDER_REQUEST_PROFILE_WITH_DOT,ASCENDER_RUNNER_OMIT_ENV_FILES,ASCENDER_RUNNER_SUPPRESS_OUTPUT_FILE.Same route as #984: renamed at the definition and every use, with the old name added to the
_FORMER_NAMEStable, so aconf.dfile that writesAWX_NOTIFICATION_REQUEST_TIMEOUTstill lands on the current name.The four from the environment, which could not take that route
AWX_SETTINGS_FILE,AWX_SETTINGS_DIR,AWX_LOGGING_MODE,AWX_WEB_PROCESS.The alias table runs after the settings modules have loaded, and two of these decide which settings file loads at all. An alias applied afterwards would be too late to matter. They read both names directly instead, through one helper, in the same shape as the
ASCENDER_variables ascender-kit took in its #72.Nothing has to move
AWX_SETTINGS_FILEis what the Dockerfile passes tocollectstatic.AWX_LOGGING_MODEis what the three installers write into their compose environments.AWX_WEB_PROCESSis what supervisor sets.Those keep working for as long as they exist, not for a release.
Checking
Both directions against a real production settings load:
AWX_NOTIFICATION_REQUEST_TIMEOUT = 99arrives assettings.ASCENDER_NOTIFICATION_REQUEST_TIMEOUT == 99).A test asserts that no settings module reads one of the four with a bare
os.environ.get, since that would answer to one name only, which is the failure the helper exists to prevent.1,573 unit and conf tests pass.
typed.pyregenerated.ruff checkandruff format --checkclean.Touches
defaults.pyandproduction.py, so it conflicts with #997; whichever lands second is a rebase onto the moved paths.