Skip to content

feat(RemoteID): per-region operator IDs with EU validity enforcement - #14593

Merged
DonLakeFlyer merged 6 commits into
mavlink:masterfrom
DonLakeFlyer:remote-id-per-region-operator-id
Jul 10, 2026
Merged

feat(RemoteID): per-region operator IDs with EU validity enforcement#14593
DonLakeFlyer merged 6 commits into
mavlink:masterfrom
DonLakeFlyer:remote-id-per-region-operator-id

Conversation

@DonLakeFlyer

Copy link
Copy Markdown
Contributor

Overview

Replaces the single operatorID / operatorIDValid Remote ID settings pair with per-region facts (operatorIDEU, operatorIDFAA), with legacy stored values migrated automatically.

EU operator ID: valid by construction

  • Writes to operatorIDEU are gated by an EN 4709-002 validator (format, Luhn mod-36 checksum, ASCII country code).
  • The full 19/20 character ID (including the 3 secret characters) must be entered, but only the 16-character public part is ever stored or broadcast — the secret characters never persist.
  • Region changes enforce regulatory requirements: EU forces operator ID broadcast on, FAA forces live operator location.

RemoteIDManager

  • Broadcasts the region-appropriate operator ID, gated on validity.
  • Tracks the vehicle's basic-ID-missing arm status error as current state instead of latching it forever.
  • Bounded UTF-8 decode of arm status error text.

Supporting infrastructure (separate commits)

  • FactMetaData: new maxStringLength key, enforced during validation and wired into FactTextField.maximumLength; strict unknown-key rejection for fact metadata JSON.
  • New JsonResourceAuditTest validates every bundled JSON resource against its parser — and caught latent errors fixed here (defaultValue vs default, minValue/maxValue vs min/max which had left the Remote ID fixed-position facts without limits).
  • QML settings/config generators: strict schema validation with contextual errors, stable objectNames for UI tests.
  • MockLink: arm-status override and last-received-message test APIs.
  • Categorized-logging pre-commit hook plus qCWarning conversions.

Testing

New suites: RemoteIDSettingsTest (unit), RemoteIDManagerTest (integration), RemoteIDSettingsUITest (QML UI), plus expanded FactMetaDataTest, JsonResourceAuditTest, and ~130 new generator pytest cases. Full unit suite and generator tests pass.

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.
@DonLakeFlyer

DonLakeFlyer commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

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.

This comment was marked as resolved.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Build Results

Platform Status

Platform Status Details
Linux Passed View
Windows Passed View
MacOS Passed View
Android Passed View

All builds passed.

Pre-commit

Check Status Details
pre-commit Failed (non-blocking) View

Pre-commit hooks: 0 passed, 0 failed, 0 skipped.

Test Results

linux-coverage-integration: 27 passed, 0 skipped
linux-coverage-unit: 105 passed, 0 skipped
Total: 132 passed, 0 skipped

Code Coverage

Coverage Baseline Change
66.6% 66.3% +0.3%

Artifact Sizes

Artifact Size Δ from master
QGroundControl 221.84 MB -4.43 MB (decrease)
QGroundControl-aarch64 179.43 MB No change
QGroundControl-installer-AMD64 137.92 MB -0.45 MB (decrease)
QGroundControl-installer-AMD64-ARM64 80.46 MB -0.19 MB (decrease)
QGroundControl-installer-ARM64 109.20 MB -0.00 MB (decrease)
QGroundControl-linux 87.09 MB -78.78 MB (decrease)
QGroundControl-mac 87.09 MB +0.00 MB (increase)
QGroundControl-windows 86.15 MB +0.00 MB (increase)
QGroundControl-x86_64 191.65 MB +0.00 MB (increase)
Total size decreased by 83.85 MB

Updated: 2026-07-10 04:29:41 UTC • Commit: 4db54b6 • Triggered by: Android

@DonLakeFlyer DonLakeFlyer added this to the Release V5.1 milestone Jul 9, 2026
@DonLakeFlyer
DonLakeFlyer force-pushed the remote-id-per-region-operator-id branch from 770837b to 11109ef Compare July 9, 2026 22:13
@DonLakeFlyer
DonLakeFlyer requested a review from Copilot July 9, 2026 22:14

This comment was marked as resolved.

@DonLakeFlyer
DonLakeFlyer force-pushed the remote-id-per-region-operator-id branch 2 times, most recently from 30fbf73 to 0f80c43 Compare July 10, 2026 03:16
@DonLakeFlyer
DonLakeFlyer requested a review from Copilot July 10, 2026 03:18

This comment was marked as low quality.

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.
@DonLakeFlyer
DonLakeFlyer force-pushed the remote-id-per-region-operator-id branch from 0f80c43 to 4db54b6 Compare July 10, 2026 03:44
@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 34.83871% with 202 lines in your changes missing coverage. Please review.
✅ Project coverage is 30.78%. Comparing base (f29efd3) to head (4db54b6).
⚠️ Report is 127 commits behind head on master.

Files with missing lines Patch % Lines
src/FactSystem/FactMetaData.cc 7.31% 62 Missing and 14 partials ⚠️
src/Settings/RemoteIDSettings.cc 52.17% 0 Missing and 55 partials ⚠️
src/Vehicle/RemoteIDManager.cc 31.74% 18 Missing and 25 partials ⚠️
src/FactSystem/ParameterManager.cc 0.00% 7 Missing ⚠️
src/Comms/QGCSerialPortInfo.cc 0.00% 0 Missing and 4 partials ⚠️
src/MissionManager/MissionCommandList.cc 0.00% 4 Missing ⚠️
src/Comms/MockLink/MockLink.h 50.00% 1 Missing and 2 partials ⚠️
src/FactSystem/Fact.cc 40.00% 2 Missing and 1 partial ⚠️
src/Camera/CameraMetaData.cc 0.00% 0 Missing and 2 partials ⚠️
src/Comms/MockLink/MockLink.cc 83.33% 0 Missing and 2 partials ⚠️
... and 2 more
Additional details and impacted files

Impacted file tree graph

@@            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     
Flag Coverage Δ
unittests 30.78% <34.83%> (+5.31%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/Comms/QGCSerialPortInfo.h 0.00% <ø> (ø)
src/FactSystem/Fact.h 83.33% <ø> (+8.33%) ⬆️
src/FactSystem/FactMetaData.h 78.68% <100.00%> (-2.67%) ⬇️
src/Settings/RemoteIDSettings.h 100.00% <100.00%> (ø)
src/Vehicle/RemoteIDManager.h 100.00% <100.00%> (+100.00%) ⬆️
src/Comms/LinkManager.cc 15.73% <0.00%> (+5.64%) ⬆️
src/Camera/CameraMetaData.cc 38.98% <0.00%> (ø)
src/Comms/MockLink/MockLink.cc 56.45% <83.33%> (+5.57%) ⬆️
src/MissionManager/PlanManager.cc 52.52% <0.00%> (ø)
src/Comms/MockLink/MockLink.h 62.79% <50.00%> (-6.66%) ⬇️
... and 7 more

... and 424 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0983301...4db54b6. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@DonLakeFlyer
DonLakeFlyer merged commit 5bc5dfb into mavlink:master Jul 10, 2026
48 checks passed
@DonLakeFlyer
DonLakeFlyer deleted the remote-id-per-region-operator-id branch July 10, 2026 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants