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

Executable tests on Sylius-Standard & remove duplicated configs #5058

Conversation

pamil
Copy link
Contributor

@pamil pamil commented May 18, 2016

Q A
Bug fix? no
New feature? no
BC breaks? yes
Related tickets -
License MIT

@pjedrzejewski pjedrzejewski added the DX Issues and PRs aimed at improving Developer eXperience. label May 18, 2016
@pjedrzejewski
Copy link
Member

General note, I have not reviewed it in full yet: We need to have same structure as Symfony Standard whenever possible, even if this means duplication of some configs. I don't want to write a whole chapter in docs about why configs are splitted and included separately and answering questions: "where is configuration X, in Symfony it is right there!". I'd rather still live with a small duplication.

@pamil
Copy link
Contributor Author

pamil commented May 18, 2016

@pjedrzejewski I agree, but there are over 1500 lines of configuration compared to 100 lines of Symfony Standard, so we must think through what we can duplicate and what rather not.

@pjedrzejewski
Copy link
Member

The Sylius defaults should not be duplicated of course and I believe they could stay in the Sylius[Shop/Admin/Core accordingly]Bundle, just like they are right now. In main config files I would leave the basic Symfony/Doctrine settings you find in all Symfony apps and anything that's cannot be overriden (fos_rest paths IIRC are an example)

@pamil pamil force-pushed the qa-dx/seek-and-destroy-duplicated-applications branch 5 times, most recently from a6b385d to 9838545 Compare May 20, 2016 09:03
- { resource: @SyliusCoreBundle/Resources/config/app/main.yml }
- { resource: @SyliusAdminBundle/Resources/config/app/main.yml }
- { resource: "security.yml" }

Copy link
Contributor

Choose a reason for hiding this comment

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

parameters.yml shouldn't be there also?

@pamil pamil force-pushed the qa-dx/seek-and-destroy-duplicated-applications branch from 9838545 to ebd931f Compare May 20, 2016 10:21
strict_variables: "%kernel.debug%"
exception_controller: "FOS\\RestBundle\\Controller\\ExceptionController::showAction"

winzou_state_machine:
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO this should be extracted to a separate file.

@pjedrzejewski
Copy link
Member

  • I think we should separate app configurations from services/parameters. Not sure if current config/app directory is a good idea, but having one big config.yml next to services.xml, form.xml, etc. can be confusing.
  • State machines should definitely be in separate files.
  • Why removing base Kernel class?

form:
default: Sylius\Bundle\CoreBundle\Form\Type\ProductVariantType
model: Sylius\Component\Product\Model\ProductAssociation
interface: Sylius\Component\Product\Model\ProductAssociationInterface
Copy link
Contributor

@michalmarcinkowski michalmarcinkowski May 20, 2016

Choose a reason for hiding this comment

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

Not a concern of this PR, but this shouldn't live in ProductBundle?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This way we would couple ProductBundle with AssociationBundle.

Copy link
Contributor

@michalmarcinkowski michalmarcinkowski May 23, 2016

Choose a reason for hiding this comment

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

Sylius\Component\Product\Model\ProductAssociation - it is already coupled with component :)

Copy link
Contributor

Choose a reason for hiding this comment

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

And probably with the bundle (composer.json).

@pamil pamil force-pushed the qa-dx/seek-and-destroy-duplicated-applications branch 4 times, most recently from 4ec82ac to 4127d04 Compare May 23, 2016 14:05
@pamil pamil changed the title [WIP] Executable tests on Sylius-Standard & remove duplicated configs Executable tests on Sylius-Standard & remove duplicated configs May 23, 2016
@pamil
Copy link
Contributor Author

pamil commented May 23, 2016

@pjedrzejewski:

  • Moved back these files to bundles' config/app/*
  • Extracted state machine configuration to bundles' config/app/state_machine.yml
  • The kernel class from CoreBundle was moved to /app/, because it also includes WebBundle / AdminBundle etc. and it's definitely not a property of CoreBundle

