feat(RemoteID): per-region operator IDs with EU validity enforcement - #14593
Conversation
Convert bare qWarning() calls to qCWarning with their module's logging category and add a check-categorized-logging pre-commit hook to keep qDebug/qInfo/qWarning/qCritical from bypassing categories going forward.
Adds a maxStringLength FactMetaData key (guarded setter, copied by operator=, negative values rejected) enforced during cooked-value validation, exposed to QML via Fact.maxStringLength, and wired into FactTextField's maximumLength. Also adds validateKeysStrict so FactMetaData JSON parsing rejects unknown keys, and converts the file's warnings to the FactMetaDataLog category.
Adds JsonResourceAuditTest, which walks every JSON file in the Qt resource system, fails on syntax errors, and strictly validates keys by fileType (FactMetaData, MavCmdInfo, CameraMetaData, USBBoardInfo, PowerModulePresets). Fixes the latent errors it caught: defaultValue vs default in TransformPositionController metadata and the silently ignored minValue/maxValue (vs min/max) keys on the Remote ID fixed position facts, which left those facts without limits.
…erators Settings/config page generators now reject unknown JSON keys at every level, validate container and nested-object shapes with contextual errors instead of bare tracebacks, and require well-formed 'group.factName' setting references. Generated pages emit stable objectNames (page, group, text field, checkbox) for QML UI tests, failing generation on empty or duplicate sanitized names. The hand-written SettingsPage flickable gets a matching objectName.
setRemoteIDArmStatus lets tests drive the periodic OPEN_DRONE_ID_ARM_STATUS content (mutex-guarded: written by the test thread, read by the 1Hz worker). lastReceivedMavlinkMessage exposes the most recent message received per msgid so tests can assert on vehicle-bound traffic. Also documents in UnitTest::init why there is deliberately no generic settings-fact reset sweep.
|
This is a replacement for #14262. Along the way I found a number of directly and indirectly related boat anchors I took care of. This will now show operator id validation errors using the standard validation error ui. The main problem was that I screwed up the remote id settings ui when I converted it to json. This pull fixes all that. It use the pre-existing custom fact validation support to hook in the operator Id validation. In the end it accomplishes the same validation that original pull did. Also cleaned up a bunch of complex code path by storing EU and FAA operator id formats as two separate settings. |
Build ResultsPlatform Status
All builds passed. Pre-commit
Pre-commit hooks: 0 passed, 0 failed, 0 skipped. Test Resultslinux-coverage-integration: 27 passed, 0 skipped Code Coverage
Artifact Sizes
Updated: 2026-07-10 04:29:41 UTC • Commit: 4db54b6 • Triggered by: Android |
770837b to
11109ef
Compare
30fbf73 to
0f80c43
Compare
Replaces the single operatorID/operatorIDValid pair with per-region facts (operatorIDEU, operatorIDFAA), migrating legacy stored values. EU operator IDs are valid by construction: writes are gated by an EN 4709-002 validator (format, Luhn mod-36 checksum, ASCII country code) and sanitized so only the 16-character public part is ever stored or broadcast - the 3 secret characters never persist. Region changes enforce regulatory requirements (EU forces operator ID broadcast, FAA forces live operator location). RemoteIDManager broadcasts the region-appropriate ID, gates emission on validity, tracks the vehicle's basic-ID-missing arm status error as current state instead of latching it, and decodes arm status error text with bounded UTF-8 conversion. Covered by new unit (RemoteIDSettingsTest), integration (RemoteIDManagerTest), and QML UI (RemoteIDSettingsUITest) suites.
0f80c43 to
4db54b6
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #14593 +/- ##
==========================================
+ Coverage 25.47% 30.78% +5.31%
==========================================
Files 769 785 +16
Lines 65912 66888 +976
Branches 30495 30998 +503
==========================================
+ Hits 16788 20594 +3806
+ Misses 37285 32265 -5020
- Partials 11839 14029 +2190
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 424 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
Overview
Replaces the single
operatorID/operatorIDValidRemote ID settings pair with per-region facts (operatorIDEU,operatorIDFAA), with legacy stored values migrated automatically.EU operator ID: valid by construction
operatorIDEUare gated by an EN 4709-002 validator (format, Luhn mod-36 checksum, ASCII country code).RemoteIDManager
Supporting infrastructure (separate commits)
FactMetaData: newmaxStringLengthkey, enforced during validation and wired intoFactTextField.maximumLength; strict unknown-key rejection for fact metadata JSON.JsonResourceAuditTestvalidates every bundled JSON resource against its parser — and caught latent errors fixed here (defaultValuevsdefault,minValue/maxValuevsmin/maxwhich had left the Remote ID fixed-position facts without limits).objectNames for UI tests.Testing
New suites:
RemoteIDSettingsTest(unit),RemoteIDManagerTest(integration),RemoteIDSettingsUITest(QML UI), plus expandedFactMetaDataTest,JsonResourceAuditTest, and ~130 new generator pytest cases. Full unit suite and generator tests pass.