Skip to content

fix(report): use current settings and udev rule paths - #273

Closed
Ziusz wants to merge 2 commits into
Lexonight1:mainfrom
Ziusz:fix-report-output
Closed

Ziusz wants to merge 2 commits into
Lexonight1:mainfrom
Ziusz:fix-report-output

Conversation

@Ziusz

@Ziusz Ziusz commented Aug 14, 2026

Copy link
Copy Markdown

Summary

Small cleanup for two misleading sections in trcc report. Both issues were spotted in the diagnostic output attached to #272.

Changes:

  • read settings from trcc.json instead of the old config.json path
  • look for 99-trcc-lcd.rules in the standard system, runtime, local, and distro package locations
  • update the hint from the obsolete 99-trcc.rules name to the current 99-trcc-lcd.rules filename
  • add regression tests for both fixes

This prevents existing settings files and udev rules from being incorrectly reported as missing.

Checklist

  • Tests pass (pytest -v --tb=short)
  • Linter clean (ruff check .)
  • Tested on hardware (if device-specific change)
  • New tests added (if adding functionality)

@Lexonight1

Copy link
Copy Markdown
Owner

@Ziusz — thank you for this, and sorry it sat so long without a word.

You spotted both of these from someone else's diagnostic output in #272, which is a generous way to spend your time. Both were real:

  • trcc report was reading the old config.json, so upgraded users had their pre-cutover settings printed back as if current
  • the hint named 99-trcc.rules, which was never the real filename

Both have since been fixed in the tree, independently of this PR — which means you found them first and we duplicated your work while this sat unreviewed. The udev one is now pinned in adapters/system/_udev.py, and the comment there records the same mistake you caught: the filename got restated once, got it wrong, and every correctly-installed system looked broken because of it.

So the credit for spotting both is yours even though the diff that landed isn't. I'm leaving this open for you to close or rebase as you prefer — it's your PR.

Thanks for caring about someone else's report enough to fix it.

@Lexonight1

Copy link
Copy Markdown
Owner

Thank you for this one, and sorry it sat. Two of its three fixes had already reached main by other routes while it waited — the rule name (99-trcc-lcd.rules, via #258) and the report reading trcc.json (the report was rewritten to read the live settings path). The third was real and yours alone: the health check looked in /etc, /lib and /usr/lib and ignored /run/udev/rules.d and /usr/local/lib/udev/rules.d, so a /usr/local install was told "No TRCC udev rules found" in the very report we ask people to send. That's landed as 6e554690, with the directory list now owned next to the writer path and a test that restates udev(7)'s four directories as the oracle, so the next missing one can't get past it. The commit credits you.

Closing this PR as superseded since everything in it is now on main and it no longer rebases. Ships with the next release.


If this project helps you, consider buying me a beer 🍺 or Ko-fi

@Lexonight1 Lexonight1 closed this Sep 18, 2026
Lexonight1 added a commit that referenced this pull request Sep 19, 2026
…reads

udev(7) reads rules from four directories: /usr/lib, /usr/local/lib,
/run and /etc.  The health check looked in /etc, /lib and /usr/lib, so a
rule installed by a `make install` under /usr/local, or generated into
/run, was reported as "No TRCC udev rules found" -- #258's defect again,
in two locations its fix did not cover.  PR #273 (@Ziusz) found both.

The directory list now lives beside RULES_PATH in _udev.py as
RULES_DIRS, and the check derives its candidates from it; the docstring
and the WARN message no longer claim the check looks only under /etc.

Two tests, because one is not enough: the existing parametrized test now
runs over RULES_DIRS rather than a hand-typed pair of directories, which
pins that the check USES the constant (mutate the check to ignore it: 4
cases fail) -- but it cannot notice a directory missing FROM the
constant, since its cases come from the constant (drop /run: the case
disappears, 8 pass).  So a second test restates udev(7)'s four
directories as the oracle and requires RULES_DIRS to cover them (drop
/run: it fails).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants