|
| 1 | +# Copilot Instructions for ddev-php85 |
| 2 | + |
| 3 | +## Repository Overview |
| 4 | + |
| 5 | +This repository is a DDEV add-on for PHP 8.5 support, currently based on the DDEV add-on template. DDEV is a Docker-based local development environment tool that simplifies setting up development environments for web applications. |
| 6 | + |
| 7 | +For general DDEV agent instructions and conventions, please refer to: https://github.com/ddev/.github/blob/main/AGENTS.md |
| 8 | + |
| 9 | +## Test Environment Requirements |
| 10 | + |
| 11 | +This repository requires access to `*.ddev.site` domains for testing functionality. The test suite creates local DDEV projects that use the `.ddev.site` TLD to validate the add-on works correctly with DDEV's local development environment. |
| 12 | + |
| 13 | +Additionally, permissions need to be lifted to allow `apt-get` instructions to work in Dockerfiles when building custom PHP 8.5 images for the add-on. |
| 14 | + |
| 15 | +## Current State |
| 16 | + |
| 17 | +**Note**: This repository is currently in development and contains template files that need to be customized for PHP 8.5 support. The repository still contains references to "addon-template" that should be replaced with "php85" specific configurations. |
| 18 | + |
| 19 | +## Purpose |
| 20 | + |
| 21 | +Once fully developed, this add-on will extend DDEV to support PHP 8.5, allowing developers to: |
| 22 | +- Test their applications against PHP 8.5 |
| 23 | +- Develop applications that require PHP 8.5 features |
| 24 | +- Ensure compatibility with the latest PHP version |
| 25 | + |
| 26 | +## Key Files and Components |
| 27 | + |
| 28 | +### Core Add-on Files |
| 29 | +- `install.yaml` - Defines how the add-on is installed (currently contains template values that need customization) |
| 30 | +- `docker-compose.addon-template.yaml` - Docker Compose configuration (needs to be renamed and customized for PHP 8.5) |
| 31 | +- `README.md` - Main documentation (currently contains template content) |
| 32 | + |
| 33 | +### Files Needing Customization |
| 34 | +The following files still contain template references and need to be updated for PHP 8.5: |
| 35 | +- `install.yaml` - Change name from "addon-template" to "php85" |
| 36 | +- `docker-compose.addon-template.yaml` - Rename to `docker-compose.php85.yaml` and configure for PHP 8.5 |
| 37 | +- `tests/test.bats` - Update GITHUB_REPO reference from template to actual repository |
| 38 | +- `README.md` - Replace template content with PHP 8.5 specific documentation |
| 39 | +- Various files containing "ddev/ddev-addon-template" references |
| 40 | + |
| 41 | +### Testing Infrastructure |
| 42 | +- `tests/test.bats` - Bats test suite that validates the add-on functionality |
| 43 | +- `tests/testdata/` - Test data and configurations |
| 44 | +- `.github/workflows/tests.yml` - GitHub Actions workflow for automated testing |
| 45 | + |
| 46 | +### GitHub Configuration |
| 47 | +- `.github/ISSUE_TEMPLATE/` - Issue templates for bug reports and feature requests |
| 48 | +- `.github/PULL_REQUEST_TEMPLATE.md` - Pull request template |
| 49 | +- `.github/scripts/` - Helper scripts for repository management |
| 50 | + |
| 51 | +## Development Workflow |
| 52 | + |
| 53 | +### Adding Features |
| 54 | +1. Modify the appropriate configuration files (`install.yaml`, Docker Compose files) |
| 55 | +2. Update tests in `tests/test.bats` to validate new functionality |
| 56 | +3. Update documentation in `README.md` |
| 57 | +4. Test locally using `ddev add-on get /path/to/local/addon` |
| 58 | +5. Create pull request with descriptive changes |
| 59 | + |
| 60 | +### Testing |
| 61 | +- Tests use the Bats testing framework for Bash |
| 62 | +- Tests validate that the add-on can be installed and functions correctly |
| 63 | +- Two test scenarios: local installation and release installation |
| 64 | +- Tests run automatically on pull requests and daily via GitHub Actions |
| 65 | + |
| 66 | +### File Conventions |
| 67 | +- All DDEV-managed files should include `#ddev-generated` comment for proper cleanup |
| 68 | +- Use DDEV environment variables for templating (e.g., `${DDEV_SITENAME}`, `${DDEV_APPROOT}`) |
| 69 | +- Follow semantic versioning for releases |
| 70 | + |
| 71 | +## DDEV-Specific Considerations |
| 72 | + |
| 73 | +### Environment Variables |
| 74 | +Common DDEV environment variables available: |
| 75 | +- `DDEV_SITENAME` - Project name |
| 76 | +- `DDEV_APPROOT` - Application root directory |
| 77 | +- `DDEV_DOCROOT` - Document root |
| 78 | +- `DDEV_PROJECT_TYPE` - Project type (drupal, wordpress, etc.) |
| 79 | + |
| 80 | +### Add-on Structure |
| 81 | +- `project_files` - Files copied to project's `.ddev` directory |
| 82 | +- `global_files` - Files copied to user's global `~/.ddev` directory |
| 83 | +- `pre_install_actions` - Commands run before installation |
| 84 | +- `post_install_actions` - Commands run after installation |
| 85 | +- `removal_actions` - Commands run when add-on is removed |
| 86 | + |
| 87 | +### Docker Services |
| 88 | +- Services should be prefixed with add-on name to avoid conflicts |
| 89 | +- Use appropriate labels for DDEV discovery |
| 90 | +- Follow Docker Compose best practices for service definitions |
| 91 | + |
| 92 | +## PHP 8.5 Implementation Tasks |
| 93 | + |
| 94 | +To complete this add-on, the following tasks need to be completed: |
| 95 | + |
| 96 | +### 1. Template Customization |
| 97 | +- [ ] Run the first-time setup script or manually update template references |
| 98 | +- [ ] Rename `docker-compose.addon-template.yaml` to `docker-compose.php85.yaml` |
| 99 | +- [ ] Update `install.yaml` name field from "addon-template" to "php85" |
| 100 | +- [ ] Update project_files to reference the renamed docker-compose file |
| 101 | +- [ ] Update GITHUB_REPO in `tests/test.bats` to "ddev/ddev-php85" |
| 102 | + |
| 103 | +### 2. PHP 8.5 Configuration |
| 104 | +- [ ] Configure Docker service to use PHP 8.5 image |
| 105 | +- [ ] Add PHP 8.5 specific extensions and configurations |
| 106 | +- [ ] Set up proper volume mounts for PHP application code |
| 107 | +- [ ] Configure PHP-FPM or CLI as needed |
| 108 | +- [ ] Add environment variables for PHP 8.5 configuration |
| 109 | + |
| 110 | +### 3. Testing and Documentation |
| 111 | +- [ ] Update health_checks() function in test.bats for PHP 8.5 validation |
| 112 | +- [ ] Write comprehensive README with PHP 8.5 usage instructions |
| 113 | +- [ ] Document any PHP 8.5 specific features or limitations |
| 114 | +- [ ] Add examples of how to use the add-on |
| 115 | + |
| 116 | +## PHP 8.5 Specifics |
| 117 | + |
| 118 | +Once implemented, this add-on should: |
| 119 | +- Provide PHP 8.5 runtime environment |
| 120 | +- Include common PHP extensions needed for web development |
| 121 | +- Be compatible with various PHP frameworks and CMSs |
| 122 | +- Support both CLI and web server usage |
| 123 | +- Handle version-specific configurations and optimizations |
| 124 | +- Provide proper integration with DDEV's existing PHP infrastructure |
| 125 | + |
| 126 | +## Code Style and Standards |
| 127 | + |
| 128 | +- Follow existing patterns in DDEV add-ons |
| 129 | +- Use descriptive comments in configuration files |
| 130 | +- Maintain backward compatibility when possible |
| 131 | +- Document any breaking changes clearly |
| 132 | +- Follow Docker and YAML best practices |
| 133 | + |
| 134 | +## Troubleshooting Common Issues |
| 135 | + |
| 136 | +- Ensure Docker images are publicly accessible |
| 137 | +- Test add-on with different DDEV versions (stable and HEAD) |
| 138 | +- Validate that all required environment variables are available |
| 139 | +- Check for conflicts with other add-ons |
| 140 | +- Verify proper cleanup on add-on removal |
| 141 | + |
| 142 | +## Release Process |
| 143 | + |
| 144 | +1. Update version constraints in `install.yaml` |
| 145 | +2. Update `README.md` with new features/changes |
| 146 | +3. Create GitHub release with semantic version |
| 147 | +4. Test installation via `ddev add-on get ddev/ddev-php85` |
| 148 | +5. Announce in DDEV community channels |
| 149 | + |
| 150 | +## Related Resources |
| 151 | + |
| 152 | +- [DDEV Documentation](https://ddev.readthedocs.io/) |
| 153 | +- [DDEV Add-on Development Guide](https://ddev.readthedocs.io/en/stable/users/extend/additional-services/) |
| 154 | +- [DDEV Add-on Registry](https://addons.ddev.com/) |
| 155 | +- [Bats Testing Framework](https://bats-core.readthedocs.io/) |
| 156 | +- [PHP 8.5 Release Notes](https://www.php.net/releases/8.5/en.php) |
| 157 | + |
| 158 | +## Contributing Guidelines |
| 159 | + |
| 160 | +When contributing to this repository: |
| 161 | +1. Follow the DDEV add-on conventions and best practices |
| 162 | +2. Test your changes with both local and release installation methods |
| 163 | +3. Update documentation for any new features or configuration options |
| 164 | +4. Ensure compatibility with different operating systems and DDEV versions |
| 165 | +5. Add or update tests for new functionality |
| 166 | +6. Use descriptive commit messages and PR descriptions |
| 167 | + |
| 168 | +## Repository Maintenance |
| 169 | + |
| 170 | +- Monitor for PHP 8.5 updates and security patches |
| 171 | +- Keep base Docker images updated |
| 172 | +- Respond to community issues and pull requests |
| 173 | +- Maintain compatibility with DDEV releases |
| 174 | +- Update documentation as needed |
| 175 | +- Review and merge pull requests promptly |
| 176 | +- Tag releases following semantic versioning |
0 commit comments