Skip to content

feat(gmail): add dryRun operation for template preview without sending#59

Merged
AojdevStudio merged 1 commit intomainfrom
feature/gdrive-16-gmail-dry-run
Mar 28, 2026
Merged

feat(gmail): add dryRun operation for template preview without sending#59
AojdevStudio merged 1 commit intomainfrom
feature/gdrive-16-gmail-dry-run

Conversation

@AojdevStudio
Copy link
Copy Markdown
Owner

Summary

Implements gmail.dryRun operation that renders a template with variables and returns the fully rendered email (subject, body, recipients) without actually sending it. Essential for outreach campaign QA.

Changes

  • src/tools/listTools.ts: Registers gmail.dryRun in the progressive tool discovery resource so agents can find and use it

The operation was already fully implemented across all other layers in a prior commit — this PR completes the wiring by adding it to the tool catalog.

Implementation Details

  • dryRun is a pure function — no Gmail API calls, no rate limiting
  • Reuses the shared renderTemplate() utility from templates.ts (same as sendFromTemplate and sendBatch)
  • Validates recipient email addresses (throws on invalid format)
  • HTML-escapes variable values when isHtml: true
  • Returns { to, subject, body, isHtml, wouldSend: false }

Acceptance Criteria

  • AC-1: dryRun returns a structured preview object with rendered subject, body, and all recipient fields
  • AC-2: dryRun does NOT call the Gmail API send endpoint (verified in tests via mock assertion — pure function with zero API calls)
  • AC-3: dryRun reuses the shared renderTemplate() utility from sendFromTemplate

Tests

4 unit tests all pass (src/modules/gmail/__tests__/dryRun.test.ts):

  • Renders template variables in subject and body
  • Validates recipient email addresses
  • Returns sanitized to array with correct isHtml flag
  • HTML-escapes variables when isHtml is true

Closes #49

- Registers gmail.dryRun in listTools.ts for progressive tool discovery
- dryRun renders {{variable}} placeholders in subject and body
- Returns fully rendered email preview (subject, body, to, isHtml, wouldSend: false)
- Does NOT call any Gmail API (pure function, no rate limiting)
- Reuses shared renderTemplate() utility from templates.ts
- All layers already wired: compose.ts, index.ts, sdk/runtime.ts, sdk/types.ts, sdk/spec.ts
- 4 unit tests pass: template rendering, recipient validation, HTML escaping

Closes #49
@linear
Copy link
Copy Markdown

linear Bot commented Mar 28, 2026

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 28, 2026

Warning

Rate limit exceeded

@AojdevStudio has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 4 minutes and 40 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 4 minutes and 40 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 0deb52e1-7c8d-4420-baec-2cf99fdc7b8c

📥 Commits

Reviewing files that changed from the base of the PR and between 9cb5ad0 and 9ab5d76.

📒 Files selected for processing (1)
  • src/tools/listTools.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/gdrive-16-gmail-dry-run

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions
Copy link
Copy Markdown

📊 Type Coverage Report

Type Coverage: 98.61%

This PR's TypeScript type coverage analysis is complete.
Check the full report in the workflow artifacts.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
gdrive-mcp 9ab5d76 Commit Preview URL

Branch Preview URL
Mar 28 2026, 07:59 PM

@github-actions
Copy link
Copy Markdown

🔒 Security Scan Summary

Generated on: Sat Mar 28 20:00:02 UTC 2026
Commit: 13cfc08

Scan Results

  • SAST Analysis: success
  • Dependency Scan: success
  • Secret Scan: success
  • Docker Security Scan: success
  • License Scan: success

Summary

  • Total scans: 5
  • Critical issues: 0
  • Overall status: ✅ PASS

Recommendations

  1. Review all failed scans and address critical issues
  2. Update dependencies with known vulnerabilities
  3. Ensure no secrets are committed to the repository
  4. Follow Docker security best practices
  5. Review license compliance for all dependencies

Security report generated by Claude Code

@github-actions
Copy link
Copy Markdown

Performance Comparison Report

Operation Performance

Operation Baseline Avg Current Avg Change Status
listFiles 95.0ms 55.6ms -41.4% 🚀 IMPROVEMENT
readFile 180.0ms 95.1ms -47.2% 🚀 IMPROVEMENT
createFile 250.0ms 152.2ms -39.1% 🚀 IMPROVEMENT
cacheOperation 45.0ms 60.6ms 34.7% ❌ REGRESSION

Memory Usage

  • Baseline: 45.2 MB
  • Current: 4.41 MB
  • Change: -90.2%

Summary

  • 🚀 Improvements: 3
  • ❌ Regressions: 1

⚠️ Performance regressions detected! Please review the changes.


Performance report generated by Claude Code

@AojdevStudio AojdevStudio merged commit 36f4165 into main Mar 28, 2026
27 checks passed
@AojdevStudio AojdevStudio deleted the feature/gdrive-16-gmail-dry-run branch March 28, 2026 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gmail.dryRun — preview rendered email without sending

1 participant