Skip to content

PANA-8612: Add snapshot capture orchestration - #3722

Draft
jonathanmos wants to merge 1 commit into
feature/sr-new-pipelinefrom
jmoskovich/02-sr-new-pipeline
Draft

PANA-8612: Add snapshot capture orchestration#3722
jonathanmos wants to merge 1 commit into
feature/sr-new-pipelinefrom
jmoskovich/02-sr-new-pipeline

Conversation

@jonathanmos

@jonathanmos jonathanmos commented Aug 18, 2026

Copy link
Copy Markdown
Member

What does this PR do?

Second pr for the new pipeline.

Adds the orchestration layer for the composition capture pipeline: SnapshotCaptureOrchestrator serializes snapshot "generations" end-to-end (traversal, async processing, expiry, handoff), coalescing overlapping capture requests into one follow-up and tracking a CaptureChangeset describing what changed (accepted for now, not yet consumed by traversal). Wires this and its supporting pieces (generation/time-budget primitives, Android scheduling and lifecycle glue, the completion queue) into DefaultRecorderProvider.

Also fixes a gap in that wiring: DefaultRecorderProvider computed the heatmap identifier registry unconditionally but only forwarded it to the legacy recorder, so enabling setHeatmapsEnabled(true) together with setCompositionTreeRecordingEnabled(true) silently dropped heatmap data with no signal to the caller. It now logs a WARN/Target.USER message for that combination, and setCompositionTreeRecordingEnabled's KDoc documents the incompatibility.

Motivation

Continues the new composition-tree capture pipeline (stacked on PANA-8500). The recorder and processing pieces already existed; this PR adds the piece that actually drives a capture end-to-end — deciding when a generation starts, enforcing its time budget, serializing overlapping requests, and handing the result off — while keeping platform callback wiring and the real view-traversal producer out of scope for later workstreams (CompositionCapturePipeline's producer is still a test seam here). Because there is no traversal implementation yet, compositionTreeRecordingEnabled stays disabled by default and reachable only through the existing @ExperimentalSessionReplayApi; the heatmap warning exists so that gap doesn't surface as a silent feature regression in the meantime.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)

@datadog-official

datadog-official Bot commented Aug 18, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🔄 Datadog retried 1 test - 1 passed on retry View in Datadog

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 72.82% (+0.00%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 50400d0 | Docs | View more details | Give us feedback!

@codecov-commenter

codecov-commenter commented Aug 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 77.80127% with 105 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.35%. Comparing base (2ebd855) to head (50400d0).
⚠️ Report is 1 commits behind head on feature/sr-new-pipeline.

Files with missing lines Patch % Lines
...nternal/composition/SnapshotCaptureOrchestrator.kt 80.74% 10 Missing and 16 partials ⚠️
...ay/internal/composition/SnapshotCompletionQueue.kt 63.08% 13 Missing and 11 partials ⚠️
...lay/internal/composition/CompositionDrawSignals.kt 64.58% 12 Missing and 5 partials ⚠️
...ay/internal/composition/AndroidCaptureExecution.kt 70.00% 4 Missing and 5 partials ⚠️
.../sessionreplay/internal/DefaultRecorderProvider.kt 84.91% 6 Missing and 2 partials ⚠️
...y/internal/composition/CaptureGenerationContext.kt 87.27% 3 Missing and 4 partials ⚠️
...ionreplay/internal/composition/CaptureWorkToken.kt 75.00% 3 Missing and 2 partials ⚠️
...nal/composition/AndroidSnapshotCaptureLifecycle.kt 82.61% 3 Missing and 1 partial ⚠️
...onreplay/internal/composition/CaptureTimeBudget.kt 75.00% 1 Missing and 1 partial ⚠️
...nreplay/internal/composition/SnapshotProcessing.kt 86.67% 2 Missing ⚠️
... and 1 more
Additional details and impacted files
@@                     Coverage Diff                     @@
##           feature/sr-new-pipeline    #3722      +/-   ##
===========================================================
+ Coverage                    73.30%   73.35%   +0.04%     
===========================================================
  Files                         1009     1021      +12     
  Lines                        37438    37902     +464     
  Branches                      6515     6599      +84     
===========================================================
+ Hits                         27443    27800     +357     
- Misses                        8116     8183      +67     
- Partials                      1879     1919      +40     
Files with missing lines Coverage Δ
...ndroid/sessionreplay/SessionReplayConfiguration.kt 97.89% <ø> (-0.02%) ⬇️
...lay/internal/composition/CancellableCaptureWork.kt 100.00% <100.00%> (ø)
...nternal/composition/CaptureSkippedFrameNotifier.kt 100.00% <100.00%> (ø)
...sessionreplay/internal/composition/CapturedTree.kt 90.24% <100.00%> (+0.24%) ⬆️
...internal/composition/CompositionCapturePipeline.kt 100.00% <100.00%> (+54.55%) ⬆️
...onreplay/internal/composition/CaptureScheduling.kt 0.00% <0.00%> (ø)
...onreplay/internal/composition/CaptureTimeBudget.kt 75.00% <75.00%> (ø)
...nreplay/internal/composition/SnapshotProcessing.kt 86.67% <86.67%> (ø)
...nal/composition/AndroidSnapshotCaptureLifecycle.kt 82.61% <82.61%> (ø)
...ionreplay/internal/composition/CaptureWorkToken.kt 75.00% <75.00%> (ø)
... and 6 more

... and 34 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jonathanmos
jonathanmos force-pushed the jmoskovich/02-sr-new-pipeline branch from 001809f to 1ca510f Compare August 18, 2026 10:38
Base automatically changed from jmoskovich/01-sr-new-pipeline to feature/sr-new-pipeline August 18, 2026 12:16
@jonathanmos
jonathanmos force-pushed the jmoskovich/02-sr-new-pipeline branch 2 times, most recently from 99626d9 to 1dd5cfc Compare August 19, 2026 09:40
@jonathanmos

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1dd5cfca85

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jonathanmos
jonathanmos force-pushed the jmoskovich/02-sr-new-pipeline branch from 1dd5cfc to 50400d0 Compare August 19, 2026 10:38
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.

2 participants