Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run CakePHP Quickstart with no interaction (skip setting directory permissions) #6300

Closed
4 tasks done
tyler36 opened this issue Jun 12, 2024 · 7 comments
Closed
4 tasks done

Comments

@tyler36
Copy link
Collaborator

tyler36 commented Jun 12, 2024

Preliminary checklist

Output of ddev debug test

Expand `ddev debug test` diagnostic information
[COPY-PASTE HERE THE OUTPUT OF `ddev debug test`]

Expected Behavior

Copy and pasting the CakePHP quickstart should:

  • install website
  • automatically launch the browser to the functionaling website

Actual Behavior

Composer stops and asks to "Set Folder Permissions":

$ ddev composer create --prefer-dist cakephp/app:~5.0
...
PHP CodeSniffer Config installed_paths set to ../../cakephp/cakephp-codesniffer,../../slevomat/coding-standard
Executing composer command: [composer run-script post-create-project-cmd]
 
> App\Console\Installer::postInstall
Created `config/app_local.php` file
Created `/var/www/html/logs` directory
Created `/var/www/html/tmp/cache/views` directory
Set Folder Permissions ? (Default to Y) [Y,n]? 

Steps To Reproduce

Follow quickstart guide for CakePHP (replicated below)

mkdir my-cakephp-site && cd my-cakephp-site
ddev config --project-type=cakephp --docroot=webroot
ddev composer create --prefer-dist cakephp/app:~5.0
ddev cake
ddev launch

Anything else?

I tried use --no-interaction on the composer line but it still stopped.
Eg. ddev composer create --prefer-dist cakephp/app:~5.0 --no-interaction

I believe this is because of the composer run-script post-create-project-cmd line which doesn't inherit the flag.

Adding a .ddev/.env file with COMPOSER_NO_INTERACTION=1 does NOT cause composer to stop. But we probably don't want this to always be active, only during the initial "ddev composer create" step.

@rfay
Copy link
Member

rfay commented Jun 12, 2024

Could you please try it with the HEAD version and see if it's any different?

The second answer on https://stackoverflow.com/questions/49812880/how-can-i-run-composer-without-user-interaction also might have value (using yes)

IIRC Composer added a question like this for security purposes that might require an extra setting in the composer.json to bypass.

@rfay rfay changed the title CakePHP Quickly Run CakePHP Quickstart with no interaction (skip setting directory permissions) Jun 12, 2024
@tyler36
Copy link
Collaborator Author

tyler36 commented Jun 12, 2024

You mean ddev exec yes | composer create --prefer-dist cakephp/app:~5.0 ?

$ ddev exec yes | composer create --prefer-dist cakephp/app:~5.0
...
Updated Security.salt value in config/app_local.php
Failed to execute command yes: signal: broken pipe

@stasadev
Copy link
Member

yes | ddev composer create --prefer-dist cakephp/app:~5.0

@stasadev
Copy link
Member

stasadev commented Jun 12, 2024

I think I know what the problem is, we're not passing the flags to composer run-script, I'll fix that.

Edit:

I believe this is because of the composer run-script post-create-project-cmd line which doesn't inherit the flag.

I didn't read the first post carefully 😅

@tyler36
Copy link
Collaborator Author

tyler36 commented Jun 12, 2024

yes | ddev composer create --prefer-dist cakephp/app:~5.0

Sorry. Didn't think of it there.

@tyler36
Copy link
Collaborator Author

tyler36 commented Jun 18, 2024

yes | ddev composer create --prefer-dist cakephp/app:~5.0

✅ WSL Ubuntu with DDEV 1.23.2
❌ Windows 11 with DDEV 1.23.2

@rfay
Copy link
Member

rfay commented Jun 18, 2024

RIght, but that shouldn't be needed at all with

which is the real fix. We'll get that in soon.

@rfay rfay closed this as completed in ac535e4 Jun 26, 2024
rfay added a commit to ddev-test/ddev that referenced this issue Jun 27, 2024
* docs: Warn about Codespaces (ddev#6321) [skip ci]

Co-authored-by: Matthias Andrasch <[email protected]>

* docs: Improve ddev debug test by offering suggestions early [skip ci] (ddev#6323)

* feat: add support for MariaDB 11.4 LTS, fixes ddev#6061 (ddev#6243)

Co-authored-by: Stanislav Zhuk <[email protected]>

* docs: pacify textlint on mysql/https (ddev#6336) [skip ci]

* docs: revisit WSL Docker Desktop setup instructions (ddev#6330)

* fix: autodownload yarn from corepack, and set cache-folder, fixes ddev#6332 (ddev#6333)

* docs: windows-wsl2-dd needs apt install for ngrok (ddev#6341) [skip ci]

* build: check docker-compose 2.28.1 (ddev#6340) [skip ci]

* fix: use real path to global config location, fixes ddev#6328 (ddev#6329)

* test: stop running nightly tests [skip ci] (ddev#6347)

* test: Improve reliability of TestProcessHooks (intermittent failures), fixes ddev#6313 (ddev#6314)

* fix: Drupal 10 and Drupal 11 settings have migrated, set state_cache (ddev#6346) [skip ci]

Co-authored-by: Stanislav Zhuk <[email protected]>

* build: use IPv4 inside a container, mariadb-client 11.4 for the webserver (ddev#6334) [skip ci]

* fix: pass all valid options to nested commands in `ddev composer create`, fixes ddev#6300, fixes ddev#6246, for ddev#5058 (ddev#6303)

Co-authored-by: Randy Fay <[email protected]>
Co-authored-by: Ralf Koller <[email protected]>

* docs: fix up textlint complaints

* Turn off defaultTerms

* Use exclude properly with textlint for VS Code

* update for additional textlint complaints

* remove redundant empty exclude section

* Try to get textlint/reviewdog to report

---------

Co-authored-by: Matthias Andrasch <[email protected]>
Co-authored-by: hussainweb <[email protected]>
Co-authored-by: Stanislav Zhuk <[email protected]>
Co-authored-by: Ralf Koller <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants