Conversation
|
@pocky and anyone else of course. Feel free to test this and provide me with feedback :) |
|
Hello, First feedback :)
ping @oallain and @jacquesbh |
|
Hi @pocky, Thanks for the review! How was the first build, slow? |
|
Hi @pocky Haven't heard back from you yet, I processed your feedback though 😄 @oallain @jacquesbh, |
|
I did a quick read but I really need more time to test the entire setup. |
|
Would be awesome if anyone could take some time to review/test it. For me it's working fine like I said before. |
|
@4c0n Is this relevant for your next step? :) Sylius/Sylius#11632 |
|
@jacquesbh It is very useful for sure, I should include the env variable in this PR so that the fixtures will automatically add it for the dev environment. For the tests the channel is added for each scenario through the behat setup |
…theme to the channel automatically in the future
|
@pocky ping |
|
Hi @pocky Hope you doing well 😃 Haven't heard from you in a while so I thought I'd follow up with you. I'd really like to move forward, but this PR is kind of a blocker for me as I explained before. Looking forward to your response! Thanks |
pocky
left a comment
There was a problem hiding this comment.
First, long time no see (and sorry).
Your work is awesome and it works with minor changes.
I requested some changes:
- PHP should be 7.3 by default (yes I know :D)
- vendors/composer
- We don't need Blackfire for profiling in BootstrapTheme
- I think it is possible to create something closer to PluginSkeleton https://github.com/Sylius/PluginSkeleton/tree/1.7 with a
testsdirectory and a default Application
I also had errors with behat in behat.yml.dist and I made theses changes:
FriendsOfBehat\SymfonyExtension:
kernel:
environment: "test"
debug: true Again, thanks and sorry for the lack of time.
| ################################## | ||
| # Blackfire profiling # | ||
| ################################## | ||
| # Set BLACKFIRE=true to enable # | ||
| # and configure values below. # | ||
| ################################## | ||
| BLACKFIRE=false | ||
| BLACKFIRE_CLIENT_ID= | ||
| BLACKFIRE_CLIENT_TOKEN= | ||
| BLACKFIRE_SERVER_ID= | ||
| BLACKFIRE_SERVER_TOKEN= | ||
| BLACKFIRE_LOG_LEVEL=3 |
There was a problem hiding this comment.
Is it possible to remove Blackfire?
There was a problem hiding this comment.
It's possible, but like I said before it is optional and disabled by default. So why are you so set on removing it?
| @@ -0,0 +1,219 @@ | |||
| ARG PHP_VERSION=7.4 | |||
There was a problem hiding this comment.
PHP_VERSION should be 7.3 by default
There was a problem hiding this comment.
It is the default in the docker-compose.yml and env file, so this value is not used, but sure I can set it to 7.3, for more clarity.
| ARG BLACKFIRE=false | ||
|
|
||
| RUN set -eux; \ | ||
| if [ ! -z "$BLACKFIRE" ] && [ "$BLACKFIRE" = "true" ]; then \ | ||
| curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/alpine/amd64/$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;"); \ | ||
| mkdir -p /tmp/blackfire; \ | ||
| tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire; \ | ||
| mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get ('extension_dir');")/blackfire.so; \ | ||
| printf "extension=blackfire.so\nblackfire.agent_socket=tcp://blackfire:8707\n" > $PHP_INI_DIR/conf.d/blackfire.ini; \ | ||
| rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz; \ | ||
| mkdir -p /tmp/blackfire; \ | ||
| curl -A "Docker" -L https://blackfire.io/api/v1/releases/client/linux_static/amd64 | tar zxp -C /tmp/blackfire; \ | ||
| mv /tmp/blackfire/blackfire /usr/bin/blackfire; \ | ||
| rm -Rf /tmp/blackfire; \ | ||
| fi |
There was a problem hiding this comment.
Sorry for blackfire :). Could you remove this?
| COPY --from=composer:latest /usr/bin/composer /usr/bin/composer | ||
|
|
||
| # https://getcomposer.org/doc/03-cli.md#composer-allow-superuser | ||
| ENV COMPOSER_ALLOW_SUPERUSER=1 | ||
| RUN set -eux; \ | ||
| composer global require "hirak/prestissimo:^0.3" --prefer-dist --no-progress --no-suggest --classmap-authoritative; \ | ||
| composer clear-cache | ||
| ENV PATH="${PATH}:/root/.composer/vendor/bin" |
There was a problem hiding this comment.
It is impossible to use hirak/prestissimo with composer:2. I think we should use composer:1 instead of composer:latest (for Sylius 1.7)
There was a problem hiding this comment.
Indeed, this was written before composer version 2 became the new "latest". I will make it easier to configure by introducing a new argument and using the version tag instead of the "latest" tag.
| php: | ||
| build: | ||
| args: | ||
| - BLACKFIRE=${BLACKFIRE:-false} |
| - BLACKFIRE_CLIENT_ID=${BLACKFIRE_CLIENT_ID} | ||
| - BLACKFIRE_CLIENT_TOKEN=${BLACKFIRE_CLIENT_TOKEN} | ||
| - BLACKFIRE_SERVER_ID=${BLACKFIRE_SERVER_ID} | ||
| - BLACKFIRE_SERVER_TOKEN=${BLACKFIRE_SERVER_TOKEN} |
| RUN set -eux; \ | ||
| yarn add \ | ||
| @symfony/webpack-encore \ | ||
| sass-loader@^8.0.0 \ |
There was a problem hiding this comment.
Use ^9.0.0 instead of ^8.0.0
There was a problem hiding this comment.
Okay, but I guess the instructions in the README and the docs need to be updated, as it states to do the following:
yarn add @symfony/webpack-encore sass-loader@^7.0.0 node-sass lodash.throttle -D
https://github.com/Sylius/BootstrapTheme/blob/master/README.md
https://docs.sylius.com/en/latest/book/themes/bootstrap-theme.html
There was a problem hiding this comment.
Yes, I will made a PR asap.
| yarn add \ | ||
| @symfony/webpack-encore \ | ||
| sass-loader@^8.0.0 \ | ||
| node-sass \ |
There was a problem hiding this comment.
use node-sass@^4.0.0 instead of latest
| 3. (Re)build the container images: | ||
| ```bash | ||
| docker-compose build | ||
| ``` |
There was a problem hiding this comment.
Missing step:
- Run behat
docker-compose exec php vendor/bin/behat --strict --tags="@javascript"
There was a problem hiding this comment.
It is not missing, however it is beyond the scope of this PR. The intention was to add a docker setup. Running the tests is another task.
Apology accepted, you could of responded to my Slack messages and/or comments though. Even if it is just to say that you currently don't have the time to work on this.
I already needed it, so I kind of disagree. Anyway it is an optional install (see README you need to specifically do something for it to be installed). So it really doesn't hurt to have the option of enabling it.
I think you're right, it certainly is possible. But what would be the advantage? So let's say we want the theme to support both Sylius 1.7 and 1.8 from one theme version, then we can't use the test application, because it can only be one version. Also we aren't testing/executing any installation steps anymore that way.
Running the tests is beyond the scope of this PR.
No worries, just as feedback, the lack of response was a much bigger issue for me than the lack of time. |
|
Hello @4c0n, About bootstrap and tests: my opinion is that this PR will allow us to test HTML rendered by BootstrapTheme. This is why I don't need Blackfire and I need to run Behat tests. Blackfire is useful for plugins and/or in the root application but not for a theme. About |
|
Hi! I agree with @pocky that having Blackfire here is not a requirement and should be removed. Since this repo is community driven, it would be better not to add such changes if they are not needed. Also, having a test application under I understand the use of Docker and we use a setting like this one in our own repositories, as example our makefile to run everything: https://github.com/monsieurbiz/SyliusColishipPlugin/blob/master/Makefile |
|
@jacquesbh @pocky Without the profiler I would have had a very hard time finding out why the initial build was so slow for example, personally I think it is quite useful to find out what is going on. Also it is a development setup, not so much production or anything. But if you guys feel so strongly about it I will remove it. Could you point out an alternative solution to be able to profile that you do support, xdebug maybe?
All you need to do now to set this up is run docker-compose, how exactly does it ease the setup? I still don't see any advantage to this, it just seems more work.
I'm not a big fan of using make for this, that's personal though. Without it, all people need to do is use docker-compose with the right container and prefix the command they're used to using with "docker-compose exec [CONTAINER_NAME]`. Abstractifying that in a Makefile, for me makes little sense, but like I said that is personal. Maybe you can add it in a separate PR?
Yes you could do that, but probably better to use branches, otherwise it'll be hard to fix older versions. Also you will have to maintain multiple versions, where that might not even be necessary. It would be good to decide on a versioning strategy for sure. I'm not planning on spending a lot of time on this at the moment, as I got a lot of other stuff going on, so maybe you can just accept this as is, and make your own modifications after you merge it. |
Progress on adding container setup.