-
Notifications
You must be signed in to change notification settings - Fork 15
#263: Refactor Tugboat integration #1073
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
Conversation
Summary of ChangesHello @rabbitlair, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly refactors the Tugboat integration within the project. The primary goal is to centralize configuration management by using DDEV settings as the authoritative source for all service definitions. This is achieved through a new dedicated Composer plugin that dynamically generates the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This is a great refactoring of the Tugboat integration. Moving the logic to a dedicated plugin and adopting a template-based approach significantly improves maintainability and extensibility. The new TugboatConfigPlugin is well-structured. However, I've identified several critical regressions where conditional logic from the old shell scripts was lost in the new Twig templates, potentially breaking functionality for some project configurations (e.g., non-MariaDB databases, Memcached, Apache, Pantheon). I've also included some suggestions to improve code clarity and fix a bug in the new plugin. After addressing these points, this will be a very solid contribution.
deviantintegral
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A nice first pass!
| - `php-init.yml.twig` - Init phase commands | ||
| - `php-update.yml.twig` - Update phase commands | ||
| - `php-build.yml.twig` - Build phase commands | ||
| - `config.yml.twig` - Complete Tugboat configuration (advanced) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏
|
After testing this branch with another real world project that has a complex Tugboat integration, I added the following changes:
|
|
I'll be merging this one to |
|
@YesCT, when you have a chance, please, can you approve this one if you are fine with all changes? I can not merge it until you confirm your requested changes are implemented. Thank you! |
|
I resolved my remaining comments and approved. (I did not look at the changes pushed since my last review.) I'm ok with that. If there are bugs, we can fix them up. Since Zequi said he was gonna merge, I went ahead and merged while there were no conflicts or failing tests, etc. |
Closes #263
Warning: Contains a breaking change, so it requires, at least, a minor version bump.
This PR refactors the Tugboat integration to use DDEV configuration as the single source of truth for all service definitions. The new implementation generates a complete
config.ymlusing Twig templates instead of separate bash scripts.Architecture
TugboatConfigPluginhandles all Tugboat logic (previously inScaffoldInstallerPlugin)config.ymlfile with sub-templates for each build phase in main PHP service.ddev/config.yamland docker-compose add-on filesBuild Phase Templates
config.yml.twig- Main configuration template that includes phase templatesphp-init.yml.twig- System packages, PHP extensions, Node.js installation, composer installphp-update.yml.twig- Composer install, sync task, file permissions changes, update tasksphp-build.yml.twig- Build tasksTaskfile Integration
tugboat:{service}:inittasks (e.g.,tugboat:redis:init)sync:tugboat,update:tugboat,build:tugboat,online:tugboattaskscustom-init-command.shwrapper for non-PHP service init tasks.taskfilefileTemplate Customization
vendor/lullabot/drainpipe/scaffold/tugboat/templates/.tugboat/drainpipe-templates/indentfilter for proper YAML formattingFiles Structure
Please, note this is a first working version. I would like to know your thoughts about the new approach - any feedback will be more than welcome. As far as I can tell, this refactor does not break backwards compatibility while adding the custom templates feature, which I think will make easier for users to customize their Tugboat integration.
Testing Instructions
First, create a new Drupal project and configure Drainpipe with Tugboat integration.
Verify the generated
.tugboat/config.ymlfile is correct, and the services declared match the DDEV settings.Test scenarios
Then verify the new command is included in
.tugboat/config.yml.initcommand for a secondary service:Then verify the new command is included in
.tugboat/config.yml.Then verify Pantheon integration is included in
.tugboat/config.yml.More testing
Tested in a project currently using Drainpipe, so we can be confident about nothing breaking. Tested on lullabotdotcom.