foundry icon indicating copy to clipboard operation
foundry copied to clipboard

docs: Improve initial Setup to contribute on this Bundle

Open benblub opened this issue 3 years ago • 9 comments

Maybe its a good idea so write somewhere how to setup/use this repo in an easy way to prevent searching all whats needed.

Running tests

locally i installed phpunit instead of running php vendor/bin/simple-phpunit

Problem Step by step Debugging in PHPStorm IDE which uses per default normal phpunit and its more handy then using the CLI.

Solution composer require phpunit/phpunit --dev Then you can run php vendor/bin/phpunit which also fixes running unit tests in PHPStorm via the small icons

Setup

Problem Needs time to setup this here to start contribute

Solution Add some dockerized files that we can fast start working.

CSFixer

Problem Missing binary in bin folder

Solution composer require friendsofphp/php-cs-fixer --dev then you can run php vendor/bin/php-cs-fixer fix ..

Running migration

Problem How to generate new migrations?

Solution Not found yet run php vendor/bin/doctrine-migrations migrations:generate didnt work -> missing configuration.

edit I have to closer look into this issue, first steps works now 💪 Bildschirmfoto 2021-12-12 um 00 30 40

benblub avatar Dec 11 '21 22:12 benblub

Thanks for jotting down your issues. Yes, I'd like to add a contributing section to the readme.

Running tests

I'd like to maintain the bridge to avoid dependency conflicts. For PhpStorm, there is a solution: https://stackoverflow.com/questions/47569173/how-to-configure-phpstorm-to-use-symfony-phpunit-bridge (happy to include a link to this)

Setup

I agree but have no/little experience with docker but create a PR with your setup and we can discuss further.

CSFixer

I'm planning to remove this as a PR check and just use an action to auto-commit fixes after merge. This shouldn't be a roadblock to contributing.

Running migration

I'd be happy to formalize these steps.

kbond avatar Dec 12 '21 22:12 kbond

For the CSFixer i like Husky. Then you can setup a git pre-commit hook which can be commited to the repo. But its required npm..

https://github.com/typicode/husky

benblub avatar Dec 13 '21 19:12 benblub

For docker, I feel something like https://github.com/nektos/act would be best (assuming it works as described). What would be nice about this solution is we wouldn't have to keep docker config and gh actions config in sync.

kbond avatar Dec 20 '21 13:12 kbond

needs to test.

benblub avatar Dec 30 '21 05:12 benblub

Hi @kbond

act does not work with reusable workflows... then it won't be possible to use it

nikophil avatar Sep 21 '22 14:09 nikophil

Ah ok, I think just a docker compose file that provides mysql/postgres/sqlite/mongo?

kbond avatar Sep 21 '22 14:09 kbond

I think this would do the trick. that's how I'm using it

nikophil avatar Sep 21 '22 14:09 nikophil

but csfixer needs to be installed globally... can't we do the same trick than for psalm?

nikophil avatar Sep 21 '22 14:09 nikophil

can't we do the same trick than for psalm

Yep, that'd be fine I think.

kbond avatar Sep 21 '22 14:09 kbond

How to generate new migrations?

This would be very useful. Going to need to do this in #300.

kbond avatar Sep 23 '22 22:09 kbond

Would be very helpful indeed

NorthBlue333 avatar Sep 24 '22 17:09 NorthBlue333

I have to closer look into this issue, first steps works now muscle

@benblub, how did you get the migrations running? (cc @nikophil)

kbond avatar Oct 06 '22 15:10 kbond

good question 🤦

A good entry point https://www.doctrine-project.org/projects/migrations.html https://www.doctrine-project.org/projects/doctrine-migrations/en/3.5/reference/introduction.html#introduction https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/schema-representation.html https://github.com/mnapoli/dbal-schema

Unfortunately I don't have so much time at the moment, I have to see when I will find time for it. I really like that currently they are working on making the contribute easier 💪 💪 💪

benblub avatar Oct 06 '22 22:10 benblub

Hi!

here are some hints about this:

Running tests

since we will soon have a docker stack, ~I'll provide xdebug in the php image. In my experience, there is actually no problem in using both xdebug and simple-phpunit~.

EDIT: I've added xdebug in the image, tested that we can indeed perform step by step xdebug session, and added a little bit of docs for making this work in phpstrom.

Setup

you may find your needs in https://github.com/zenstruck/foundry/pull/306 :) don't hesitate to comment out the PR.

CSFixer

This is provided by the mentioned PR. A make target is also present.

Running migration

I wrote some thoughts here: https://github.com/zenstruck/foundry/issues/308

nikophil avatar Oct 08 '22 10:10 nikophil

I think this could be closed, follow up of the migrations stuff in #308

nikophil avatar Oct 10 '22 14:10 nikophil