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

Add support for Puli #995

Closed
wants to merge 6 commits into from
Closed

Add support for Puli #995

wants to merge 6 commits into from

Conversation

Taluu
Copy link
Contributor

@Taluu Taluu commented Feb 3, 2017

this implements what is described in #989, although it is right now pretty specific for puli (as there is no "standards" currently).

I am not sure how to test this, but maybe registering the built-in extensions in the puli json file, and then remove the extensions parameter from the constructor could lead to something ? And then test that a built-in extension loads itself correctly ?

@Taluu
Copy link
Contributor Author

Taluu commented Feb 3, 2017

Something on what could be improved on the "extension detection" would be to have a real system of extension locators (one for class locator, one for file locator, one for puli locator, ... and so on, the first "supports" win), but I am not too sure if this wouldn't be too overkill ?


// feed extension on first call
if (null === $extensions) {
$extensions = [];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have to change this into array(), I know.

Copy link
Member

Choose a reason for hiding this comment

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

Sorry.

@everzet
Copy link
Member

everzet commented Feb 17, 2017

I'd rather not tie ExtensionManager to Puli directly. Sounds like abstraction is due.

@stof
Copy link
Member

stof commented Feb 17, 2017

I am not sure how to test this, but maybe registering the built-in extensions in the puli json file, and then remove the extensions parameter from the constructor could lead to something ? And then test that a built-in extension loads itself correctly ?

Test this by writing a Behat scenario doing it with a custom extension.

@Taluu
Copy link
Contributor Author

Taluu commented Feb 17, 2017

Test this by writing a Behat scenario doing it with a custom extension.

Yup, but I need to be sure that puli is available, that's the main pain IMO. Maybe add a tag or something ? I don't really want to add it in the require-dev section...

@everzet
Copy link
Member

everzet commented Feb 17, 2017

I don't really want to add it in the require-dev section...

@Taluu why not?

@@ -228,4 +234,29 @@ private function validateExtensionInstance($extension, $locator)
), $locator);
}
}

private function discoverExtensionWithPuli($locator)
Copy link
Member

Choose a reason for hiding this comment

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

I'd rather this method and all the other mentions of Puli to be hidden behind an abstraction.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You mean abstracting external tools or abstracting the loaders (one for the file loader, one for class locator, one for puli, ... and so on) ?

@Taluu
Copy link
Contributor Author

Taluu commented Feb 17, 2017

@everzet Because I feel like it should be more as a suggestion or optionnal dependency rather than required dev deps, but if you say it's okay, then I don't really mind

@stof
Copy link
Member

stof commented Feb 17, 2017

@Taluu dev requirements are things needed to run our tests. They have no impact on our users. So we can put what we need in them.
Forcing contributors to install puli separately to be able to run tests would make things harder for them, for no benefit

@@ -53,5 +54,8 @@
}
},

"prefer-stable": true,
"minimum-stability": "dev",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Had to it because puli/composer-plugin is still in beta (composer doesn't accept to install it then, as it is "not stable" yet)

Copy link
Member

Choose a reason for hiding this comment

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

I think this is the bit that breaks the build on 5.3 :/

Copy link
Member

Choose a reason for hiding this comment

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

I feel uneasy about doing this with stable core release. If that's the only way of doing the feature, my preference shifts to just providing an extension point in the core, but Puli being an extension (maybe even official).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So just splitting the extension loader ? Can do

Copy link
Member

@everzet everzet Apr 6, 2017

Choose a reason for hiding this comment

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

Yeah, well, the only challenge you will have now is that you will need to introduce an extension point for extension instantiators, which is definitely a head-scratcher.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, first things first...

Or what can be done, as it is done in the travis configuration, it's to enable these only in travis (or in dev through a global configuration ?). So it would mean to remove these two configuration options. Don't forget that it's only for dev-mode...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But it doesn't solve the problem that if Puli is provided in an extension (official or not), it would indeed be hard to solve the problem of extending these (you would actually need to load the extension through a normal way ?)

Or what could be done, instead of relying on these, would be to support something like a composer package type, which would be loaded automatically ?

*
* @param null|string $path
*/
public function setExtensionsPath($path)
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 wasn't used, but as it is public, I'm wondering if this could be considered a BC break ; but I didn't find a way on how to keep compatibility though...

@Taluu Taluu force-pushed the puli branch 2 times, most recently from 5c4e722 to 7976815 Compare February 20, 2017 13:56
@Taluu
Copy link
Contributor Author

Taluu commented Feb 20, 2017

@everzet PR updated with an abstraction on the initializers. The tests are not passing on php 5.3 for reasons that are eluding me (I can't manage to find the "line 446" on the puli plugin...).

Tests are missing but I'll add these later.

@Taluu Taluu force-pushed the puli branch 3 times, most recently from 32d222d to 9173343 Compare February 20, 2017 15:08
@Taluu Taluu force-pushed the puli branch 3 times, most recently from e25402f to 7055243 Compare March 1, 2017 21:33
@everzet
Copy link
Member

everzet commented Apr 4, 2017

I just reran the test and it still fails. Something is broken

@Taluu
Copy link
Contributor Author

Taluu commented Apr 4, 2017

Mmh, on travis it seems it is installing the beta-6 of the puli plugin (which faults at https://github.com/puli/composer-plugin/blob/1.0.0-beta6/src/PuliPlugin.php#L446), while there is the beta-10 available. Maybe it's due to that ? I'll try to update the plugin and put another version then instead ?

@Taluu
Copy link
Contributor Author

Taluu commented Apr 4, 2017

BTW, wasn't 5.3 support dropped ? Why is it still on travis ?

@Taluu Taluu force-pushed the puli branch 4 times, most recently from 6d15861 to f938f4d Compare April 4, 2017 12:35
@Taluu
Copy link
Contributor Author

Taluu commented Apr 7, 2017

Closing this one, as this could be in a separate (official or not) extension in favor of #1018.

Even though we first need to solve the "head-scratching issue" mentioned by @everzet

@Taluu Taluu closed this Apr 7, 2017
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.

3 participants