Skip to content

Live data and RFC support#39

Merged
yusufozturk merged 1 commit into
mainfrom
dev-live-data-and-rfc
Jun 30, 2026
Merged

Live data and RFC support#39
yusufozturk merged 1 commit into
mainfrom
dev-live-data-and-rfc

Conversation

@yusufozturk

@yusufozturk yusufozturk commented Jun 30, 2026

Copy link
Copy Markdown
Member

Several updates for VirtualMetric Fleet

Summary by CodeRabbit

  • New Features

    • Added support for configuring live capture validation with minimum frame-size checks and an optional live source ID.
    • Live data and console log runs can now target a specific source and verify that meaningful payloads were captured.
  • Bug Fixes

    • Improved validation so scenarios no longer pass when only lifecycle marker frames are observed.
    • Added clearer failure handling when no real data frames meet the configured minimum size.

@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

Adds two new FleetConfig fields (LiveMinFrameBytes, LiveSourceID) for fleet automation's live_data/console_log scenarios. Runner logic tracks max frame length from simulator status, adds a polling helper to wait for real data frames, includes source_id in capture commands, and fails scenarios that only produce marker-sized frames.

Changes

Live Frame Validation

Layer / File(s) Summary
Config fields for capture validation
internal/config/case.go
Adds LiveMinFrameBytes and LiveSourceID fields with YAML tags to FleetConfig for live_data/console_log scenarios.
Simulator status max_len tracking
internal/runner/runner.go
Adds a MaxLen field to decoded inbound status and a fleetStatus.maxLen(id, key) helper accessor.
Wait-for-real-data and driver integration
internal/runner/runner.go
Adds fleetWaitMaxLen polling helper, includes source_id in capture command parameters, and adds a guard that fails the scenario when only marker-sized frames are observed instead of real data.

Sequence Diagram(s)

sequenceDiagram
  participant Driver
  participant SimContainer
  participant fleetWaitMaxLen
  participant fleetStatus

  Driver->>SimContainer: start live_data/console_log (source_id)
  SimContainer-->>Driver: req.<cmd>_reply (first frame)
  alt LiveMinFrameBytes > 0
    Driver->>fleetWaitMaxLen: wait for max_len >= live_min_frame_bytes
    loop until deadline or threshold met
      fleetWaitMaxLen->>fleetStatus: fleetSimStatus poll
      fleetStatus-->>fleetWaitMaxLen: inbound[key].max_len
    end
    fleetWaitMaxLen-->>Driver: maxLen, reached
    alt threshold not reached
      Driver->>Driver: fail scenario (lifecycle markers only)
    end
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • VirtualMetric/PipeBench#29: Both PRs modify FleetConfig in internal/config/case.go and extend the fleet-automation correctness logic for live_data/console_log scenarios in internal/runner/runner.go.

Poem

A frame too small, a marker's ghost,
"Not real data!" I cried the most.
Now I wait with twitching ear,
till max_len grows and signal's clear.
🐇📡 hop, poll, validate — cheer!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the live data changes, though the RFC part is not reflected in the summarized diff.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev-live-data-and-rfc

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai 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.

🧹 Nitpick comments (1)
internal/runner/runner.go (1)

3664-3676: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Optional: extract shared polling loop.

fleetWaitMaxLen duplicates the poll/sleep/deadline structure of the pre-existing fleetWaitCount almost verbatim, differing only in which fleetStatus accessor is called. Could be consolidated into a generic fleetPollUntil(simContainer, dirID, deadline, extract func(*fleetStatus) int, min int) helper to avoid drift between the two if polling behavior (e.g. sleep interval) ever needs to change.

Also applies to: 3678-3696

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/runner/runner.go` around lines 3664 - 3676, Extract the duplicated
poll/sleep/deadline logic shared by fleetWaitCount and fleetWaitMaxLen into a
single helper, since both functions only differ by the fleetStatus accessor they
call. Create a generic polling helper in this area that accepts the
status-extraction function and threshold, then have fleetWaitCount and
fleetWaitMaxLen delegate to it so the sleep interval and deadline behavior stay
consistent in one place.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@internal/runner/runner.go`:
- Around line 3664-3676: Extract the duplicated poll/sleep/deadline logic shared
by fleetWaitCount and fleetWaitMaxLen into a single helper, since both functions
only differ by the fleetStatus accessor they call. Create a generic polling
helper in this area that accepts the status-extraction function and threshold,
then have fleetWaitCount and fleetWaitMaxLen delegate to it so the sleep
interval and deadline behavior stay consistent in one place.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b10145fb-4641-4bda-9f11-0b855ab41dc5

📥 Commits

Reviewing files that changed from the base of the PR and between 922ab63 and 4e6fc1d.

📒 Files selected for processing (2)
  • internal/config/case.go
  • internal/runner/runner.go

@yusufozturk yusufozturk merged commit 36871e2 into main Jun 30, 2026
5 checks passed
@yusufozturk yusufozturk deleted the dev-live-data-and-rfc branch June 30, 2026 22:00
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