grumphp icon indicating copy to clipboard operation
grumphp copied to clipboard

[DRAFT] Pre push

Open claudiu-cristea opened this issue 1 year ago • 13 comments

Q A
Branch master for features and deprecations
Bug fix? yes/no
New feature? yes/no
BC breaks? yes/no
Deprecations? yes/no
Documented? yes/no
Fixed tickets comma-separated list of tickets fixed by the PR, if any

New Task Checklist:

  • [ ] Are the dependencies added to the composer.json suggestions?
  • [ ] Is the doc/tasks.md file updated?
  • [ ] Are the task parameters documented?
  • [ ] Is the task registered in the tasks.yml file?
  • [ ] Does the task contains phpunit tests?
  • [ ] Is the configuration having logical allowed types?
  • [ ] Does the task run in the correct context?
  • [ ] Is the run() method readable?
  • [ ] Is the run() method using the configuration correctly?
  • [ ] Are all CI services returning green?

claudiu-cristea avatar May 21 '24 20:05 claudiu-cristea

Thanks for the PR.

I'm a bit confused: There is already a draft, so wouldn't it be better to start from 1 PR and try to get that as good as possible? https://github.com/phpro/grumphp/pull/1136

veewee avatar May 22 '24 05:05 veewee

This is in a very early stage. Not ready for a review. I didn't want to mess with the previous PR

claudiu-cristea avatar May 22 '24 06:05 claudiu-cristea

I wasn't aware of the other PR ☹️

claudiu-cristea avatar May 22 '24 06:05 claudiu-cristea

No problem. Feel free to give your feedback on the initial PR so that we can try to get that one as good as possible.

veewee avatar May 22 '24 06:05 veewee

Hm, I'll have to coordinate with @saidatom. The way we're getting the pushed files list is different

claudiu-cristea avatar May 22 '24 06:05 claudiu-cristea

Also, in this PR there's a feature that allows to configure which Git hooks to be initialized. For me, personally, checking on each commit is too agresive. I only want pre push checks. But that's me, others might want on pre commit. Making it customizable makes sense

claudiu-cristea avatar May 22 '24 07:05 claudiu-cristea

True, I think that part could be covered by making it configurable per task basis instead of on a global basis as commented here https://github.com/phpro/grumphp/pull/1136/files#r1608281196. Not sure how easy it would be to make the 'default' configurable as well - but for BC sense it should at least be pre-commit

veewee avatar May 22 '24 07:05 veewee

@veewee, I have discussed with @saidatom. Until we decide the way to go, I'll continue to improve this. Regarding https://github.com/phpro/grumphp/pull/1136/files#r1608281196, I need to understand more what you are proposing there. You mean, for instance, that phpcs could run on a push while phpstan on commit?

claudiu-cristea avatar May 22 '24 14:05 claudiu-cristea

Regarding https://github.com/phpro/grumphp/pull/1136/files#r1608281196, I need to understand more what you are proposing there. You mean, for instance, that phpcs could run on a push while phpstan on commit?

Indeed: the hook script is activated on both commit and push. Which task is being executed will depend on a per task configuration with default if not set.

veewee avatar May 22 '24 18:05 veewee

@veewee

Indeed: the hook script is activated on both commit and push. Which task is being executed will depend on a per task configuration with default if not set.

I think this is fixed now.

I'm trying now to add some tests for the new feature. It would help a lot to enable GitHub Actions for this PR

_DRAFT__Pre_push_·_phpro_grumphp_896ccd4

claudiu-cristea avatar May 26 '24 12:05 claudiu-cristea

We notices this PR became inactive. If you wish to continue, feel free to pick it up again. If not, we will be closing this PR soon. Thanks for your understanding.

veewee avatar Nov 26 '24 12:11 veewee

I think the tests were not enabled so I couldn't continue. But I've missed that they were enabled in the meantime

claudiu-cristea avatar Nov 26 '24 12:11 claudiu-cristea

I don't know how to enable it and keep it enabled for this PR. You might want to run the actions in your local repository instead.

veewee avatar Nov 26 '24 12:11 veewee

Closing this one for now. Feel free to open up a new PR if you are interested in moving this forward.

veewee avatar Jul 25 '25 12:07 veewee