Skip to content

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Jul 28, 2025

This PR updates the Respawn package from version 5.0.1 to the latest version 6.2.1 and addresses all breaking changes introduced in version 6.x.

Changes Made

Package Update

  • Updated Respawn package reference from 5.0.1 to 6.2.1

API Migration in DatabaseFixture

The major breaking change in Respawn 6.x was the replacement of the Checkpoint class with the Respawner class and a new factory pattern:

Before (v5.x):

_checkpoint = new Checkpoint()
{
    TablesToIgnore = new Table[] { "__EFMigrationsHistory" },
    DbAdapter = DbAdapter.SqlServer
};

await _checkpoint.Reset(conn);

After (v6.x):

_respawner = await Respawner.CreateAsync(conn, new RespawnerOptions
{
    TablesToIgnore = new Table[] { "__EFMigrationsHistory" },
    DbAdapter = DbAdapter.SqlServer
});

await _respawner.ResetAsync(conn);

Implementation Details

  • Lazy Initialization: Implemented lazy initialization pattern since the new Respawner.CreateAsync() factory method requires a database connection, which isn't available during constructor execution
  • Configuration Migration: Moved from direct property assignment to RespawnerOptions configuration object
  • Method Updates: Updated Reset() to ResetAsync() calls
  • Backward Compatibility: Maintained the existing public API for consumers of this library by keeping the same constructor signature pattern

Validation

  • ✅ Project builds successfully in both Debug and Release configurations
  • ✅ All existing DatabaseFixture functionality preserved
  • ✅ Helper methods (InsertAsync, FindAsync, etc.) continue to work correctly
  • ✅ Created and ran comprehensive tests to validate the migration

The migration successfully addresses all breaking changes while maintaining backward compatibility for consumers of this utility library.

Fixes #18.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@Copilot Copilot AI changed the title [WIP] Update Respawn to Latest Version Update Respawn to Latest Version (6.2.1) with Breaking Changes Migration Jul 28, 2025
@Copilot Copilot AI requested a review from mitchelsellers July 28, 2025 06:53
Copilot finished work on behalf of mitchelsellers July 28, 2025 06:53
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.

Update Respawn to Latest Version
2 participants