feat: Add VS Code DevContainer for simplified development setup#10085
feat: Add VS Code DevContainer for simplified development setup#10085JohnRDOrazio wants to merge 5 commits intoroundcube:masterfrom
Conversation
This commit introduces a comprehensive VSCode DevContainer setup to streamline the development environment for Roundcube. This setup provides: - Automated provisioning of all necessary services (PHP, MariaDB, IMAP, MailHog). - Pre-configured VSCode extensions for PHP and JavaScript development. - Automated installation of PHP and JavaScript dependencies. - Automated database initialization and Roundcube configuration. As part of simplifying the development setup, a fix for static file serving with the PHP built-in server is also included. This ensures better compatibility when using the built-in server for local development, without affecting production environments (Apache/Nginx).
DevContainer: - Add PHP memory_limit=512M for PHPStan compatibility - Fix Dockerfile.dovecot entrypoint script (use printf for newlines) - Fix post-create.sh: validate table_count, add DROP error handling, correct des_key length to 24 chars, fix comment style - Remove unnecessary exposed SMTP port from docker-compose.yml Static file server (public_html/static.php): - Fix HTTP Range suffix handling (bytes=-500 now returns last 500 bytes) - Add fopen error handling to prevent operations on failed file handles - Add fread error handling to prevent infinite loops - Fix PHP-CS-Fixer style issues Other: - Add /temp to .eslintrc.js ignorePatterns (third-party JS libs) - Add AI coding agents and build artifacts to .gitignore Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The *.sh pattern was intended to lint PHP CLI scripts in bin/ that use the .sh extension, but it also caught actual bash scripts which caused linter failures. Exclude .ci/, .devcontainer/, and the four real shell scripts in bin/ (cssshrink.sh, jsshrink.sh, makedoc.sh, transifexpull.sh). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Normalize composer.json with composer normalize - Add tests/.phpunit.result.cache to .gitignore Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The kolab/net_ldap3 package is already listed under "suggest" in composer.json, so it shouldn't also be in require-dev. Instead, add a VS Code task "Install Suggested Packages" that installs both suggested packages (zxcvbn-php and net_ldap3) on demand. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
I had to make some adjustments to |
|
@alecpl may I ask your thoughts on this? I believe it would greatly simplify setting up a development environment, all within VSCode, so developers can just concentrate on working on issues and features without having to worry about setting up the whole environment. |
|
I don't like the duplication of docker images/setups. We already have some of it in the |
|
I think we should not change I use the Personally I'm also not interested in VSCode-integration. And I'm skeptical about the AI-yness of the code and language. If several (potential) contributors are interested in this I would try to find the time for a thorough review, but without that noticeable interest I won't. |
|
Regarding the static.php part. We already have a few tests via |
|
You will both excuse me for the wait in the response, I have been travelling. @pabzm I did look at the Docker Hub The Docker Hub
What it does NOT provide:
I'm not understanding in which manner a devcontainer or VSCode-integration relates to "AI-yness"? Developers can easily work within an IDE with or without AI code assistance. I myself have been writing PHP code for 15 years without any AI assistance; I find that tools like Claude Code can boost productivity and they are good at formulating commit descriptions / PR descriptions, saving a lot of time and energy for developers. That doesn't mean that developers should delegate the whole coding process to AI-assisted coding tools. Developers can and should inspect any code changes introduced by AI-assisted tooling in git diffs (which is quite easily done in an IDE such as VSCode, hence the purpose of this PR). Of course this PR does not enforce on developers the usage of one IDE over another, it simply allows developers that do use VSCode or similar IDEs (such as Eclipse Theia) to have a ready environment for development. That said, I'm happy to discuss whether it makes sense to build on top of the official image as a base, or if there are aspects that could be simplified. I would like to contribute a few PRs to the codebase, to the roundcube UI, but I was finding the environment setup a bit cumbersome. This PR would greatly simplify the process. |
|
@alecpl @pabzm Thanks for the feedback on Regarding the
I can include new tests in The reason for these changes was that the output buffering was NOT working in my PHP builtin server setup. After introducing the changes, the output buffering worked correctly. Here's a summary of the issues I encountered:
|
Summary
.shextension.gitignoreCloses #10084
Test plan
Ctrl+Shift+Band verify Roundcube loadstestuser/testpasscredentials🤖 Generated with Claude Code