Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AC-1682] Flexible collections: EF data migrations integration tests #3937

Closed
wants to merge 119 commits into from

Conversation

r-tome
Copy link
Contributor

@r-tome r-tome commented Mar 28, 2024

Type of change

- [ ] Bug fix
- [X] New feature development
- [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc)
- [ ] Build/deploy pipeline (DevOps)
- [ ] Other

Objective

Enable the existing integration tests written for SQL to also validate the EF migrations that will run for Self-host instances.

Code changes

  • src/Core/AdminConsole/Repositories/IOrganizationRepository.cs: Added a summary for the EnableCollectionEnhancements method.
  • src/Infrastructure.EntityFramework/AdminConsole/Repositories/Executions/*: Moved the scripts to the Infrastructure.EntityFramework project
  • src/Infrastructure.EntityFramework/AdminConsole/Repositories/Executions/OrganizationEnableCollectionEnhancementsExecution.cs: Added a helper class to run the relevant script for the executing database provider
  • src/Infrastructure.EntityFramework/AdminConsole/Repositories/OrganizationRepository.cs: Implemented the method for EF
  • test/Infrastructure.IntegrationTest/AdminConsole/Repositories/OrganizationEnableCollectionEnhancementTests.cs: Updated the integration tests to run for EF

Before you submit

  • Please check for formatting errors (dotnet format --verify-no-changes) (required)
  • If making database changes - make sure you also update Entity Framework queries and/or migrations
  • Please add unit tests where it makes sense to do so (encouraged but not required)
  • If this change requires a documentation update - notify the documentation team
  • If this change has particular deployment requirements - notify the DevOps team

r-tome and others added 30 commits November 10, 2023 15:28
… = 1 for all users with Manager role or 'EditAssignedCollections' permission
…EditAssignedCollections permission assigned to groups with collection access
…e organization data for flexible collections
…ncements for organizations that have not yet migrated
r-tome and others added 26 commits April 10, 2024 19:24
(cherry picked from commit 00eea06)
(cherry picked from commit 26f5bf8)
…already wraps it under its own transaction

(cherry picked from commit 7b54d78)
… migrated in previous steps

(cherry picked from commit 28bba94)
(cherry picked from commit deee483)
(cherry picked from commit c3ca9ec)
(cherry picked from commit fada0a8)
…mework project and added an interface (IExecution) to run them against the database
…ations and checked for incorrect associations between organization users and collections
…itwarden/server into ac/ac-1682/ef-migrations-tests

# Conflicts:
#	src/Api/Billing/Controllers/ProviderBillingController.cs
#	src/Api/Billing/Models/Responses/ProviderSubscriptionResponse.cs
#	src/Billing/Controllers/StripeController.cs
#	src/Core/Billing/Commands/IAssignSeatsToClientOrganizationCommand.cs
#	src/Core/Billing/Extensions/BillingExtensions.cs
#	src/Core/Billing/Extensions/ServiceCollectionExtensions.cs
#	src/Core/Billing/Models/ConfiguredProviderPlanDTO.cs
#	src/Core/Billing/Queries/IProviderBillingQueries.cs
#	src/Core/Billing/Queries/ISubscriberQueries.cs
#	src/Core/Billing/Queries/Implementations/ProviderBillingQueries.cs
#	src/Core/Billing/Queries/Implementations/SubscriberQueries.cs
#	src/Core/Constants.cs
#	src/Core/Core.csproj
#	src/Core/Models/Business/SubscriptionUpdate.cs
#	src/Core/Services/Implementations/StripePaymentService.cs
#	src/Infrastructure.EntityFramework/AdminConsole/Repositories/Executions/Sqlite/OrganizationEnableCollectionEnhancements.sql
#	test/Api.IntegrationTest/SecretsManager/Controllers/SecretsControllerTests.cs
#	test/Api.Test/Billing/Controllers/ProviderBillingControllerTests.cs
#	test/Core.Test/Billing/Queries/ProviderBillingQueriesTests.cs
#	test/Core.Test/Billing/Queries/SubscriberQueriesTests.cs
@r-tome r-tome changed the base branch from ac/ac-1682/ef-migrations to ac-1682 April 26, 2024 09:28
Base automatically changed from ac-1682 to main April 26, 2024 13:11
@r-tome r-tome closed this Apr 30, 2024
@r-tome r-tome deleted the ac/ac-1682/ef-migrations-tests branch April 30, 2024 17:22
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.

None yet

2 participants