Repository navigation
feat: update Pantheon provider to use environment variables, fixes #4760 - #7475
Merged
Merged
Conversation
This modernizes the Pantheon provider integration to match the pattern used by other converted providers (Acquia, Lagoon, Platform.sh, Upsun). Changes made: - Renamed pantheon.yaml.example to pantheon.yaml to match other providers - Replaced hardcoded environment_variables.project with PANTHEON_SITE and PANTHEON_ENVIRONMENT - Updated auth_command to validate required environment variables - Changed all command references from ${project} to ${PANTHEON_SITE}.${PANTHEON_ENVIRONMENT} - Renamed files_pull_command to files_import_command for consistency - Added descriptive output showing which site/environment is being used - Updated provider documentation comments with new configuration approach - Modified tests to use app.WebEnvironment instead of file replacement - Removed old project string replacement logic from tests - Added support for --environment flag usage for temporary overrides The provider now requires users to set: - TERMINUS_MACHINE_TOKEN (global or per-project) - PANTHEON_SITE (project-specific) - PANTHEON_ENVIRONMENT (project-specific) This eliminates the need for users to edit provider files directly, following the modern pattern established by other provider integrations. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Update step 8 in the Pantheon quickstart guide to reflect the new environment variable approach instead of editing provider files directly. Changes: - Replace references to pantheon.yaml.example with pantheon.yaml - Remove instructions for editing environment_variables.project - Add instructions for setting PANTHEON_SITE and PANTHEON_ENVIRONMENT - Include YAML configuration example - Add ddev config --web-environment-add command example - Document temporary --environment flag usage option - Maintain existing site ID explanation and formatting This completes the modernization of the Pantheon provider to match the pattern used by other converted providers. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
…on provider The initial change incorrectly renamed files_pull_command to files_import_command, which caused files to not be imported during `ddev pull pantheon` operations. files_pull_command: Downloads files to .ddev/.downloads/files (required) files_import_command: Optional command for custom import logic The Pantheon provider should use files_pull_command to download and extract files to the standard location where DDEV will automatically import them. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
|
Download the artifacts for this pull request:
See Testing a PR. |
Member
Author
|
I think I have fixed the Pantheon-pull test target with a Drupal 11 site. I'll make sure it works here, I'm hoping it can also work with existing code before this goes in, not sure. |
rfay
marked this pull request as ready for review
July 23, 2025 15:41
stasadev
requested changes
Jul 23, 2025
Comment on lines
26
to
27
| const pantheonPullTestSite = "ddev-test-site-do-not-delete.dev" | ||
| const pantheonPushTestSite = "ddev-pantheon-push.dev" |
Member
There was a problem hiding this comment.
Let's split these in site and environment separately.
At first, it was unclear to me what PANTHEON_ENVIRONMENT is.
Member
There was a problem hiding this comment.
I also noticed that you can run this successfully:
ddev pull pantheon --environment=PANTHEON_SITE=ddev-test-site-do-not-delete.dev,PANTHEON_ENVIRONMENT=junk
But it's not our fault that it doesn't check for exact match. Pantheon thinks that these two are the same:
ddev-test-site-do-not-delete.devddev-test-site-do-not-delete.dev.junk
Member
Author
There was a problem hiding this comment.
Split those as you suggested. Good idea.
Co-authored-by: Stanislav Zhuk <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Issue
The Pantheon provider integration required users to manually edit provider configuration files, which was inconvenient and inconsistent with other more recent providers like Acquia, Lagoon, Platform.sh, and Upsun that use environment variables.
How This PR Solves The Issue
This PR updates the Pantheon provider to use environment variables instead of requiring file editing:
pantheon.yaml.exampletopantheon.yamland removed hardcodedenvironment_variables: project: yourproject.devsectionauth_commandfor requiredPANTHEON_SITEandPANTHEON_ENVIRONMENTvariables${project}to${PANTHEON_SITE}.${PANTHEON_ENVIRONMENT}TestPantheonPullandTestPantheonPushto use environment variable approach instead of file editingdocs/content/users/providers/pantheon.mdwith new configuration methodConfiguration Method Change:
Before (required editing provider file):
After (set in project config):
Manual Testing Instructions
Review https://ddev--7475.org.readthedocs.build/en/7475/users/providers/pantheon/
makeddev config global --web-environment-add="TERMINUS_MACHINE_TOKEN=your_token"ddev pull pantheon- should download database and filesddev push pantheon- should upload database and files (ensure SSH key configured)Automated Testing Overview
Tests now configure environment variables programmatically instead of editing provider files, making them more reliable and consistent with other provider tests.
Release/Deployment Notes
This is a breaking change for users currently using the Pantheon provider if their configured
pantheon.yamlhas#ddev-generatedin it (it shouldn't, but I'll bet lots of people do.)pantheon.yaml.exampleto setting environment variables in their project configurationpantheon.yaml(not.example) (it can be edited, but if edited, it needs to have the #ddev-generated line removed)TODO:
drush rsync#5215🤖 Generated with Claude Code