Closed (fixed)
Project:
Features
Version:
8.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
17 Oct 2015 at 00:48 UTC
Updated:
2 Jan 2016 at 16:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
mpotter commentedThis is a good idea but would change the API so need to be a beta blocker.
Extending the Extension object seems like it would make some sense (Feature packages *are* modules). But I'm wondering about all of the side effects, and wonder how it would handle packages that aren't even exported into code yet. But I'd need to look more at the Extension object to decide.
Comment #3
dawehnerIdeally I think this object would not extend the extension object but rather wrap one, its just a bit better to deal with IMHO.
The extension object is a value object, so you could create one easily on runtime and fake something up, but yeah this is another reason why the package object
should be modelled as a wrapper or maybe you can create a package object from an extension object (Just an idea:
$package = Package::fromExtension($extension)which then fetches all the values and maybe pass it to the constructor.
Comment #4
dawehnerHere is just a rough start. As you will see, there aren't that many fixme/todos, but at least some start.
In an ideal world we would extract the tests first into its own issue. They are helping a bit.
Comment #5
nedjo@dawehner: great start!
Could change to "Current package being edited."
There are various other code comments were we could change "package array" to "package".
The revised code drops the call to $bundle->getFullName(). Is that to fix a bug?
The problem here is that the code we need to replace merges into the package array, which repeats these keys from the info array ('dependencies', 'themes').
Maybe:
Could maybe use $package->appendFile() here since we don't need to specify the file index (as we do with e.g. 'info', to enable later merging into that file)?
Comment #6
dawehnerThank you for the feedback!
Nope, this is just a clear bug.
Oh yeah we totally should. After doing this manually some times, it was too annoying so I introduced a proper helper method.
Thank you for that tip!
Comment #7
dawehnerMove the additional methods into its own issue.
Comment #8
dawehnerOne bugfix with a test.
IMHO we should merge #2616408: Create SimpleTest for basic UI functionality in first, this is for sure.
Comment #9
dawehnerMore fixes and tests.
Comment #10
dawehnerMore fixes and more tests for the FeaturesManager
Comment #11
nedjoThis is looking great.
I did a string search for
$package[and there are a few places that probably still need fixing up, in modules/features_ui/src/Form/FeaturesDiffForm.php, src/FeaturesGenerator.php, src/FeaturesManager.php, and tests/src/Kernel/FeaturesGenerateTest.php.Comment #12
nedjoFrom the subsequent code in this method, which works with
$export['package'], it looks like instead of removing this line we should do something like:Comment should be "The package." rather than "The package name."
This looks like an unrelated bugfix? Worth catching and no prob to add here.
Comment #13
dawehnerGood catch! I was quite confused about these lines in general, now this seems to be good and make sense. There is data which is part of the package + additional metadata in this
$exportarray.Fixed!
Using this allows you to mock the filesystem using VFS
Some intermediate work.
Comment #14
dawehnerFixed the other instances ...
Comment #15
nedjoAll the fixes look good.
I'm getting some failures for Drupal\features\Tests\FeaturesCreateUITest, haven't looked into them.
Should be:
Needs rerolling after a recent change.
Comment #16
dawehnerGood catch! Added a unit test for that.
Fixed that
Comment #17
nedjoFirst error includes:
Comment #18
dawehnerThanks for that.
Here is one fix for the FeaturesManager, interesting that this was not there before.
Now though the remaining failure seems to be that there is just one component added to the feature.
I fear that
\Drupal\features_ui\Form\FeaturesEditForm::getComponentListmight be involved in that, which scares me a bit, to be honest. Help would be more than welcomed.Comment #19
dawehnerFound the problem.
Comment #21
nedjo@dawehner
Given the scope of the change it will be surprising if we got absolutely everything, but my basic manual testing plus the new tests introduced here didn't show any issues.
Thanks for your amazing work and perseverance here. It's great to have this refactoring complete.
Comment #32
nedjoComment #33
dawehneryeah, we are in alpha state and sometimes iterating quickly is just more sane than perfectionism everywhere.