Skip to content

test(snapshots): add path for snapshots predating .recentBatchInfo blob#27380

Open
dannimad wants to merge 1 commit into
microsoft:mainfrom
dannimad:danielcar/snapshot-validation-only
Open

test(snapshots): add path for snapshots predating .recentBatchInfo blob#27380
dannimad wants to merge 1 commit into
microsoft:mainfrom
dannimad:danielcar/snapshot-validation-only

Conversation

@dannimad
Copy link
Copy Markdown
Contributor

Extracts the snapshot-validation infrastructure from the reverted PR #27262 so that re-enabling batch ID tracking later can ship as a focused diff (runtime config flip + content submodule bump) without carrying replay-tool refactors.

  • replay-tool: export normalizePackageVersions (refactored out of compareWithReferenceSnapshot; behavior unchanged).
  • validateSnapshots: when the source snapshot predates the .recentBatchInfo blob, strip the blob from both produced and reference before strict-equal comparison so test fixtures generated before batch ID tracking was enabled still validate against current references.

…BatchInfo blob

Extracts the snapshot-validation infrastructure from the reverted PR microsoft#27262 so
that re-enabling batch ID tracking later can ship as a focused diff (runtime
config flip + content submodule bump) without carrying replay-tool refactors.

- replay-tool: export normalizePackageVersions (refactored out of
  compareWithReferenceSnapshot; behavior unchanged).
- validateSnapshots: when the source snapshot predates the .recentBatchInfo
  blob, strip the blob from both produced and reference before strict-equal
  comparison so test fixtures generated before batch ID tracking was enabled
  still validate against current references.

No runtime behavior change; no public API surface change.
Copilot AI review requested due to automatic review settings May 21, 2026 20:11
@github-actions
Copy link
Copy Markdown
Contributor

Hi! Thank you for opening this PR. Want me to review it?

Based on the diff (172 lines, 3 files), I've queued these reviewers:

  • Correctness — logic errors, race conditions, lifecycle issues
  • Security — vulnerabilities, secret exposure, injection
  • API Compatibility — breaking changes, release tags, type design
  • Performance — algorithmic regressions, memory leaks
  • Testing — coverage gaps, hollow tests

How this works

  • Adjust the reviewer set by ticking/unticking boxes above. Reviewer toggles alone don't trigger anything.

  • Tick Start review below to dispatch the review fleet.

  • After review finishes, tick Start review again to request another run — it auto-resets after each dispatch.

  • This comment updates as new commits land; your reviewer selections are preserved.

  • Start review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR extracts snapshot-normalization logic from a reverted change set and updates snapshot validation to handle older fixtures that predate the introduction of the .recentBatchInfo summary blob, so back-compat snapshot tests can continue to validate against current references.

Changes:

  • @fluid-internal/replay-tool: factor out and export normalizePackageVersions() and reuse it from compareWithReferenceSnapshot().
  • Snapshot validation: when the source snapshot lacks .recentBatchInfo, strip that blob from both produced and reference snapshots before strict comparison.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
packages/tools/replay-tool/src/index.ts Re-exports normalizePackageVersions from the helpers module for external use by snapshot tests.
packages/tools/replay-tool/src/helpers.ts Extracts packageVersion normalization into normalizePackageVersions() and uses it in snapshot comparisons.
packages/test/snapshots/src/validateSnapshots.ts Adds logic to detect older snapshots and compare snapshots while ignoring .recentBatchInfo in that back-compat case.

Comment on lines +6 to 8
/* eslint-disable @typescript-eslint/no-unsafe-call */
import { strict } from "assert";
import fs from "fs";
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