feat(runner): configure emails client before running flows#1382
feat(runner): configure emails client before running flows#1382Chase J (chajac) wants to merge 4 commits into
Conversation
WalkthroughA new Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/commands/flows/configureEmailsForRun.ts`:
- Around line 44-56: The configureEmailsForRun helper only handles the undefined
and !ok paths, so exceptions from resolveApiKey() or getIdentity() can still
abort the run instead of producing a skipped-* result. Update the main flow in
configureEmailsForRun to catch errors around both dependency calls, log a
concise skip message, and return the appropriate skipped outcome (for auth/read
failures and identity/dependency failures) so startup continues gracefully. Use
the existing resolveApiKey and getIdentity symbols to wrap the error-prone calls
without changing the successful path behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 2cae0c84-4c21-4b15-8344-1c2d9c3db709
📒 Files selected for processing (10)
src/commands/context.tssrc/commands/flows/configureEmailsForRun.test.tssrc/commands/flows/configureEmailsForRun.tssrc/commands/flows/hybridRunDefaults.tssrc/commands/flows/runDefaults.tssrc/commands/flows/runWorker.register.tssrc/domains/emails/configureEmails.test.tssrc/domains/emails/configureEmails.tssrc/shell/resolveApiBaseUrl.test.tssrc/shell/resolveApiBaseUrl.ts
Resolves: WIZ-10915
Overview of Changes
Wires the
@qawolf/emailsclient into the flow run path so email-dependent flows (e.g. magic-link / OTP login) work locally. PreviouslyconfigureEmailsexisted but was never called, so any flow callingmail.inbox()failed with "… requires a client. Call configureEmailsClient(...) …".configureEmailsrewritten to configure the client against the authenticated API (base URL + API key + team id), replacing the unused stub.configureEmailsForRunhelper resolves the API key + team id and configures the client once per flow executing process. It is total/graceful: if auth, identity, or the client can't be resolved it returns askipped-*outcome and the run proceeds.--workers 1) and the worker subprocess (--workers >1).resolveApiBaseUrlextracted to a shared helper so the worker (which has noCommandContext) resolves the same base URL as the command context.Testing
resolveApiBaseUrl,configureEmails, andconfigureEmailsForRun.client configures and the OTP email is retrieved successfully for the login
flow.
bun run typecheck bun run lint bun run format:check bun run knip bun run test bun run buildChecklist