[build-tools][worker] Collect device run session activity events#3999
Draft
szdziedzic wants to merge 1 commit into
Draft
[build-tools][worker] Collect device run session activity events#3999szdziedzic wants to merge 1 commit into
szdziedzic wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3999 +/- ##
==========================================
+ Coverage 59.67% 60.14% +0.47%
==========================================
Files 941 946 +5
Lines 41319 42638 +1319
Branches 8675 9053 +378
==========================================
+ Hits 24654 25641 +987
- Misses 16571 16896 +325
- Partials 94 101 +7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
9c5895c to
c111d20
Compare
|
⏩ The changelog entry check has been skipped since the "no changelog" label is present. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Device run session tools can produce structured usage and lifecycle events, but those events currently disappear with the VM or remain buried in unstructured worker logs. The events need a durable producer-neutral path before website and CLI consumers can expose them.
This implements event collection and worker persistence while matching the existing log architecture: structured records are embedded in the same NDJSON stream periodically overwritten in GCS. A separate ingestion service can replace that transport later without changing the event envelope.
Companion PRs:
The www API must deploy before this PR; website and CLI consumers deploy afterward.
How
stream.completed; agent-device and serve-sim emitstream.snapshotbecause their current transports cannot prove that no later event will be admitted.deviceRunSessions.byIdwith bounded retry, cancellation, and the exact job binding supplied by the companion www PR.Test Plan
packages/build-tools: focused logger, collector, artifact, and remote-session suites (42 tests)packages/worker: focused logger durability and service terminalization suites (24 tests)corepack yarn typecheckinpackages/build-toolsandpackages/workercorepack yarn lintcorepack yarn fmt:checkgit diff --checkThis remains a draft until the companion www API is available in a test environment for end-to-end verification with a real remote session.