Skip to content

refactor(workflows): testable runApprovalTextCommand (proves #2 resolve+resume)#458

Merged
webdevtodayjason merged 1 commit into
devfrom
fix/approval-text-command-testable
Jun 16, 2026
Merged

refactor(workflows): testable runApprovalTextCommand (proves #2 resolve+resume)#458
webdevtodayjason merged 1 commit into
devfrom
fix/approval-text-command-testable

Conversation

@webdevtodayjason

Copy link
Copy Markdown
Contributor

Follow-up to #457. Makes Bug #2's acceptance (text reply "approve" resolves + resumes) observable in tests — the orchestration was inline in bot-handlers.ts and untestable without the full bot.

Change

Extract runApprovalTextCommand (list pending → select → resolve → resume → reply) into workflow-approvals.ts with injected deps. bot-handlers.ts becomes a thin caller that sends result.reply. Behavior-preserving — same reply strings, same resolveDurableWorkflowApprovalById + resumeWorkflowRunAfterApproval calls.

Tests (observable #2 proof)

6 orchestration cases: approve → resolveById(approved=true) + resume; deny symmetric (approved=false); in-memory pending → in-memory resolve, no durable resume; multiple → lists, resolves nothing; zero → no-op; already-resolved between list+update → "gone". Plus the existing 7 selector cases. 437 telegram+approvals tests green; tsgo 189 (unchanged); oxfmt clean.

🤖 Generated with Claude Code

…lve+resume

The Telegram text-approval orchestration (list pending → select → resolve →
resume → reply) was inline in bot-handlers.ts, untestable without standing up
the bot. Extract it into runApprovalTextCommand with injected deps so the
resolve+resume wiring is observable in unit tests; bot-handlers becomes a thin
caller that sends result.reply. Behavior-preserving (same reply strings, same
resolveDurableWorkflowApprovalById + resumeWorkflowRunAfterApproval calls).

Adds 6 orchestration tests: approve→status=approved+resume, deny symmetric,
in-memory→no durable resume, multi→lists, zero→no-op, already-resolved→gone.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: c9cdabb3-5ba3-481a-a188-1a8f237e260b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/approval-text-command-testable

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

@webdevtodayjason
webdevtodayjason merged commit f8efde9 into dev Jun 16, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant