feat(job): add --gui/--nogui flag, default headless

The Phase-2 VM start was hardcoded to headless. Expose a --gui/--nogui
toggle (default --nogui, preserving current behaviour); --gui starts the
clone with the Workstation GUI window (needs an X display, see §4.7). The
phase banner now reflects the chosen mode.
This commit is contained in:
2026-06-08 21:45:49 +02:00
parent cfce307c5b
commit b317a8bf4c
2 changed files with 15 additions and 3 deletions
+3 -1
View File
@@ -201,7 +201,9 @@ default `--snapshot-name` is `BaseClean`, so Linux jobs must pass
`--skip-artifact`, `--xvfb` (Linux GUI builds), `--skip-artifact`, `--xvfb` (Linux GUI builds),
`--extra-env-json '{"KEY":"VALUE"}'` `--extra-env-json '{"KEY":"VALUE"}'`
- **VM**: `--guest-cpu N`, `--guest-memory-mb N`, `--template-path`, - **VM**: `--guest-cpu N`, `--guest-memory-mb N`, `--template-path`,
`--snapshot-name`, `--ready-timeout` `--snapshot-name`, `--ready-timeout`, `--gui` / `--nogui` (default `--nogui`,
headless; `--gui` opens the Workstation window and needs an X display —
see [§4.7](#47-open-a-vm-in-the-workstation-gui))
- **Auth**: `--gitea-credential-target` (private repos) - **Auth**: `--gitea-credential-target` (private repos)
> For a zero-config end-to-end check, prefer `smoke run` ([§7](#7-phase-c-testing)) > For a zero-config end-to-end check, prefer `smoke run` ([§7](#7-phase-c-testing))
+12 -2
View File
@@ -390,6 +390,14 @@ def _destroy_clone(
show_default=True, show_default=True,
) )
@click.option("--vmrun-path", "vmrun_path", default=None) @click.option("--vmrun-path", "vmrun_path", default=None)
@click.option(
"--gui/--nogui",
"gui",
default=False,
show_default=True,
help="Start the VM with the Workstation GUI window (--gui) or headless "
"(--nogui, the default).",
)
def job( def job(
job_id: str, job_id: str,
repo_url: str, repo_url: str,
@@ -419,6 +427,7 @@ def job(
ready_timeout: float, ready_timeout: float,
poll_interval: float, poll_interval: float,
vmrun_path: str | None, vmrun_path: str | None,
gui: bool,
) -> None: ) -> None:
"""Run the full CI pipeline against an ephemeral build VM. """Run the full CI pipeline against an ephemeral build VM.
@@ -547,9 +556,10 @@ def job(
phase_start = _now() phase_start = _now()
# ── Phase 2/5: start VM ───────────────────────────────────────── # ── Phase 2/5: start VM ─────────────────────────────────────────
click.echo("\n[job] Phase 2/5 — starting VM (headless)") mode = "GUI" if gui else "headless"
click.echo(f"\n[job] Phase 2/5 — starting VM ({mode})")
try: try:
backend.start(handle, headless=True) backend.start(handle, headless=not gui)
except BackendError as exc: except BackendError as exc:
raise click.ClickException(f"vmrun start failed: {exc}") from exc raise click.ClickException(f"vmrun start failed: {exc}") from exc