Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented May 24, 2025

  • Identify the issue in RelationalOptionsExtension copy constructor where _migrationsAssemblyObject is not being copied
  • Create a test to verify the issue and add it to RelationalOptionsExtensionTest class
  • Create a separate test program to verify the issue reproduction and the fix
  • Implement the fix by adding the missing assignment in the copy constructor: _migrationsAssemblyObject = copyFrom._migrationsAssemblyObject;
  • Verify that the fix works with both test approaches

This PR fixes an issue where the _migrationsAssemblyObject field was not being copied in the RelationalOptionsExtension copy constructor. This caused the migrations assembly object to be lost if any other configuration method was called after MigrationsAssembly(Assembly), requiring users to call this method last in their configuration chain.

Fixes #36053.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…Extension copy constructor

Co-authored-by: AndriySvyryd <[email protected]>
@AndriySvyryd AndriySvyryd marked this pull request as ready for review May 24, 2025 02:43
@AndriySvyryd AndriySvyryd requested a review from a team as a code owner May 24, 2025 02:43
@AndriySvyryd AndriySvyryd requested a review from Copilot May 24, 2025 02:43
Copy link

@Copilot 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 addresses an issue in the RelationalOptionsExtension copy constructor where the _migrationsAssemblyObject field was not being copied and verifies the fix with an added test.

  • Added a test to ensure that the migrations assembly object is preserved after cloning.
  • Fixed the copy constructor in RelationalOptionsExtension to correctly assign _migrationsAssemblyObject.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
test/EFCore.Relational.Tests/Infrastructure/RelationalOptionsExtensionTest.cs Added test verifying migrations assembly object preservation after cloning.
src/EFCore.Relational/Infrastructure/RelationalOptionsExtension.cs Fixed missing assignment of _migrationsAssemblyObject in the copy constructor.

Copilot finished work on behalf of AndriySvyryd May 24, 2025 02:56
@AndriySvyryd AndriySvyryd changed the title [WIP] _migrationsAssemblyObject is missing from RelationalOptionsExtension copy constructor _migrationsAssemblyObject is missing from RelationalOptionsExtension copy constructor May 27, 2025
@AndriySvyryd AndriySvyryd merged commit 3e12e53 into main May 27, 2025
8 checks passed
@AndriySvyryd AndriySvyryd deleted the copilot/fix-36053 branch May 27, 2025 23:56
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.

_migrationsAssemblyObject is missing from RelationalOptionsExtension copy constructor
3 participants