Conversation
Add bitbucket to the command options list and fix the alignment
I wasn't aware that the README is auto-generated.
templates/plugin-bitbucket.mustache
Outdated
| pipelines: | ||
| default: | ||
| - step: | ||
| image: tfirdaus/wp-docklines:php5.6-fpm-alpine |
There was a problem hiding this comment.
It'd be good to use something more neutral here (and passim) I think rather than your personal stuff! Is there a way to do that??
There was a problem hiding this comment.
Hi, @gitlost
Thank you for reviewing the pull request.
Yes, that's possible. However, in the case of Bitbucket Pipelines, I'm afraid doing so might harm users sitting on the Free plan as Bitbucket only allocates 50 minutes of build per month on the Free plan. Bitbucket suggests creating our own Docker images that are ready to go as setting up dependencies and tools during the build will be time-consuming.
Here is what that says in one of their articles Tips for scripting tasks with Bitbucket Pipelines
Installing the dependencies necessary for your pipeline to run can be time-consuming. You could save a lot of running time by creating your own Docker image with the basic tools and packages required to build and test your application.
Hence the reason for those personal images 🙂
I'm open to suggestion; if including personal images is not allowed I'm more than happy to change it to a neutral image.
There was a problem hiding this comment.
Hi @tfirdaus !
Bitbucket suggests creating our own Docker images that are ready to go as setting up dependencies and tools during the build will be time-consuming.
Ah I see, ta. (Forgive my ignorance, I know next to nothing about Docker also and only just noticed your images here https://hub.docker.com/r/tfirdaus/wp-docklines/)
So perhaps the way to go in the future might be to register wp-cli or similar on Docker Hub and upload the images there. But in the meantime we could use your (oh so personal!) account.
Thanks for the feedback, would like to get input from @schlessera on it - though we're about to release WP-CLI 1.5.0 on Tuesday so may not be in touch immediately...
There was a problem hiding this comment.
@tfirdaus I understand the reason why you added the (personal) image to the script. However, I don't want to include such a custom image in this script for the following reasons:
- Providing an official WP-CLI image means that the WP-CLI maintainers need to indefinitely maintain this image. I consider this is out of scope for the WP-CLI project.
- Providing your personal image is a potential security/trust issue. We would basically endorse an unknown black box image. I don't feel comfortable doing this, not because I don't trust you as a person, but because I think that this is just not a good idea in principle. We have no control over that image, so must assume it cannot be trusted.
- The scaffolding tools are meant to provide a starting point. Having a basic BB Pipelines setup that has a limitation on the free plan is perfectly okay. It still helps people to get started quickly, and they are meant to do adjustments to fit their needs either way.
Given the above, would you be willing to change the PR so that it doesn't include a pre-built image, but rather compiles a minimum set of dependencies on the fly?
There was a problem hiding this comment.
Understood and that totally makes sense. I'll rewrite the Pipelines config to the minimum :) Thank you for your feedback @schlessera
This reverts commit 664df92. # Conflicts: # features/scaffold-theme-tests.feature
This reverts commit 4a69998.
This reverts commit 62e24a4.
This reverts commit a926994.
This reverts commit 7eab5f0.
This reverts commit 0312d52.
This reverts commit e31f6d5. # Conflicts: # features/scaffold-theme-tests.feature
|
@schlessera & @gitlost I apologize. I think I messed up the commits for this pull requests. It appears there might be a compatibility issue with the test suite running on PHP 7.2. All tests went through except for PHP 7.2 https://travis-ci.org/tfirdaus/scaffold-command/builds/342950123. The error says: |
It's fine as it is @tfirdaus, thanks.
Yes, see https://core.trac.wordpress.org/ticket/43218 for the report. I think for the moment we can just explicitly use phpunit 6.5.6 for PHP 7.2 - will do a PR for this. |
|
@tfirdaus We've include a work-around for now. Can you merge latest master? That should fix the tests. |
|
Thanks @schlessera 👍 , I'll try to do it on this weekend :) |
It’s strange that one failed and the other one passed of the same build. (Build wp-cli#13 passed) https://travis-ci.org/tfirdaus/scaffold-command/builds/345534407 (Build wp-cli#232 failed) https://travis-ci.org/wp-cli/scaffold-command/builds/345534415
|
@gitlost and @schlessera thanks, The issue on PHP 7.2 is fixed. All tests are passed as it seems now 💯 |
templates/plugin-bootstrap.mustache
Outdated
|
|
||
| if ( ! file_exists( $_tests_dir . '/includes/functions.php' ) ) { | ||
| echo "Could not find $_tests_dir/includes/functions.php, have you run bin/install-wp-tests.sh ?" . PHP_EOL; | ||
| esc_html( "Could not find $_tests_dir/includes/functions.php, have you run bin/install-wp-tests.sh ?" ) . PHP_EOL; |
There was a problem hiding this comment.
I think to get around the incorrect phpcs echo warning probably best to do
fwrite( STDERR, "Could not find '$_tests_dir/includes/functions.php', have you run bin/install-wp-tests.sh ?" . PHP_EOL );
here, as esc_html() not appropriate for shell output.
There was a problem hiding this comment.
Hi, @gitlost
As I recall I did not make this change 🙁.
I'm wondering if it was added when I messed up the commit (I'm not quiet certain on this).
I also think that using esc_html function does not make any sense, as it won't be loaded upon executing install-wp-tests.sh, and looking at the master (https://github.com/wp-cli/scaffold-command/blob/master/templates/plugin-bootstrap.mustache#L15), it should be just echo.
Do you think we can revert it back to echo?
There was a problem hiding this comment.
Ah okay, it somehow got added in the melee here #118 (commits).
Do you think we can revert it back to echo?
Yes, that's the simplest thing to do, as contrary to what I said above phpcs doesn't seem to object to it anyway, so please just do that, thanks!
|
Thanks @tfirdaus, good stuff! I suppose we could iterate on this to include the testing of different |
|
Definitely, I think we could do it in the future 👍 |
Add Bitbucket Pipelines
Adding Bitbucket Pipelines as one of the CI providers (Resolve #9), allowing users to specify
bitbucketon thewp scaffoldcommand. For examples:Scaffold Plugin Test:
Scaffold Theme Test:
Example repositories with a working pipelines can be found at: