codeclimate / php-test-reporter

DEPRECATED PHP Test Reporter
Other
65 stars 31 forks source link

Provide a .phar package for download to avoid requirement conflicts with composer #54

Closed hollodotme closed 7 years ago

hollodotme commented 8 years ago

I can see that you already have a box.json present in the repo. Would be great if you could provide a .phar file for download in Github's release section.

pbrisbin commented 8 years ago

Hi @hollodotme that sounds useful. I've added the help-wanted label here because I'm not sure we'll be able to action that work very quickly, so if someone wanted to come along and supply the needed release script (for example) to make that happen, it'd be much appreciated.

hollodotme commented 8 years ago

@pbrisbin OK, I'd like to take care of that and try to provide a PR in the next few days.

hollodotme commented 8 years ago

I had a look into the code today and have some questions:

I'd like to do/add the following:

Feedback appreciated! :)

pbrisbin commented 8 years ago

Is there a reason why there is no vendor\project namespace?

This is most likely due to our own unfamiliarity with PHP practices. This tool's interface is through executing the command, not as a library so I don't think there's any problem in fixing the namespacing to align with community practices.

Is there a reason why the TestReporterCommand gets the rootDir

This seems like some dead code. I can see we set a separate $rootDir variable in the collector itself from getcwd(), so the attribute on the command class appears unused to me.

Is there a reason why the app has no commands

I think it was just that a command-less invocation was a simpler UX for a tool that only does one thing. Requiring the user invoke test-reporter upload instead of just test-reporter seemed unnecessary.

If you added an upload command, does that mean invoking without any command would stop working? You mentioned there "wont be a BC break", so maybe I'm misunderstanding something.

Aside from that question about upload, everything else you've proposed sounds great to me. Were you thinking of breaking up these changes into a few PRs, or all in one go?

hollodotme commented 8 years ago

If you added an upload command, does that mean invoking without any command would stop working? You mentioned there "wont be a BC break", so maybe I'm misunderstanding something.

There won't be a BC break when installing the test-reporter via composer as a dependency, as of now. But I would add the upload and other commands to the PHAR executable (only) right from the start. This is possible by using another stub-script for the PHAR, than the one currently used in the composer.json's "bin" config.

I can break all changes up in several branches and PR's if you like.

One last question before I start: Is there a reason why the project is structured as a Symfony bundle? Is it used as one? If not, I'd like to change the structure first in favour of the vendor/project namespace and use the PSR-4 naming spec.

Thanks.

pbrisbin commented 8 years ago

There won't be a BC break when installing the test-reporter via composer as a dependency, as of now. But I would add the upload and other commands to the PHAR executable (only) right from the start. This is possible by using another stub-script for the PHAR, than the one currently used in the composer.json's "bin" config.

Gotcha. I think that all makes sense.

Is there a reason why the project is structured as a Symfony bundle? Is it used as one? If not, I'd like to change the structure first

Originally this project was modeled after (I think) the Coveralls reporter, so any project structure would have been inherited from that. IMO, so long as the external behavior is unchanged, re-structuring in accordance with a style like PSR-4 sounds awesome.

hollodotme commented 8 years ago

Ok, fine. Gonna start seeding PR's tomorrow. :)

pbrisbin commented 8 years ago

Thanks!

hollodotme commented 8 years ago

All done. :)

You can merge the PRs one by one or simply the last one. I added instructions on how to build and distribute the .phar in the DEVELOPING.md.

Everything should work as usual + now having a PHAR tool to do the job.

Unfortunately Github won't let me upload the built PHAR here. -.-

pbrisbin commented 8 years ago

Thanks so much @hollodotme !

If it's OK, I'd like to do the following (not yet sure when I'll have time, but hopefully this or next week):

hollodotme commented 8 years ago

Of course, take your time. Just let me know if you have any questions or want some additions to the PR branches.

localheinz commented 7 years ago

Closing as we're building a PHAR, just not automatically yet. Working on it!

👍