@pamil
Copy link
Contributor Author

pamil commented May 23, 2016

I think it's all for this iteration, if there aren't any more issues, it would be nice to get this PR merged so I can open the another one on Sylius-Standard.

class: TestKernel
path: app/TestKernel.php
class: TestAppKernel
path: app/TestAppKernel.php
Copy link
Member

@lchrusciel lchrusciel May 23, 2016

Choose a reason for hiding this comment

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

Shouldn't path have "?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not required in this case.

@pamil pamil force-pushed the qa-dx/seek-and-destroy-duplicated-applications branch 5 times, most recently from 21b5676 to 6989fc1 Compare May 24, 2016 00:03
@@ -17,7 +8,7 @@
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20160516131553 extends AbstractMigration
class Version20160523143611 extends AbstractMigration
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this migration was not removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's the first one made after v0.18 was tagged

# This file is part of the Sylius package.
# (c) Paweł Jędrzejewski

jms_serializer:
Copy link
Member

Choose a reason for hiding this comment

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

This should not be here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

@pamil pamil force-pushed the qa-dx/seek-and-destroy-duplicated-applications branch from c7c73bb to 5c1865b Compare May 27, 2016 07:55
@michalmarcinkowski michalmarcinkowski merged commit 0abd1b6 into Sylius:master May 27, 2016
@michalmarcinkowski
Copy link
Contributor

Good job! 👍

@pamil pamil deleted the qa-dx/seek-and-destroy-duplicated-applications branch May 27, 2016 10:10
pamil added a commit to pamil/Sylius that referenced this pull request May 27, 2016
pamil added a commit to pamil/Sylius that referenced this pull request May 27, 2016
pjedrzejewski pushed a commit that referenced this pull request May 28, 2016
@nakashu
Copy link
Contributor

nakashu commented Jun 6, 2016

@pamil why where all migrations removed ??? That seems a bit drastic for upgrading.

@psyray
Copy link
Contributor

psyray commented Jun 11, 2016

@pamil @pjedrzejewski
Agree with @nakashu, remove migrations is a really bad idea for those who want to upgrade from very old sylius version.
And this part was not really discussed here.
I think this part should be quickly reverted.

@pjedrzejewski
Copy link
Member

@psyray We will publish old migrations in a separate repo probably, because we need to generate new ones and figure out proper upgrade strategy that considers application + sylius migrations together.

@psyray
Copy link
Contributor

psyray commented Jun 11, 2016

OK, right, but meanwhile there is no possibility to cleanly migrate old sylius for those who wants.
Maybe you could put a dir named old with old migrations and a README textfile in migrations folder to permit user to manually copy/paste migrations in main folder ?

@peteward
Copy link

The old migrations didn't work for anyone with a DB that has content because they didn't consider any data - they just did structure. So you would get a same result by just doing a doctrine:migrations:diff and then working through your issues.

@psyray
Copy link
Contributor

psyray commented Jun 11, 2016

I'm not agree with you.
Some old migrations have logic and move data from a table to another, you can look at those with code migrations or translations (like Version20160112154949 Version20151203134947 or Version20141203091118).
Those 2 cases are BC breaks, and old sylius version need those ones to properly upgrade, you couldn't simply drop column in one table and create empty one.
More important in code migration case, due to the UNIQUE database parameter of the column, this will generate a NOT UNIQUE SQL error in any case.

Another example is channel, which insert default channel and update the whole channel tables.
Version20150202213852
Also a BC break

More recent, option_value translation
Version20160203224648
Payment_method update
Version20151015181310

I'm agree that a lot of migrations was obsolete and was just a doctrine:migrations:diff but some are not, and drop the entire migration folder was a mistake.

And finally as @pjedrzejewski said, the needs to put a proper upgrade strategy is inevitable and I think it's urgent

So I think the above migrations file should deletion should be reverted (and maybe another ones)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DX Issues and PRs aimed at improving Developer eXperience.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants