qml: enforce QML lint and Core validation in CI #1096

Open
johnny9 wants to merge 48 commits from feature/qmllint-ci into qt6 AGit
johnny9 commented 2026-11-09 21:14:13 +00:00 (Migrated from github.com)

Enable QML static analysis and enforce the pinned Core checks against the app while preserving Qt 6.2 support.

  • Add an optional qml_lint target using Qt 6.10 tooling, generated C++ metadata, and both resource compatibility variants.
  • Expose existing models through a typed, non-owning ApplicationModels interface. Qualify model access and give extracted components explicit inputs and signals.
  • Keep two Qt 6.2 migration diagnostics informational: ComponentBehavior: Bound and target-less PropertyChanges. Other warnings and errors fail CI.
  • Add separate GitHub jobs for app/Core lint, whole-app clang-tidy, workflow validation, and sanitizers. Use Core's toolchain, Bitcoin tidy plugin, and runtime defaults.
  • Resolve findings, including unreachable code, recursive RPC formatting and object traversal, unsafe test-directory cleanup, and empty-list comparisons on older Qt.

Sanitizer exceptions cover intentional unsigned overflow in Qt's hash function and the independently reproduced Qt software texture-cache leak. Negative controls verify that unrelated integer errors and application leaks still fail, including leaks in an executable named bitcoin-core-app.

Local validation:

  • App/Core lint and workflow checks pass.
  • Clang-tidy passes all 120 app translation units and the sanitizer probe.
  • Qt 6.2 and 6.10: 9/9 CTest groups each.
  • Qt 6.4 with Clang 23 sanitizers: 10/10 groups, plus five GUI shutdown cases and RPC console tests.
  • QML lint passes 240 files per compatibility variant under the documented policy.

GUI sanitizer tests retain IPC, Core's 512 KiB stack limit, the original shutdown timeout, and strict stderr checks.

Latest review fixes and validation

At f37f636d0b, onboarding and shared settings components require explicit settings-model injection, live Settings entry points provide their model, and the mocks expose only the accessor available in the current application mode. Developer settings are hidden while the live model is unavailable. Model ownership is unchanged.

Validation: 28 onboarding, 28 settings-navigation and four settings-status tests pass. The missing-injection regression rejects the original default behavior. Strict lint for both compatibility variants matches the pristine PR head exactly: 11 existing Qt 6.11 property-override warnings per variant, with no introduced warnings; strict lint is therefore not locally green on that Qt version.

Enable QML static analysis and enforce the pinned Core checks against the app while preserving Qt 6.2 support. - Add an optional `qml_lint` target using Qt 6.10 tooling, generated C++ metadata, and both resource compatibility variants. - Expose existing models through a typed, non-owning `ApplicationModels` interface. Qualify model access and give extracted components explicit inputs and signals. - Keep two Qt 6.2 migration diagnostics informational: `ComponentBehavior: Bound` and target-less `PropertyChanges`. Other warnings and errors fail CI. - Add separate GitHub jobs for app/Core lint, whole-app clang-tidy, workflow validation, and sanitizers. Use Core's toolchain, Bitcoin tidy plugin, and runtime defaults. - Resolve findings, including unreachable code, recursive RPC formatting and object traversal, unsafe test-directory cleanup, and empty-list comparisons on older Qt. Sanitizer exceptions cover intentional unsigned overflow in Qt's hash function and the independently reproduced [Qt software texture-cache leak](https://github.com/qt/qtdeclarative/commit/f1b188df132c42da62197055725e5f7eebcc4249). Negative controls verify that unrelated integer errors and application leaks still fail, including leaks in an executable named `bitcoin-core-app`. **Local validation:** - App/Core lint and workflow checks pass. - Clang-tidy passes all 120 app translation units and the sanitizer probe. - Qt 6.2 and 6.10: 9/9 CTest groups each. - Qt 6.4 with Clang 23 sanitizers: 10/10 groups, plus five GUI shutdown cases and RPC console tests. - QML lint passes 240 files per compatibility variant under the documented policy. GUI sanitizer tests retain IPC, Core's 512 KiB stack limit, the original shutdown timeout, and strict stderr checks. ## Latest review fixes and validation At `f37f636d0b`, onboarding and shared settings components require explicit settings-model injection, live Settings entry points provide their model, and the mocks expose only the accessor available in the current application mode. Developer settings are hidden while the live model is unavailable. Model ownership is unchanged. Validation: 28 onboarding, 28 settings-navigation and four settings-status tests pass. The missing-injection regression rejects the original default behavior. Strict lint for both compatibility variants matches the pristine PR head exactly: 11 existing Qt 6.11 property-override warnings per variant, with no introduced warnings; strict lint is therefore not locally green on that Qt version.
rreview commented 2026-11-09 21:31:35 +00:00 (Migrated from github.com)

🟠 Minor · Sanitizer CI leaves the bootstrap and QML component runners uninstrumented

The new sanitizer job includes bitcoinqml_bootstrap_tests, bitcoinqml_qmltests and its warning probes without sanitizer instrumentation, leaving a coverage gap in the new gate rather than introducing a production regression.

Location: cmake/Sanitizers.cmake:29 (head).

🔵 Suggestion · Settings injection adds a negative test that the next commit removes

The settings rollout replaces incorrect typed defaults with explicit injection, then removes its runtime negative test one commit later; head uses explicit injection correctly, but combining the follow-ups would make the change easier to validate.

Location: qml/pages/onboarding/OnboardingWizard.qml:15 at ade7c01bb8e4 (commit) (commit).

🔵 Suggestion · PSBT migration temporarily drops the review-only GUI assertions

f7776f9f replaces the review-only PSBT GUI checks with model assertions, while 1713da2c restores warning text, Send/Save visibility and cleared-input checks; those assertions are present at head.

Location: test/integration/psbt/test_psbt.cpp:69 at f7776f9fcdf2 (commit) (commit).

🔵 Suggestion · The wallet-permission claim in 4bd75175 does not match its patch

4bd75175 says it restores read-only wallet-fixture permissions at scope exit, but its patch changes only CI container configuration and documentation.

Location: .github/workflows/ci.yml:58 at 4bd75175f84e (commit) (commit).

🔵 Suggestion · The PR description omits two wallet send and PSBT behavior changes

The lint/CI-focused description omits changes to watch-only draft Send availability and known-PSBT recognition, although the wallet commit subjects identify both.

Location: qml/models/walletqmlmodel.cpp:2403 (head).

Review coverage was incomplete.


Reviewed: 042d9388dda4 · Review report

<!-- ralph-major:bitcoin-core/gui-qml --> **🟠 Minor · Sanitizer CI leaves the bootstrap and QML component runners uninstrumented** The new sanitizer job includes `bitcoinqml_bootstrap_tests`, `bitcoinqml_qmltests` and its warning probes without sanitizer instrumentation, leaving a coverage gap in the new gate rather than introducing a production regression. Location: [cmake/Sanitizers.cmake:29](<https://github.com/bitcoin-core/gui-qml/blob/042d9388dda4562e681cec5bc4b47e327e942641/cmake/Sanitizers.cmake#L29>) (head). **🔵 Suggestion · Settings injection adds a negative test that the next commit removes** The settings rollout replaces incorrect typed defaults with explicit injection, then removes its runtime negative test one commit later; head uses explicit injection correctly, but combining the follow-ups would make the change easier to validate. Location: [qml/pages/onboarding/OnboardingWizard.qml:15 at ade7c01bb8e4 (commit)](<https://github.com/bitcoin-core/gui-qml/blob/ade7c01bb8e49866c16de6225baa2f57c0ac6500/qml/pages/onboarding/OnboardingWizard.qml#L15>) (commit). **🔵 Suggestion · PSBT migration temporarily drops the review-only GUI assertions** `f7776f9f` replaces the review-only PSBT GUI checks with model assertions, while `1713da2c` restores warning text, Send/Save visibility and cleared-input checks; those assertions are present at head. Location: [test/integration/psbt/test_psbt.cpp:69 at f7776f9fcdf2 (commit)](<https://github.com/bitcoin-core/gui-qml/blob/f7776f9fcdf28e45518ead35a90f4d5bde1aa7e7/test/integration/psbt/test_psbt.cpp#L69>) (commit). **🔵 Suggestion · The wallet-permission claim in `4bd75175` does not match its patch** `4bd75175` says it restores read-only wallet-fixture permissions at scope exit, but its patch changes only CI container configuration and documentation. Location: [.github/workflows/ci.yml:58 at 4bd75175f84e (commit)](<https://github.com/bitcoin-core/gui-qml/blob/4bd75175f84e557b3366d607731ff68c341d42fa/.github/workflows/ci.yml#L58>) (commit). **🔵 Suggestion · The PR description omits two wallet send and PSBT behavior changes** The lint/CI-focused description omits changes to watch-only draft Send availability and known-PSBT recognition, although the wallet commit subjects identify both. Location: [qml/models/walletqmlmodel.cpp:2403](<https://github.com/bitcoin-core/gui-qml/blob/042d9388dda4562e681cec5bc4b47e327e942641/qml/models/walletqmlmodel.cpp#L2403>) (head). Review coverage was incomplete. <!-- Review tier: sensitive --> --- Reviewed: [`042d9388dda4`](<https://github.com/bitcoin-core/gui-qml/commit/042d9388dda4562e681cec5bc4b47e327e942641>) · [Review report](<https://review.fish.foo/report/gui/1096-042d9388dda4562e681cec5bc4b47e327e942641-3223-10.html>)
Sign in to join this conversation.
No description provided.