We make use of Entity Framework 'Code First', generating migrations which updates our ModelSnapshot.
Consider this scenario:
- Developers A & B both start a feature from the same 'develop' branch state. Both need to generate a Migration for their respective feature.
- Both Developers submit their pull requests, each containing their Migration and updated ModelSnapshot
- Developer A's Pull Request is approved and successfully merged into 'develop'
- Developer B's Pull Request is approved and successfully merged into 'develop'
The problem is that the ModelSnapshot in 'develop' will no longer contain Developer A's changes.
(Note that Developer B's Pull Request may not be present when approving Developer A's - it may just have been created without integrating with 'develop' to pick up the updated ModelSnapshot - the result is the same)
Currently we have to manually check this prior to approving a Pull Request that contains Migrations but sometimes this is missed (we are all human after all).
Is there a mechanism in DevOps to check the state of a files 'unmodified/before' state with the state of the file in another branch, e.g. 'develop'?
How do others manage this situation - we can't be the only ones having this issue.