ddev: support passing env vars to ddev env agent#24289
Draft
vitkyrka wants to merge 1 commit into
Draft
Conversation
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
3 tasks
and a new --env option on ddev env agent check to set an environment variable scoped to a single agent check invocation (via docker exec -e) rather than the whole Agent container. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
8d60800 to
b585bc6
Compare
Contributor
Validation ReportAll 21 validations passed. Show details
|
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.

What does this PR do?
Adds a
--env KEY=VALUEoption toddev env agent(repeatable) that sets environment variables for a single Agent invocation only, without affecting the container's persistent environment. This threads throughAgentInterface.invoke()/run_command(), which now accept an optionalenv_varsmapping.For the Docker backend, the variables are passed via
docker exec -e KEY=VALUE .... The Vagrant backend does not support per-invocation env vars and raisesNotImplementedErrorif any are supplied.Motivation
This is needed for process autodiscovery support (see the
vitkyrka/disco-config-processstack, PR #24238). That work reuses the existing container-based E2E setup for process-autodiscovery testing by hiding the containers from the Agent viaDD_AUTOCONFIG_EXCLUDE_FEATURES=docker, which needs to be set only for theagent checkinvocation used to trigger discovery, not for the container as a whole.Review checklist (to be filled by reviewers)
qa/requiredif this PR needs QA validation, orqa/skip-qaif it does not. Exactly one of the two is required.backport/<branch-name>label to the PR and it will automatically open a backport PR once this one is merged