fix(QmlControls): keep qgc_version.h out of moc'd header to preserve moc cache - #14869
fix(QmlControls): keep qgc_version.h out of moc'd header to preserve moc cache#14869DonLakeFlyer wants to merge 1 commit into
Conversation
…moc cache qgc_version.h is regenerated at configure time with git describe output, so any branch or commit change alters its content. QGroundControlQmlGlobal.h included it directly, making it a transitive moc dependency of the header and everything downstream (MissionManager subtree), which invalidated those moccache entries on every branch switch and every CI run. Move the include to the .cc and define qgcAppDate() there. Verified: after mutating qgc_version.h and forcing a full re-moc, moccache hits 710/710. Fixes mavlink#14867
There was a problem hiding this comment.
Pull request overview
Moves generated version metadata out of a moc-processed header, preventing unnecessary moc cache invalidation while preserving application-date behavior.
Changes:
- Removes
qgc_version.hfrom the QML global header. - Moves
qgcAppDate()implementation and version include into the.ccfile.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/QmlControls/QGroundControlQmlGlobal.h |
Declares qgcAppDate() without version-header dependency. |
src/QmlControls/QGroundControlQmlGlobal.cc |
Includes version metadata and defines qgcAppDate(). |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #14869 +/- ##
==========================================
+ Coverage 25.47% 33.74% +8.27%
==========================================
Files 769 933 +164
Lines 65912 84616 +18704
Branches 30495 39120 +8625
==========================================
+ Hits 16788 28551 +11763
+ Misses 37285 36879 -406
- Partials 11839 19186 +7347
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 637 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
|
See the Build Results workflow run for details. |
Fixes #14867
Problem
qgc_version.his regenerated at configure time withgit describe/ commit-date output, so any branch or commit change alters its content.QGroundControlQmlGlobal.hincluded it directly, making it a transitive moc dependency of that header and everything downstream (CameraCalc.h,ComplexMissionItem.h,MissionController.h,SimpleMissionItem.h, and all headers including those). moccache validates dep contents by hash, so those entries missed on every branch switch — and on every CI run, since each run builds a new commit.The moc output never actually depended on the version macros, so the invalidation was pure waste.
Fix
Move the
qgc_version.hinclude intoQGroundControlQmlGlobal.ccand defineqgcAppDate()there instead of inline in the header.Verification
just buildclean.qgc_version.h.qgc_version.h, wiped all AUTOMOC state, rebuilt all 237 autogen targets → 710/710 moccache hits, 0 misses. Pre-fix, the entire QGroundControlQmlGlobal/MissionManager subtree missed.Should also improve CI moccache hit rates (#14719), which were at 88–95% partly due to this per-commit miss class.