Skip to content

fix(QmlControls): keep qgc_version.h out of moc'd header to preserve moc cache - #14869

Open
DonLakeFlyer wants to merge 1 commit into
mavlink:masterfrom
DonLakeFlyer:fix-moccache-qgc-version
Open

fix(QmlControls): keep qgc_version.h out of moc'd header to preserve moc cache#14869
DonLakeFlyer wants to merge 1 commit into
mavlink:masterfrom
DonLakeFlyer:fix-moccache-qgc-version

Conversation

@DonLakeFlyer

Copy link
Copy Markdown
Contributor

Fixes #14867

Problem

qgc_version.h is regenerated at configure time with git describe / commit-date output, so any branch or commit change alters its content. QGroundControlQmlGlobal.h included 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.h include into QGroundControlQmlGlobal.cc and define qgcAppDate() there instead of inline in the header.

Verification

  • just build clean.
  • No moccache manifest from the new build references qgc_version.h.
  • Simulated branch change: appended a comment to the generated 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.

…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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.h from the QML global header.
  • Moves qgcAppDate() implementation and version include into the .cc file.

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

codecov Bot commented Aug 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 33.74%. Comparing base (f29efd3) to head (2a2739b).
⚠️ Report is 288 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            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     
Flag Coverage Δ
unittests 33.74% <100.00%> (+8.27%) ⬆️

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

Files with missing lines Coverage Δ
src/QmlControls/QGroundControlQmlGlobal.cc 27.77% <100.00%> (+19.54%) ⬆️
src/QmlControls/QGroundControlQmlGlobal.h 92.00% <ø> (+77.18%) ⬆️

... and 637 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 e1f0d6a...2a2739b. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Build results unavailable — artifact download from one or more platform workflows failed (likely artifact retention expiry or transient API error). The combined report cannot be generated for this run.

See the Build Results workflow run for details.

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.

moccache: branch/commit switch invalidates cache via generated qgc_version.h

2 participants