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

Components, II attempt #1236

Closed
wants to merge 64 commits into from
Closed

Components, II attempt #1236

wants to merge 64 commits into from

Conversation

pjedrzejewski
Copy link
Member

  • tag all bundles
  • review all bundles' composer.json
  • review all components' composer.json
  • review all bundles' CHANGELOG
  • review all components' CHANGELOG
  • rename Payments to Payment on packagist and github
  • rename Promotions to Promotion on packagist and github
  • rename Taxonomies to Taxonomy on packagist and github

@stloyd stloyd added this to the 1.0.0-BETA1 milestone Mar 19, 2014
@jjanvier
Copy link
Contributor

@pjedrzejewski need help ? What's left to do ?

@jjanvier
Copy link
Contributor

jjanvier commented Apr 1, 2014

@pjedrzejewski should we provide a way to migrate the database ?

@pjedrzejewski
Copy link
Member Author

@jjanvier I'll generate a migration and see how it works. :) Right now I'm adding UPGRADE file. @Sylius What do you think about releasing 0.9.0 tomorrow and merging this? I think we should do it tomorrow and move forward + do what is possible to help people upgrading. (it is not that hard... just boring changes)

@jjanvier
Copy link
Contributor

jjanvier commented Apr 1, 2014

@pjedrzejewski as long as you tag everything I guess you can merge. My migration was impossible. I had to drop my database, but I didn't look at what failed.

Until now, I've encountered only one bug : if you create a percentage attribute, you'll not be able to create a product. I'm looking at it. A few labels are broken also, but nothing serious. FIXED

@jjanvier
Copy link
Contributor

jjanvier commented Apr 1, 2014

Bug when I try to edit a choice attribute.

@jjanvier
Copy link
Contributor

jjanvier commented Apr 1, 2014

Bug: no validation constraint on the attribute type when you add a new attribute to the product (everything's OK when you edit an existing attribute)

@jjanvier
Copy link
Contributor

jjanvier commented Apr 1, 2014

@pjedrzejewski 1000 stargazers tomorrow \o/

@winzou
Copy link
Contributor

winzou commented Apr 2, 2014

I haven't checked anything on this branch, but if you consider it's quite OK then yes we should merge it (after 0.9 tag of course). We'll then work on master to polish everything, it will be clearer.

@jjanvier can you tell more about this migration that was impossible? This is the most annoying point...

@jjanvier
Copy link
Contributor

jjanvier commented Apr 2, 2014

@winzou I got this when I update a database schema that is up-to-date with the master branch :


  [Doctrine\DBAL\DBALException]                                                                         
  An exception occurred while executing 'ALTER TABLE sylius_product_prototype_option ADD CONSTRAINT FK  
  _1AD7AAC5A7C41D6F FOREIGN KEY (option_id) REFERENCES sylius_product_option (id)':                     

  SQLSTATE[HY000]: General error: 1005 Can't create table 'sylius_dev.#sql-a88_35' (errno: 150)    

@jjanvier
Copy link
Contributor

jjanvier commented Apr 2, 2014

@winzou That's because doctrine:schema:update generates a stupid batch. It tries to add a FK to sylius_product_prototype_option refering an attribute id than does not exist yet in the table sylius_product_option.

ALTER TABLE sylius_product_prototype_option ADD CONSTRAINT FK_1AD7AAC5A7C41D6F FOREIGN KEY (option_id) REFERENCES sylius_product_option (id);
// ...
// other updates
// ...
ALTER TABLE sylius_product_option ADD id INT AUTO_INCREMENT NOT NULL, ADD name 

@jjanvier
Copy link
Contributor

jjanvier commented Apr 2, 2014

Maybe we should consider using doctrine:migration from now on...

@pjedrzejewski
Copy link
Member Author

@jjanvier That's what I meant with migrations. :)

@jjanvier
Copy link
Contributor

jjanvier commented Apr 2, 2014

Ah.. Maybe I should delete my comment so :)

@pjedrzejewski
Copy link
Member Author

@jjanvier I added DoctrineMigrationsBundle and auto-generated migration. I'll try to modify it to preserve the data and just rename the tables.

@pjedrzejewski
Copy link
Member Author

Heads up - I want to be absolutely sure that both Sylius 0.9.0 and Sylius-Standard 0.9.0 works properly, so I'll verify this and squash some minor issues during the weekend and merge this on Sunday. Blog post on Monday. :)

@jjanvier
Copy link
Contributor

jjanvier commented Apr 4, 2014

@pjedrzejewski need help for the migration script ? I can at least test a real migration process once this script will be finished

@pjedrzejewski
Copy link
Member Author

@jjanvier If you have some time to play with it - yes, definitely!

@pjedrzejewski
Copy link
Member Author

Github is showing weird diff stats after rebase...

@jjanvier
Copy link
Contributor

jjanvier commented Apr 4, 2014

Like what ?

@pjedrzejewski
Copy link
Member Author

selection_001

Should be more files and higher addition/deletion stats. Weird, it was showing correctly before.

@jjanvier
Copy link
Contributor

jjanvier commented Apr 4, 2014

It seems new components and bundles are gone...

@jjanvier
Copy link
Contributor

jjanvier commented Apr 4, 2014

That's why you should work on a fork ><

@pjedrzejewski
Copy link
Member Author

I'll switch to fork yeah, but still this is not the problem - the bundles and components are there - https://github.com/Sylius/Sylius/tree/components-2/src/Sylius/Bundle/AttributeBundle.

@pjedrzejewski
Copy link
Member Author

If you browse the branch and commits, everything is in place. It looks like PR is wrong.

@jjanvier
Copy link
Contributor

jjanvier commented Apr 4, 2014

Is it possible to open another PR from this branch ? Github can handle that ?

@jjanvier
Copy link
Contributor

@pjedrzejewski maybe we should add another warning : "Please, test this migration in your stage environment before going to production."

I didn't have the time to test your upgrade procedure. Did someone have the time ?

@winzou
Copy link
Contributor

winzou commented Apr 10, 2014

The Doctrine Migration itself worked properly.

@jjanvier
Copy link
Contributor

yes !

@winzou
Copy link
Contributor

winzou commented Apr 10, 2014

I'm not sure about the class Sylius\Component\Product\Model\Variable\VariableProduct being in the file src/Component/Variation/Model/Variable.php :)

@pjedrzejewski
Copy link
Member Author

Done.

@makasim
Copy link
Contributor

makasim commented Apr 10, 2014

That's great work guys! Big step forward.

P.S. I waited with some good stuff till it is merged, lets do it now.

@pjedrzejewski
Copy link
Member Author

@makasim Great! :)

@pjedrzejewski
Copy link
Member Author

Thanks for the help guys!

@arnolanglade
Copy link
Contributor

Good job guys !!

@pjedrzejewski
Copy link
Member Author

I have a little issue with the subtree splits of renamed bundles, hopefully I'll fix this soon.

@winzou
Copy link
Contributor

winzou commented Apr 10, 2014

Awesome! Congrats guys!
Let's resume the business now =)

@pjedrzejewski pjedrzejewski changed the title [WIP] Components, II attempt Components, II attempt Apr 14, 2014
@pjedrzejewski pjedrzejewski deleted the components-2 branch April 17, 2014 18:05
@rvanlaak
Copy link
Contributor

Did read about decoupling MoneyBundle from PromotionsBundle in #1191 , is there a status update on that? 👍

Isn't it a matter about an extra $options key in ItemTotalConfigurationType to check or the MoneyBundle is available?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Minor issues and PRs improving the current solutions (optimizations, typo fixes, etc.).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants