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

[framework] deprecated MultidomainMigrationTrait.php #2270

Closed
wants to merge 2 commits into from

Conversation

s3tezsky
Copy link
Contributor

@s3tezsky s3tezsky commented Mar 15, 2021

Q A
Description, reason for the PR Multi-domain migrations are using MultidomainMigrationTrait which is providing informations about domains from database. This approach may lead to errors when you need to create a new domain for already running project. MultidomainMigrationTrait was deprecated and replaced by new methods introduced in new AbstractMigration class which provides domain configuration parsed from domains.yaml
New feature No
BC breaks No
Fixes issues ...
Have you read and signed our License Agreement for contributions? Yes

@s3tezsky s3tezsky force-pushed the ds-reliable-db-migrations branch 2 times, most recently from d0a4966 to 3c99cc6 Compare March 15, 2021 11:31
@s3tezsky s3tezsky changed the title deprecated MultidomainMigrationTrait.php [shopsys] deprecated MultidomainMigrationTrait.php Mar 15, 2021
@s3tezsky s3tezsky changed the title [shopsys] deprecated MultidomainMigrationTrait.php [framework] deprecated MultidomainMigrationTrait.php Mar 15, 2021
@s3tezsky s3tezsky force-pushed the ds-reliable-db-migrations branch 3 times, most recently from eafe5ab to db02809 Compare March 15, 2021 12:20
@sonarcloud
Copy link

sonarcloud bot commented Mar 15, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@s3tezsky s3tezsky marked this pull request as ready for review March 15, 2021 12:53
@s3tezsky s3tezsky added this to the SSFW 9.1.1 milestone Mar 16, 2021
/**
* @return array
*/
protected function getParsedDomainConfigs(): array
Copy link
Member

Choose a reason for hiding this comment

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

When you have container loaded here - would not be better to use Domain class instead of parsing yaml files?

/**
* @return array
*/
protected function getCreatedDomainIds(): array
Copy link
Member

Choose a reason for hiding this comment

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

I would name it something like getDomainIdsFromSettingValues to be more describing.

@@ -0,0 +1,72 @@
<?php
Copy link
Member

Choose a reason for hiding this comment

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

I would update commit message to something like:
replaced MultidomainMigrationTrait trait by AbstractMigration class

Copy link
Member

Choose a reason for hiding this comment

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

Also those two commits should be probably squashed as now the first commit violates YAGNI and use is added in second one.

/**
* @return array
*/
protected function getAllDomainIds(): array
Copy link
Member

Choose a reason for hiding this comment

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

This method violates YAGNI now - it is not used. I thought it will be only method for retrieving domain ids here.

@s3tezsky
Copy link
Contributor Author

Thanks @TomasLudvik for a review but I am closing this PR after discussion we had.

As we aggred this change will not introduce such a good change so we rather describe current behavior better.

Created #2276 and closing this one.

@s3tezsky s3tezsky closed this Mar 16, 2021
@s3tezsky s3tezsky deleted the ds-reliable-db-migrations branch March 16, 2021 13:26
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