netz98 / n98-magerun2

The swiss army knife for Magento developers, sysadmins and devops. The tool provides a huge set of well tested command line commands which save hours of work time. All commands are extendable by a module API.
https://magerun.net
Other
872 stars 225 forks source link

Add n98-magerun2 to PHIVE #287

Closed shochdoerfer closed 6 years ago

shochdoerfer commented 7 years ago

I'd love to be able to install n98-magerun2 via PHIVE, at a later stage it will be possible to download .phars managed by PHIVE via Composer, thus a simple composer.phar install will be enough install all requirements needed to develop with Magento.

Steps needed to enable PHIVE support (as far as I can see right now):

  1. Deploy a phive.xml file to your webserver, see here for the XSD or here for a project generating such a file
  2. Add the phive.xml url to list of PHIVE repositories
hostep commented 7 years ago

Just a small hint, you can already install magerun2 using composer: composer require n98/magerun2. You can then use it by executing: php vendor/bin/n98-magerun2

The interesting part of phive (first time I heard of this tool) is:

Alternatively, you could have used composer. Only to clutter your project’s dependencies with the ones of your tools. And fight their potential dependency conflicts.

But in my experience, n98-magerun2 has no issues with dependency conflicts at this point.

shochdoerfer commented 7 years ago

One should be very picky when it comes to require-dev dependencies. I blogged about it here and here.

ktomk commented 7 years ago

No need to over-generalize IMHO, so far we don't have such dependency problems and if we (I) ditched something in the past, we're taking care for a quick and thoughtful resolution.

Create a PoC if you think it is valuable, this is missing in terms of this request.

I reviewed Phive some time ago, I'm not against it, but that time I decided to first concentrate on the reproducible Phar builds.

After this has been achieved we can go further.

Phive would impose work on the release workflow. Phar artifacts to be published to Github as assets to the tagged releases which is supported by Phive. This would keep binary and source releases in the same place, too, which is an additional benefit.

shochdoerfer commented 7 years ago

This issue was more meant to be an "improvement" than bug report as I was experimenting with PHIVE a bit recently. No need to work on it right now. Happy to help out but I am not sure if I have access to your build/release workflow.

Reproducible Phar builds definitely sounds more important, though. Again, happy to help if I can.

ktomk commented 7 years ago

Our phar builds are reproducible nowadays, but they weren't that time when looking into Phive for Magerun. Actually it's quite necessary for sane binary builds nowadays (e.g. see https://github.com/netz98/n98-magerun/issues/885) and are a precondition for Phive setups.

Do you know about the Phive Composer integration schedule? To give Phive some traction I think that would be beneficial.

Next to that, to tailor your issue with source releases, we can theoretically create a Magerun package which only contains the phar packages. When used via vendor/bin the only dependency problem left is the local PHP configuration.

ktomk commented 7 years ago

And in case of Magerun - not to forget - there is some benefit to even run into dependency problems, especially with Magento as main package as it is the case with Magento 2. This is contrary to what you're currently fiddling with. Not saying this would be against a Phive package, but I would normally suggest to install it as a dependency for Magento 2.

shochdoerfer commented 7 years ago

Not a problem at all. I just thought it might be a nobrainer to support PHIVE since you already have what is needed - the .phar files as well as the checksums. Feel free to close the issue if it does not make sense you or if you think it is not worth the effort.

cmuench commented 6 years ago

@shochdoerfer I added support for phive. Hope it will be merged. https://github.com/phar-io/phar.io/pull/26

shochdoerfer commented 6 years ago

@cmuench awesome news! Thanks. Will give it a try once it is merged.

cmuench commented 6 years ago

@shochdoerfer It's already merged. My first tests were successful.

phive install n98-magerun
phive install n98-magerun2
hostep commented 6 years ago

@shochdoerfer:

at a later stage it will be possible to download .phars managed by PHIVE via Composer

Any idea what the status of this is?

I would prefer to be able to use composer to install a certain tool (phar or src code) and not install yet another tool to manually manage these other isolated dependencies (like phive does). Preferable running composer update should update all main dependencies and also the isolated dependencies which are managed by something else. I can see some work is going on over here: https://github.com/phar-io/composer-plugin which seems to use composer and automatically downloads phive and then call phive with some commands to install the other tools you need which sounds promising, but since no version is tagged yet and lacks documentation, it probably isn't finished/stable yet?

Another alternative could be: https://github.com/tommy-muehle/composer-tool-installer-plugin or https://github.com/bamarni/composer-bin-plugin The last one looks very promising since it's just using composers already existing logic for downloading, verifying and installing dependencies, but tries to isolate the code of those dependencies from the main project's dependencies if I understand it correctly.

Anyone any experiences with these tools?

(Sorry if this is going a bit of topic, please let me know if this is inappropriate and I'll delete my post.)

shochdoerfer commented 6 years ago

@hostep As far as I know phar-io/composer-plugin will be the next-gen version of tommy-muehle/composer-tool-installer-plugin and based on phive. Tommy seems to work on this and I was hoping that it will be finished soonish, but not sure about the current state.