Skip to content

hotfix(runner): default --env-id to QAWOLF_ENVIRONMENT - #1532

Merged
Atchyut Preetham Pulavarthi (theonly1me) merged 1 commit into
mainfrom
hotfix/nova-1676-fix-cli-deafult-env
Aug 28, 2026
Merged

hotfix(runner): default --env-id to QAWOLF_ENVIRONMENT#1532
Atchyut Preetham Pulavarthi (theonly1me) merged 1 commit into
mainfrom
hotfix/nova-1676-fix-cli-deafult-env

Conversation

@theonly1me

@theonly1me Atchyut Preetham Pulavarthi (theonly1me) commented Aug 28, 2026

Copy link
Copy Markdown
Member

Overview of Changes

A qawolf runner run that names no environment gets none. Anyone who already exports QAWOLF_ENVIRONMENT, the variable qawolf flows reads and the documented way to set a default, has to repeat it as --env-id on every run. In CI that is easy to miss, and the run executes against no environment rather than failing.

qawolf runner run now falls back to QAWOLF_ENVIRONMENT when neither --env-id nor --env-file is passed, so one export covers both commands.

  • --env-id wins over it, and --env-file suppresses it, so a run reading a dotenv file is not handed a second environment on top. A blank or unset variable counts as absent rather than being sent as an empty id the server would reject.
  • The run reports on stderr which environment it picked up, reusing the usingFromEnvVar message qawolf flows already prints. It fires only for the fallback, never for an explicit flag. Those variables reach your flow's code, so a run should not be given an environment silently.
  • Both existing refusals are unchanged and still land before a runner is resolved: --env-id together with --env-file, and a blank --env-id.

This reverses a deliberate choice from #1530, which made --env-id explicit-only. That was right when runner run had no environment concept. Now that it has one, matching qawolf flows is the less surprising behaviour.

Behaviour change on upgrade: a run with no env flags, in a shell exporting QAWOLF_ENVIRONMENT, now sends that environment where 1.17.0 sent none.

Testing

bun run typecheck
bun run lint
bun run format:check
bun run knip
bun run test

1856 tests pass. Four new cases in runFlow.environment.test.ts: the fallback applies and announces, --env-id beats the variable, --env-file suppresses it, and a blank variable is ignored. makeTestDeps already defaulted env: {}, so no existing test picks the variable up by accident.

The fallback case was checked against a revert rather than trusted because it passed: replacing the resolution with const environmentId = explicitEnvId makes that test fail, and restoring it makes it pass again. The other three pass either way by design, pinning the boundaries rather than the new behaviour.

Checklist

  • Changes follow the code style of this project
  • Self-review completed
  • Tests added/updated (or not applicable)
  • No breaking changes (or described below)

@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 631735b0-9b05-4b59-b00c-1340e4eece32

📥 Commits

Reviewing files that changed from the base of the PR and between 9d45bb9 and ff34821.

⛔ Files ignored due to path filters (1)
  • src/commands/__snapshots__/help.test.ts.snap is excluded by !**/*.snap
📒 Files selected for processing (9)
  • .changeset/runner-run-default-env.md
  • skills/qawolf-cli/SKILL.md
  • skills/qawolf-cli/references/runner.md
  • src/commands/qawolfCliSkill.template.md
  • src/commands/runner/run.register.ts
  • src/domains/interactiveRunner/deps.testUtils.ts
  • src/domains/interactiveRunner/prepareRun.ts
  • src/domains/interactiveRunner/runFlow.environment.test.ts
  • src/domains/interactiveRunner/runFlow.ts

Walkthrough

qawolf runner run now uses the trimmed QAWOLF_ENVIRONMENT value when neither --env-id nor --env-file is provided. Explicit --env-id takes precedence, and --env-file suppresses the fallback. Blank values are ignored. Variable-based environment selection is reported through an informational message. Tests cover the selection rules, and CLI documentation and release metadata describe the behavior.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant RunnerCLI
  participant handleRunnerRun
  participant prepareRun
  participant ProcessEnv
  participant AuthContext
  RunnerCLI->>handleRunnerRun: start runner run
  handleRunnerRun->>prepareRun: prepare environment
  prepareRun->>ProcessEnv: read QAWOLF_ENVIRONMENT
  ProcessEnv-->>prepareRun: environment value
  prepareRun-->>handleRunnerRun: resolved environment ID
  handleRunnerRun->>AuthContext: report selected environment
  AuthContext-->>RunnerCLI: emit informational message
Loading

Suggested reviewers: gorangajic

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch hotfix/nova-1676-fix-cli-deafult-env

Comment @coderabbitai help to get the list of available commands.

@theonly1me
Atchyut Preetham Pulavarthi (theonly1me) marked this pull request as ready for review August 28, 2026 16:14
@theonly1me Atchyut Preetham Pulavarthi (theonly1me) changed the title fix(runner): default --env-id to QAWOLF_ENVIRONMENT hotfix(runner): default --env-id to QAWOLF_ENVIRONMENT Aug 28, 2026
@theonly1me Atchyut Preetham Pulavarthi (theonly1me) changed the title hotfix(runner): default --env-id to QAWOLF_ENVIRONMENT hotfix(runner): default --env-id to QAWOLF_ENVIRONMENT Aug 28, 2026
@theonly1me
Atchyut Preetham Pulavarthi (theonly1me) merged commit 8d48a2e into main Aug 28, 2026
6 of 7 checks passed
@theonly1me
Atchyut Preetham Pulavarthi (theonly1me) deleted the hotfix/nova-1676-fix-cli-deafult-env branch August 28, 2026 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants