Skip to content

Commit dcf699f

Browse files
fix(updater): address review feedback and CI timeout on #737
Add QtQuick.Layouts import for the toast, reset Idle state after silent check failures, clear m_silentCheck on early returns, filter telemetry payloads in UpdaterTelemetry, and skip check.success on invalid compare. Limit build-wrapper to test targets and raise unit-tests-linux cap to 90m. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 2f4be09 commit dcf699f

7 files changed

Lines changed: 52 additions & 12 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -895,9 +895,9 @@ jobs:
895895
needs: [build-n-cache-assimp-linux, build-n-cache-ogre-linux]
896896
runs-on: ubuntu-latest
897897
# Hard cap on the whole job. The full sweep takes ~12 min normally
898-
# (build + xvfb + ~25 suites + coverage + sonar). Cap at 60 so a
898+
# (build + xvfb + ~25 suites + coverage + sonar). Cap at 90 so a
899899
# cold ccache build on a large PR still finishes under the limit.
900-
timeout-minutes: 60
900+
timeout-minutes: 90
901901
permissions: read-all
902902
env:
903903
LD_LIBRARY_PATH: gcc_64/lib/:/usr/local/lib/:/usr/local/lib/OGRE/:/usr/local/lib/pkgconfig/:/lib/x86_64-linux-gnu/
@@ -1043,8 +1043,21 @@ jobs:
10431043
# (ccache wraps the compiler, so build-wrapper's intercept is
10441044
# transparent to the cache layer).
10451045
1046-
# Run build-wrapper to capture compilation into a named directory
1047-
build-wrapper-linux-x86-64 --out-dir build-wrapper-output make -C build -j$(nproc)
1046+
# Build only test targets (BUILD_QT_MESH_EDITOR=OFF) so the compile
1047+
# phase leaves room for the ~25-suite test sweep within the job cap.
1048+
build-wrapper-linux-x86-64 --out-dir build-wrapper-output \
1049+
make -C build -j$(nproc) \
1050+
UnitTests \
1051+
qtmesh_test_common \
1052+
qtmesh_updater \
1053+
qtmesh_ps1core_stub \
1054+
qtmesh_ps1core_libretro \
1055+
MaterialEditorQML_test \
1056+
MaterialEditorQML_qml_test \
1057+
MaterialEditorQML_perf_test \
1058+
CloudAccountMenuButton_test \
1059+
ProjectPackager_test \
1060+
MaterialEditorQML_qml_test_runner
10481061
10491062
echo "=== ccache statistics ==="
10501063
ccache -s || true

qml/UpdateToast.qml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import QtQuick
22
import QtQuick.Controls
3+
import QtQuick.Layouts
34
import QtQuick.Window
45
import PropertiesPanel 1.0
56

@@ -15,8 +16,6 @@ Window {
1516

1617
property string versionText: ""
1718

18-
signal viewUpdateClicked()
19-
2019
function showForVersion(version) {
2120
versionText = version
2221
reposition()

src/main.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include "AppLaunchHandler.h"
3333
#ifdef ENABLE_AUTO_UPDATER
3434
#include "updater/UpdaterController.h"
35+
#include "updater/UpdaterTelemetry.h"
3536
#endif
3637

3738
#ifndef Q_OS_WIN
@@ -190,6 +191,8 @@ int main(int argc, char *argv[])
190191
for (int i = 1; i < argc; ++i) {
191192
if (QString::fromUtf8(argv[i]) == QLatin1String("--no-update-check")) {
192193
UpdaterController::setSessionBackgroundChecksDisabled(true);
194+
UpdaterTelemetry::breadcrumb(QStringLiteral("updater.background.skip"),
195+
QStringLiteral("session_disabled"));
193196
}
194197
}
195198
#endif

src/mainwindow.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include "SentryReporter.h"
3131
#ifdef ENABLE_AUTO_UPDATER
3232
#include "updater/UpdaterController.h"
33+
#include "updater/UpdaterTelemetry.h"
3334
#endif
3435
#include <QDialog>
3536
#include <QProgressDialog>
@@ -4523,6 +4524,9 @@ void MainWindow::showUpdaterDialog(bool runCheck)
45234524

45244525
void MainWindow::showUpdateToast(const QString& version)
45254526
{
4527+
UpdaterTelemetry::breadcrumb(QStringLiteral("updater.background.toast"),
4528+
QStringLiteral("version=%1").arg(version));
4529+
45264530
if (m_updateToastEngine) {
45274531
if (auto* toast = m_updateToastWindow) {
45284532
QMetaObject::invokeMethod(toast, "showForVersion", Q_ARG(QVariant, version));

src/updater/UpdaterController.cpp

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ UpdaterController::UpdaterController(QObject* parent)
9999

100100
if (!networkError.isEmpty()) {
101101
if (wasSilent) {
102+
setState(State::Idle);
102103
UpdaterTelemetry::breadcrumb(
103104
QStringLiteral("updater.background.error"),
104105
QStringLiteral("network_error"),
@@ -120,6 +121,7 @@ UpdaterController::UpdaterController(QObject* parent)
120121

121122
if (!result.parseOk) {
122123
if (wasSilent) {
124+
setState(State::Idle);
123125
UpdaterTelemetry::breadcrumb(
124126
QStringLiteral("updater.background.error"),
125127
QStringLiteral("parse_error"),
@@ -140,11 +142,13 @@ UpdaterController::UpdaterController(QObject* parent)
140142
}
141143

142144
applyCheckResult(result);
143-
UpdaterTelemetry::breadcrumb(
144-
QStringLiteral("updater.check.success"),
145-
QStringLiteral("remote=%1 comparison=%2")
146-
.arg(result.release.tagName)
147-
.arg(static_cast<int>(result.comparison)));
145+
if (result.comparison != UpdateVersion::Comparison::Invalid) {
146+
UpdaterTelemetry::breadcrumb(
147+
QStringLiteral("updater.check.success"),
148+
QStringLiteral("remote=%1 comparison=%2")
149+
.arg(result.release.tagName)
150+
.arg(static_cast<int>(result.comparison)));
151+
}
148152
logDialogStateBreadcrumb();
149153
finishSilentCheck();
150154
});
@@ -470,6 +474,8 @@ void UpdaterController::checkForUpdates()
470474
if (!m_silentCheck) {
471475
setState(State::PackageManaged);
472476
logDialogStateBreadcrumb();
477+
} else {
478+
finishSilentCheck();
473479
}
474480
return;
475481
}
@@ -478,11 +484,16 @@ void UpdaterController::checkForUpdates()
478484
if (!m_silentCheck) {
479485
setState(State::UnknownInstall);
480486
logDialogStateBreadcrumb();
487+
} else {
488+
finishSilentCheck();
481489
}
482490
return;
483491
}
484492

485493
if (m_state == State::Checking) {
494+
if (m_silentCheck) {
495+
finishSilentCheck();
496+
}
486497
return;
487498
}
488499

src/updater/UpdaterTelemetry.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace UpdaterTelemetry {
77

88
void breadcrumb(const QString& category, const QString& message, const QString& level)
99
{
10-
if (!SentryReporter::isEnabled()) {
10+
if (!SentryReporter::isEnabled() || !isAllowedTelemetryMessage(message)) {
1111
return;
1212
}
1313
SentryReporter::addBreadcrumb(category, message, level);

src/updater/UpdaterTelemetry_test.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,13 @@ TEST(UpdaterTelemetryTest, BreadcrumbHonorsTelemetryOptOut)
3333
QStringLiteral("channel=stable local=3.5.3"));
3434
SentryReporter::setEnabled(previous);
3535
}
36+
37+
TEST(UpdaterTelemetryTest, BreadcrumbDropsDisallowedPayloads)
38+
{
39+
const bool previous = SentryReporter::isEnabled();
40+
SentryReporter::setEnabled(true);
41+
// Must not crash; disallowed payloads are silently dropped.
42+
UpdaterTelemetry::breadcrumb(QStringLiteral("updater.download.complete"),
43+
QStringLiteral("file=/tmp/foo.zip"));
44+
SentryReporter::setEnabled(previous);
45+
}

0 commit comments

Comments
 (0)