Repository navigation
Conversation
ctrliq#990 moved the analytics loggers once Ledger read both names. The platform's own diagnostics stayed on awx: eighteen logger names in the LOGGING block and a hundred and forty five getLogger calls, which is every log line an operator reads. They move, and the reason this is not a search and replace is LOG_AGGREGATOR_LOGGERS. It is a database setting holding the first segment of the names a deployment forwards to its aggregator, its default was awx, and the filter decides with record.name.split('.')[0] in loggers. Renaming the loggers alone would leave every existing install logging happily and forwarding nothing, with no error anywhere. So the old selector is an alias. A record named ascender.main.dispatch is forwarded when the stored setting says either ascender or awx, and the two prefixes are named in constants.py beside the analytics one rather than spelled out at the point of use. The default and its help text move to ascender, and the help says awx still selects for a deployment that predates the rename. The blocklist moves with the names, since it lists loggers by name, and the two tests that capture by logger name follow. The module alias tests in test_dispatch.py are left alone: those resolve import paths rather than logger names, and the awx alias there is ctrliq#988's, not this one. test_service_logger_names.py states the names and the alias, including that accepting awx does not turn into accepting anything at all. Verified as far as this environment allows. ruff check and ruff format pass on all 144 files. The new test could not be run here because the suite imports python-ldap, which needs system libraries this box does not have, so the filter's decision branch was extracted from the source and exercised verbatim instead: a record under the new name is forwarded for a stored selector of either spelling, and an unrelated logger is still not forwarded under either. CI runs the real thing.
The new test claimed ascender.conf.settings is forwarded to the external logger under either selector. Running it said otherwise: ascender.conf is on LOGGER_BLOCKLIST, so record_is_blocked returns before the selector is ever considered. The test was wrong, not the filter. Reading a setting to decide whether to forward a log line about reading a setting is the recursion the blocklist exists to stop. So that name comes out of the forwarded cases and gets a test of its own, which states the blocking instead. The branch extracted from the source and run by hand could not have caught this: it did not include record_is_blocked.
|
I had Fable take a glance and it also came back with this. What the PR missed. The logging connectivity test view still special-cases the old selector. Read On a pre-rename install the connectivity test message reaches no handler at all, so the "Test" button on the logging settings page silently proves nothing for exactly the deployments the alias was written to protect. With the new default the message went out under a bogus name, The fix for pr-1022:
|
The logging settings page's Test button sent its record through the first selector stored in LOG_AGGREGATOR_LOGGERS, special-casing the literal awx. After the rename that logger is configured under ascender, so on an install storing the old selector the record reached no handler at all and the root logger has none either: the button proved nothing for exactly the deployments the alias was written to protect. With the current selector it went out as ascender.analytics.ascender, which is not a logger anything declares. Both selectors now map to the service logger, and so does the empty fallback. Any other selector is an analytics headline name and is filed under the analytics prefix as before. Reported by cigamit on ctrliq#1022.
|
Confirmed and fixed in 67d6827, thanks. I reproduced all three parts before applying it rather than taking the report on trust. Probing the handler chain on the branch,
The The Verification: the two new helper tests fail if the helper keeps the old |
#990 moved the analytics loggers once Ledger read both names. The platform's own diagnostics stayed on
awx: 18 logger names in theLOGGINGblock and 145getLoggercalls, which is every log line an operator reads.Why this is not a search and replace
LOG_AGGREGATOR_LOGGERSis a database setting, holding the first segment of the names a deployment forwards to its aggregator. Its default wasawx, and the filter decides like this:Rename the loggers alone and every existing install keeps logging happily and forwards nothing, with no error anywhere. The records become
ascender.main.dispatch, the stored setting still saysawx, and the two never meet again.So the old selector is an alias
A record named
ascender.main.dispatchis forwarded when the stored setting says eitherascenderorawx. Both prefixes are named inconstants.pybesideANALYTICS_LOGGER_PREFIXrather than spelled out at the point of use.The default and its help text move to
ascender, and the help says plainly thatawxstill selects for a deployment that predates the rename.What moved with them
constants.py, which lists loggers by name.caplog.at_level(logger='awx.conf.settings')).What was deliberately left
test_dispatch.py'sresolve_callable('awx.main.tests...')assertions. Those resolve import paths, not logger names, and theawxalias there belongs to #988's module aliasing, not to this change. Renaming them would have deleted a test of a different feature.Verification
Run against a real PostgreSQL, with the suite's data paths pointed somewhere writable, so the run is not limited by this machine.
The unit suite, this branch against the same suite on
main:Widening to
ascender/conf/tests/as well, the failing and erroring test IDs were diffed rather than counted: 25 on each side, an identical set. The 14 extra passes are this PR's new test file, and the only textual difference anywhere in that output is three captured log lines readingascender.main.tasks.jobswhere they readawx.main.tasks.jobsbefore, which is the change doing its job.ascender/main/tests/unit/test_tasks.pyon its own: 150 passed.ruff checkandruff format --checkpass on all 144 files.One thing running it caught
The first version of the test asserted that
ascender.conf.settingsis forwarded under either selector. It is not:ascender.confis onLOGGER_BLOCKLIST, sorecord_is_blockedreturns before the selector is considered. Reading a setting to decide whether to forward a log line about reading a setting is the recursion that blocklist exists to stop.The test was wrong, not the filter, and it now asserts the blocking instead. Worth saying because the check I ran before the libraries were available, extracting the decision branch from the source, could not have caught it: that extract did not include
record_is_blocked.For the release notes
Log lines change prefix. Anything grepping
awx.mainin a customer's own tooling needs updating, though theirLOG_AGGREGATOR_LOGGERSsetting does not.