Conversation
Removed port mappings for MySQL and PostgreSQL services to avoid conflicts in Codespaces.
|
@sourcery-ai review |
Reviewer's GuideAdds PostgreSQL support to the devcontainer (client, server service, and Joomla installer integration), refines MySQL usage, improves Joomla install robustness and Codespaces behavior, and enhances developer tooling (Xdebug auto‑config, Cypress, phpMyAdmin, multi-root workspace). File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 2 issues, and left some high level feedback:
- The container still mounts
.devcontainer/xdebug.inibutpost-create.shnow overwrites/usr/local/etc/php/conf.d/99-xdebug.inidynamically, so consider removing the volume or clearly separating static vs generated Xdebug config to avoid confusion and subtle precedence issues. - The Joomla-related post-create steps (phpMyAdmin install, Codespaces proxy fix, permission adjustments, etc.) are executed only when
configuration.phpis missing, meaning they won’t run when reusing an existing Joomla volume; if those steps are required on every startup, move them outside theif [ -f "$JOOMLA_ROOT/configuration.php" ]guard. - The
code /workspaces/testcom/testcom.code-workspaceinvocation inpost-create.shassumes a VS Code/Dev Containers environment and may be noisy or fail elsewhere; consider gating it behind an environment check (e.g.REMOTE_CONTAINERS/CODESPACES) or making it opt-in.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The container still mounts `.devcontainer/xdebug.ini` but `post-create.sh` now overwrites `/usr/local/etc/php/conf.d/99-xdebug.ini` dynamically, so consider removing the volume or clearly separating static vs generated Xdebug config to avoid confusion and subtle precedence issues.
- The Joomla-related post-create steps (phpMyAdmin install, Codespaces proxy fix, permission adjustments, etc.) are executed only when `configuration.php` is missing, meaning they won’t run when reusing an existing Joomla volume; if those steps are required on every startup, move them outside the `if [ -f "$JOOMLA_ROOT/configuration.php" ]` guard.
- The `code /workspaces/testcom/testcom.code-workspace` invocation in `post-create.sh` assumes a VS Code/Dev Containers environment and may be noisy or fail elsewhere; consider gating it behind an environment check (e.g. `REMOTE_CONTAINERS`/`CODESPACES`) or making it opt-in.
## Individual Comments
### Comment 1
<location path=".devcontainer/Dockerfile" line_range="39-41" />
<code_context>
+ # Composer
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer && \
- # Install Xdebug
+ # Xdebug
pecl install xdebug && \
- # Enable Apache's rewrite module and set the ServerName to prevent warnings
- a2enmod rewrite && \
+ docker-php-ext-enable xdebug && \
+ # Apache
+ a2enmod rewrite ssl && \
</code_context>
<issue_to_address>
**issue (bug_risk):** Avoid configuring Xdebug twice to prevent duplicate zend_extension warnings.
`pecl install xdebug` + `docker-php-ext-enable xdebug` already creates an ini with `zend_extension=xdebug`, and `post-create.sh` adds the same line to `99-xdebug.ini`, so Xdebug will be loaded twice. To avoid warnings and version‑dependent issues, either drop `zend_extension` from `99-xdebug.ini` and rely on the auto-generated ini, or skip `docker-php-ext-enable` and manage Xdebug only via your custom ini.
</issue_to_address>
### Comment 2
<location path=".devcontainer/docker-compose.yml" line_range="13" />
<code_context>
volumes:
- ..:/workspaces/testcom:cached
- ./xdebug.ini:/usr/local/etc/php/conf.d/99-xdebug.ini
+ - joomla-html:/var/www/html
ports:
</code_context>
<issue_to_address>
**suggestion:** Binding xdebug.ini while also rewriting 99-xdebug.ini in post-create.sh can be confusing and redundant.
Because `./xdebug.ini` is mounted to `/usr/local/etc/php/conf.d/99-xdebug.ini` but `post-create.sh` later regenerates that same file, the bind mount no longer has any effect and creates ambiguity about the real source of truth. Consider either removing the bind mount and relying on the script-generated config, or stopping the script from rewriting `99-xdebug.ini` and keeping all configuration in the mounted file instead.
Suggested implementation:
```
volumes:
- ..:/workspaces/testcom:cached
- joomla-html:/var/www/html
```
To fully align with the suggestion, verify that `post-create.sh` is indeed generating `/usr/local/etc/php/conf.d/99-xdebug.ini` with the desired Xdebug settings. If any configuration currently exists only in `./xdebug.ini`, you should migrate those settings into the script-generated file logic in `post-create.sh`, or into a base template that the script uses.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| # Xdebug | ||
| pecl install xdebug && \ | ||
| # Enable Apache's rewrite module and set the ServerName to prevent warnings | ||
| a2enmod rewrite && \ | ||
| docker-php-ext-enable xdebug && \ |
There was a problem hiding this comment.
issue (bug_risk): Avoid configuring Xdebug twice to prevent duplicate zend_extension warnings.
pecl install xdebug + docker-php-ext-enable xdebug already creates an ini with zend_extension=xdebug, and post-create.sh adds the same line to 99-xdebug.ini, so Xdebug will be loaded twice. To avoid warnings and version‑dependent issues, either drop zend_extension from 99-xdebug.ini and rely on the auto-generated ini, or skip docker-php-ext-enable and manage Xdebug only via your custom ini.
| @@ -6,12 +11,21 @@ services: | |||
| volumes: | |||
| - ..:/workspaces/testcom:cached | |||
| - ./xdebug.ini:/usr/local/etc/php/conf.d/99-xdebug.ini | |||
There was a problem hiding this comment.
suggestion: Binding xdebug.ini while also rewriting 99-xdebug.ini in post-create.sh can be confusing and redundant.
Because ./xdebug.ini is mounted to /usr/local/etc/php/conf.d/99-xdebug.ini but post-create.sh later regenerates that same file, the bind mount no longer has any effect and creates ambiguity about the real source of truth. Consider either removing the bind mount and relying on the script-generated config, or stopping the script from rewriting 99-xdebug.ini and keeping all configuration in the mounted file instead.
Suggested implementation:
volumes:
- ..:/workspaces/testcom:cached
- joomla-html:/var/www/html
To fully align with the suggestion, verify that post-create.sh is indeed generating /usr/local/etc/php/conf.d/99-xdebug.ini with the desired Xdebug settings. If any configuration currently exists only in ./xdebug.ini, you should migrate those settings into the script-generated file logic in post-create.sh, or into a base template that the script uses.
on devcontainer.json use:
// for MySQL
// for PostgreSQL
for full debug extensions + joomla core
code /workspaces/testcom/testcom.code-workspaceSummary by Sourcery
Add support for both MySQL and PostgreSQL dev profiles and improve the devcontainer setup for Joomla, debugging, and testing.
New Features:
Enhancements: