Skip to content

Publish App analytics for 6.4 (BL-16716) - #8260

Open
JohnThomson wants to merge 1 commit into
Version6.4from
BL-16716-publish-app-analytics-6.4
Open

Publish App analytics for 6.4 (BL-16716)#8260
JohnThomson wants to merge 1 commit into
Version6.4from
BL-16716-publish-app-analytics-6.4

Conversation

@JohnThomson

@JohnThomson JohnThomson commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Problem

Bloom 6.4 ships the App Builder, and reports nothing about it. Whether a real Reading App
Builder build actually succeeds for a user, how long it takes, and how it fails are things we
have no way to see: CI never runs a real App Builder build, so field telemetry is this path's
only possible continuous coverage — and 6.4 has none. #8228 wrote exactly that telemetry, but
only on the 6.5 branch, and the App Builder is one of the features that also ships in 6.4.

Fix

Backport the one event that covers this feature, and nothing else.

  • Publish App, reported when a build or an install finishes, carrying stage, result,
    elapsedSeconds, errorKind on a failure, bookCount, and apkSizeMB when there is an APK.
    Identical to 6.5's event, so data from the two versions is directly comparable. Prepare is fast
    and local and, as in 6.5, deliberately is not reported.
  • Nothing else from Analytics for the features new in 6.5 (BL-16716) #8228. The other six events cover features 6.4 does not have, and none of
    the plumbing comes with this: no analytics/track endpoint, no trackEvent() front-end
    helper, no BloomAnalytics wrapper and no commit-time check for it. The event is entirely
    C#-side, so the whole change is one file.
  • Reporting an event cannot disturb the thing it reports on. The event is sent after the
    build's own outcome has been settled and shown to the user, and the whole of it — gathering the
    properties, sending, and logging — cannot throw. That matters more here than it looks: this
    code runs between "the build finished" and "tell the front end the build finished", so an
    escaping exception would leave a successful build looking to the user like a hung one. Both
    halves of that came from review (see the resolved threads).

Two differences from 6.5 are forced by 6.4's code rather than chosen: this branch calls
DesktopAnalytics.Analytics.Track directly, as all ~30 of its existing call sites do (with a
log line kept alongside so the event can be verified on a dev machine, where tracking is off);
and there is no "cancelled" result, because 6.4's build and install cannot be cancelled.

This commit wants a null merge (-s ours) into master and 6.5, which already carry the real
implementation.

Ref: https://issues.bloomlibrary.org/youtrack/issue/BL-16716

Devin review


This change is Reviewable

@greptile-apps

greptile-apps Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR backports App Builder completion analytics from 6.5 to 6.4.

  • Reports build and install outcomes with stage, result, elapsed time, error type, book count, and available APK size.
  • Isolates property collection, analytics transmission, and logging so telemetry failures cannot prevent the API request from completing.
  • Leaves the fast, local prepare stage unreported.

Important Files Changed

Filename Overview
src/BloomExe/Publish/Rab/RabPublishApi.cs Adds non-throwing post-operation analytics for App Builder build and install actions; no eligible new follow-up issue remains.

Reviews (2): Last reviewed commit: "Publish App analytics for 6.4 (BL-16716)" | Re-trigger Greptile

Comment thread src/BloomExe/Publish/Rab/RabPublishApi.cs
Comment thread src/BloomExe/Publish/Rab/RabPublishApi.cs
Comment thread src/BloomExe/Publish/Rab/RabPublishApi.cs
@JohnThomson

Copy link
Copy Markdown
Contributor Author

[Claude Opus 5 (1M context) from John Thomson's machine during preflight]

Consulted Devin on 2026-08-31 16:12 UTC up to commit e6ede7f.

Three reviews ran across the branch, one per commit. Devin raised two Bugs, no Investigate flags and no Informational items:

Both threads are replied-to and resolved. Note for anyone opening Devin's review page: it still lists both bugs against e6ede7f, with the pre-fix descriptions and the pre-fix line numbers. Both were checked line by line against the current code and are false positives on this commit; the reasoning is on each thread.

Greptile also reviewed and raised one P1 (a failed build can report a stale APK's size) — that one is a data-semantics question, so it is going to the developer rather than being fixed here. Its thread is deliberately left open.

@JohnThomson

Copy link
Copy Markdown
Contributor Author

[Claude Opus 5 (1M context) from John Thomson's machine during preflight]

Consulted Devin on 2026-08-31 17:42 UTC up to commit 07655cd (the comment-only commit recording the apkSizeMB decision). No new findings: same two Bugs, no Investigate flags, no Informational items.

Both are the already-fixed pair, still re-listed with their pre-fix descriptions and pre-fix line numbers — one now pointing at a comment line. Verified again against the current code; the reasoning is on each thread. Every review thread on this PR is now resolved, Greptile's included.

@JohnThomson JohnThomson left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@JohnThomson+AGNT resolved 2 discussions.
Reviewable status: 0 of 1 files reviewed, all discussions resolved.

Bloom 6.4 ships the App Builder and reports nothing about it. Whether a real
Reading App Builder build succeeds for a user, how long it takes, and how it
fails are things we have no way to see: CI never runs a real App Builder build,
so field telemetry is the only continuous coverage this path can ever have, and
6.4 has none. PR #8228 wrote that telemetry, but only on 6.5, and the App
Builder is one of the features that also ships in 6.4.

This backports the one event that covers the feature, and nothing else.

"Publish App" is reported when a build or an install finishes, carrying stage,
result, elapsedSeconds, errorKind on a failure, bookCount, and apkSizeMB when
there is an APK. It is identical to 6.5's event, so data from the two versions
is directly comparable. Prepare is fast and local and, as in 6.5, deliberately
is not reported.

None of the rest of #8228 comes with it: the other six events cover features
6.4 does not have, and there is no analytics/track endpoint, no front-end
trackEvent() helper, no BloomAnalytics wrapper and no commit-time check for it.
The event is entirely C#-side, so the whole change is one file.

Reporting an event cannot disturb the thing it reports on. The event is sent
only after the operation's own outcome has been settled and shown to the user,
and the whole of it -- gathering the properties, sending, and logging -- cannot
throw. That matters here more than it usually would: this code runs between
"the build finished" and "tell the front end the build finished", so an
exception escaping it would skip PostSucceeded and leave a build that actually
succeeded looking to the user like a hung one. Hence LogAnalyticsWithoutThrowing,
whose bare inner catch is deliberate: standard error is the last channel
available, and with nowhere left to report to, returning is the only correct
move.

Two differences from 6.5 are forced by 6.4's code rather than chosen. This
branch calls DesktopAnalytics.Analytics.Track directly, as all of its existing
call sites do, with a Logger.WriteEvent line alongside so the event can be
confirmed on a machine where tracking is off -- on 6.5 the BloomAnalytics
wrapper does that for every event; here there is no wrapper. And there is no
"cancelled" result, because 6.4's build and install cannot be cancelled.

One known and deliberate wrinkle, also recorded in the code: on a failed build
apkSizeMB is whatever APK an earlier successful build left behind, so a failed
event can carry a size it did not produce. Left alone because the event says
the build failed, which makes the size self-evidently meaningless, and any
aggregate question about app sizes has to filter to successful builds anyway.
6.5 behaves identically.

This commit wants a null merge (-s ours) into master and 6.5, which already
carry the real implementation.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@JohnThomson
JohnThomson force-pushed the BL-16716-publish-app-analytics-6.4 branch from 07655cd to 7e74177 Compare August 31, 2026 18:11
@JohnThomson
JohnThomson marked this pull request as ready for review August 31, 2026 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant