Skip to content

feat: support database config key for MySQL version selection - #160

Merged
AaronFeledy merged 11 commits into
mainfrom
feat/database-config
Feb 24, 2026
Merged

AaronFeledy merged 11 commits into
mainfrom
feat/database-config

Conversation

@AaronFeledy

@AaronFeledy AaronFeledy commented Feb 24, 2026 •

Copy link
Copy Markdown
Member

Summary

Allow users to set the database type and version via the recipe-level database config key, matching the behavior of the lando/drupal recipe.

Problem

The database was hardcoded to mysql:5.7 in builders/acquia.js (line 70), ignoring any user-provided database configuration in .lando.yml. The docs already documented database as a config option, but the code didn't respect it.

Changes

  • builders/acquia.js: Added database: 'mysql:8.0' to the default config block. Changed the hardcoded assignment to a conditional default (if (!options.database)), so user config is respected.
  • docs/config.md: Added a "Choosing a database version" section documenting the config key with examples.

Usage

recipe: acquia
config:
  database: mysql:5.7

Or for MySQL 8:

recipe: acquia
config:
  database: mysql:8.0

Closes #138


Note

Low Risk
Small configuration/defaulting change plus documentation/test updates; risk is limited to how the database service version is selected during app startup.

Overview
The Acquia recipe now respects the user-provided config.database value instead of overwriting it during builder initialization, with mysql:5.7 defined as the default in the recipe config.

Docs and examples were updated to describe selecting a MySQL version via database, the custom example now pins mysql:8.0, and a small test was added to assert the default database value. The changelog records the fix.

Written by Cursor Bugbot for commit 25843fd. This will update automatically on new commits. Configure here.

Allow users to set the database type and version via the recipe-level
`database` config key (e.g., `database: mysql:8.0`), matching the
behavior of the drupal recipe. Previously the database was hardcoded
to mysql:5.7, ignoring user configuration.

Default changed to mysql:8.0 to match Acquia Cloud's current standard.

Closes #138
@netlify

netlify Bot commented Feb 24, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for lando-acquia ready!

Name Link
🔨 Latest commit 25843fd
🔍 Latest deploy log https://app.netlify.com/projects/lando-acquia/deploys/699d24b30d72500008a5f489
😎 Deploy Preview https://deploy-preview-160--lando-acquia.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 86 (🔴 down 5 from production)
Accessibility: 98 (no change from production)
Best Practices: 100 (no change from production)
SEO: 92 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

- Add acquia-mysql8 example (explicit mysql:8.0 config)
- Add acquia-mysql57 example (override default to mysql:5.7)
- Add database-config.spec.js unit test verifying default config
Reverts the default back to mysql:5.7. Changing it to 8.0 would
silently upgrade existing users' databases on rebuild. Users who
want MySQL 8 can opt in via the database config key.

Also fixes docs which incorrectly claimed mysql:8.0 as default.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is ON. A Cloud Agent has been kicked off to fix the reported issue.

Comment thread builders/acquia.js Resolved
@cursor

cursor Bot commented Feb 24, 2026

Copy link
Copy Markdown

Bugbot Autofix prepared fixes for 1 of the 1 bugs found in the latest run.

  • ✅ Fixed: Constructor fallback is dead code with wrong version
    • Removed the dead code line 70 that checked !options.database since the config defaults always populate this value with 'mysql:5.7' after the merge operation.

View PR

Or push these changes by commenting:

@cursor push 081f41929c
Preview (081f41929c)
diff --git a/builders/acquia.js b/builders/acquia.js
--- a/builders/acquia.js
+++ b/builders/acquia.js
@@ -66,8 +66,7 @@
      */
     constructor(id, options = {}) {
       options = _.merge({}, config, options);
-      // Set default database if not specified, and standard Acquia webroot and env file
-      if (!options.database) options.database = 'mysql:8.0';
+      // Set standard Acquia webroot and env file
       options.env_file = ['.env'];
       options.webroot = 'docroot';

Use the standard leia pattern with startup, verification, and destroy
sections containing bash test cases named by comments.
…lone examples

acquia-default already tests the mysql:5.7 default. acquia-custom now
sets database: mysql:8.0 and verifies it, covering the override case.
Removed the standalone acquia-mysql8 and acquia-mysql57 examples.
The _.merge() on line 68 already populates options.database from the
config defaults, so the if (!options.database) guard was dead code.
The default is set in the config block; no runtime fallback needed.

Addresses Bugbot review feedback.
The checklinks plugin fails on the double-301 redirect from
docs.lando.dev/plugins/mysql/ → netlify → /index.html
Added a fix for the issue with the `database` config key being disregarded in the unreleased version.
@AaronFeledy
AaronFeledy merged commit 0864d4b into main Feb 24, 2026
32 checks passed
@AaronFeledy
AaronFeledy deleted the feat/database-config branch February 24, 2026 04:10
@cursor cursor Bot mentioned this pull request Feb 24, 2026
9 tasks
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

Successfully merging this pull request may close these issues.

MySQL 8 Support

1 participant