feat(ddev): browser commands read URLs from ddev describe -j - #50
Merged
Conversation
Replaces the DDEV_DEBUG/FULLURL URL transport for the browser-command class (launch, mailpit, phpmyadmin/adminer add-ons, xhgui) with the upstream-recommended scripting interface (ddev/ddev#8771): the URL is read from `ddev describe -j` run as opencode — works for stopped projects too, no debug-log flooding anymore. - launch maps to raw.primary_url with the launch script's argument forms (path, :<port>, full URL, -m), mailpit/xhgui to their fields, add-on commands to raw.services.<name>.https_url - launch-script parity: a stopped project is started first (plain) - commands without a describe URL (built-in phpmyadmin installer prompt, custom commands without a service) plain-run as opencode - sudoers env_keep drops DDEV_DEBUG - unit tests gain functional describe->URL mapping cases; the e2e fake ddev implements the describe contract (incl. the stopped->running start flip); docs/concepts/ddev-integration.md updated Closes our ddev PR #8772 in favor of the existing describe interface.
The browser-command arm (launch/mailpit/phpmyadmin/...) starts a stopped project itself — but the bootstrap and hosts-file hints only hooked direct `ddev start`/`ddev restart` in the ddev() wrapper, so `ddev phpmyadmin` on a stopped project never showed the "opk ddev-hosts-add" bridge for custom-tld domains. Run _opk_bootstrap_hint before and _opk_hosts_hint after the arm's internal start, exactly like a direct start. e2e plants a /mnt/c hosts file + custom-tld fixture to prove the hint fires.
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.
Summary
Replaces the
DDEV_DEBUG/FULLURLURL transport for ddev browser commandswith the upstream-recommended scripting interface:
ddev describe -j(ddev/ddev#8771).
Our ddev PR #8772 (
launch --print-url) becomes obsolete and will be closedin favor of the existing describe interface.
Why
The old transport ran browser commands as
opencodewithDDEV_DEBUG=trueand grepped the
FULLURL <url>lines the launch script prints under debug.That coupled the URL extraction to global debug logging — every internal
ddev starton a stopped project arrived as a wall of timestamped debugoutput before the URL appeared.
ddev describe -jmaintains every URL from the project config — even whilethe project is stopped — with no debug logging at all.
What changes
ddev-as-opencode.sh— the browser-command arm(
launch,mailpit,phpmyadmin,adminer,xhgui, conf-registered)now computes its URL from
ddev describe -jrun asopencode:launch→raw.primary_url, mirroring the launch script's argumentforms (path,
:<port>, full URL,-m/--mailpit,-ppassthrough)mailpit→raw.mailpit_https_url(scheme matched to the primary URL)xhgui→raw.xhgui_https_url(whenxhgui_statusis enabled)raw.services.<name>.https_urlplainly, without debug flooding — including the bootstrap and
hosts-file hints a direct
ddev startprints (so theopk ddev-hosts-addbridge still shows afterddev phpmyadminon astopped project)
prompt, custom commands without a matching service) plain-run as
opencode: output, prompts and exit code pass through; only the browseropen is skipped
sudoers.template—DDEV_DEBUGdropped fromenv_keepdocs/concepts/ddev-integration.mdrewritten for the newtransport
checks, e2e fake ddev implements the describe contract incl. the
stopped→running start flip and a planted
/mnt/chosts-file fixtureproving the hint parity
Testing
make lint,make check-versionmake test— full unit suite greenmake e2e— 243 checks passed (browser arm: URL handover, calleridentity, start parity, hint parity, plain-run fallback, clean stdout)
make e2e-rootless— 42 checks passedAlso bumps VERSION to 0.0.26.