Repository navigation
20261021 - Stop shipping and passing on the tracker's dead minimum SNR - #50
Merged
Merged
Conversation
retina-tracker v0.5.0 tracks every detection. Its per-site SNR gate is
gone (retina-tracker ed9bbea), and a config that still sets min_snr is
loaded and ignored. retina-gui stopped offering the field in #119, but
default.yml still shipped min_snr: 7.0 and the merger still wrote it into
retina-tracker.yaml, so every node was handed a setting nothing reads.
Removing it from default.yml alone would reach no node. The merger seeds
user.yml with a whole copy of default.yml on first boot, so every node on
the estate still holds retina_tracker: {min_snr: 7.0}, or whatever
retina-gui wrote there. migrate_remove_min_snr() drops the key from the
user overlay at merge time, unconditionally like migrate_remove_tracker(),
and drops the section once it is empty. user.yml on disk is left alone, so
the migration stays load-bearing and a Mender rollback regenerates the old
config from the old default.yml.
Simply deleting the key would have left an empty retina_tracker section,
which YAML reads as null and the merger would have written as tracker:
null. retina-tracker's load_config() calls .update() on each section it
finds, so that crashes it with TypeError and the tracker would crash-loop
on every node. An empty or null section is now dropped by the migration,
and generate_retina_tracker_config() treats one as nothing to override.
It also writes the file on every run, as {} when there is nothing to
override, because skipping it left the previous merge's file on disk still
saying min_snr: 7.0.
Tests: the three generic retina-tracker.yaml tests move off min_snr to
gate_threshold, and new ones cover the first-boot copy and a value
retina-gui wrote, another tracker key surviving, an empty and a null
section, a stale file being overwritten, user.yml left untouched and the
shipped default.yml. Every tracker file is loaded through a mirror of the
tracker's own load_config(). Full merger suite 83 passed, ruff and the
dead-code hook clean. On a test node, the real config-merger and
retina-tracker v0.5.0 images were run against a copy of its user.yml: the
merged config differed from the live one by retina_tracker.min_snr alone,
the tracker loaded the {} file cleanly, and the same tracker crashed on a
tracker: null file.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
What
Every node is handed
min_snr: 7.0for retina-tracker, a setting nothing reads any more. This stops shipping it, drops the copy every node holds inuser.yml, and makes sure removing it cannot crash the tracker.Why
retina-tracker v0.5.0 tracks every detection. Its per-site SNR gate is gone (retina-tracker
ed9bbea, "Track every detection: no per-site SNR threshold"), and a config that still setsmin_snris loaded and ignored. retina-gui stopped offering the field in retina-gui#119. Here, though,default.ymlstill shipped it and the merger still wrote it intoretina-tracker.yaml.Two things made "just delete the line" wrong:
user.ymlwith a whole copy ofdefault.ymlon first boot, so every node already holdsretina_tracker: {min_snr: 7.0}, or whatever retina-gui wrote there. This is the same first-boot copy problemmigrate_remove_tracker()and the other migrations solve.retina_tracker:section reads asnull, and the merger would have writtentracker: null. retina-tracker'sload_config()calls.update()on each section it finds, so that raisesTypeErrorand the tracker crash-loops.Fix
config/default.yml: theretina_trackersection is removed, so the tracker runs on its own built-in defaults. A comment says how a section would map if one is added again.migrate_remove_min_snr(user):retina_tracker.min_snrfrom the user overlay at merge time.migrate_remove_tracker(), because the setting configures nothing.user.ymlon disk untouched, so it stays load-bearing and a Mender rollback regenerates the old config from the olddefault.yml.generate_retina_tracker_config():retina-tracker.yamlon every run, as{}when there is nothing to override, and never astracker: null.min_snr: 7.0.Testing
retina-tracker.yamltests move offmin_snrtogate_threshold.user.ymlleft untouched, and the shippeddefault.yml.load_config(), so atracker: nullwould fail the test.pytest config-merger/test/ scripts/test/gives 83 passed.ruff check .and the pre-commit dead-code hook are clean.retina-config-merger:v0.4.8.0-devandretina-tracker:v0.5.0images, with the new script anddefault.ymlmounted over the baked-in ones, against a copy of its realuser.yml, writing to a scratch folder:{}.user.ymlwas unchanged.config.ymldiffered from the live one byretina_tracker.min_snralone.{}file and fell back to its defaults.TypeError: 'NoneType' object is not iterableon atracker: nullfile.Not verified: a full stack run with this merger in place. The merger image is only built at release, so the live stack on the test node was not touched.
Docs
retina-node has no
docs/folder, and the README does not mention the tracker section. The explanation lives in thedefault.ymlcomment and the two docstrings.After this
CONFIG_MERGER_Vto its own tag as usual. The change is in the merger image, which bakes indefault.yml.docs/measurement-noise.mdlists retina-node'smin_snras an outstanding follow-up, which can be closed once this ships.🤖 Generated with Claude Code