Skip to content

fix(forms): align addQuestion spec with handler — flat args + correct type names#56

Open
AojdevStudio wants to merge 2 commits intomainfrom
fix/forms-addquestion-spec-mismatch
Open

fix(forms): align addQuestion spec with handler — flat args + correct type names#56
AojdevStudio wants to merge 2 commits intomainfrom
fix/forms-addquestion-spec-mismatch

Conversation

@AojdevStudio
Copy link
Copy Markdown
Owner

@AojdevStudio AojdevStudio commented Mar 28, 2026

Bug Fixes

Bug 1 — Arg shape mismatch (type: undefined)

  • Spec advertised nested { formId, question: { title, type } } but both handlers (SDK module + MCP tool) expect flat { formId, title, type, required, ... }
  • Fixed spec to advertise flat args matching the handler's AddQuestionOptions interface

Bug 2 — Type name mismatch

Spec (before) Handler expects (correct)
SHORT_ANSWER TEXT
PARAGRAPH PARAGRAPH_TEXT
SCALE LINEAR_SCALE

Fixed spec to use correct type names.

Also fixed: listTools.ts used questionType (wrong param name) and SCALE (wrong type).

Also added: Linear team ID to CLAUDE.md.

Verification

  • TypeScript type-check: clean
  • All 12 addQuestion tests: passing

Summary by CodeRabbit

  • New Features

    • Reworked form question creation API to accept flat question fields and return a simplified response; improved type safety and flexibility for question configuration
    • Expanded question types (including LINEAR_SCALE) and added optional params: required flag, choices list, and linear-scale min/max with custom labels
  • Documentation

    • Added Linear integration metadata noting team name and issue prefix
  • Chores

    • Adjusted TypeScript compiler settings to suppress deprecation diagnostics

… type names

Bug 1: Spec advertised nested { formId, question: { title, type } } but handler
expects flat { formId, title, type, required, ... }. Fixed spec to match handler.

Bug 2: Spec used SHORT_ANSWER/PARAGRAPH/SCALE but handler expects
TEXT/PARAGRAPH_TEXT/LINEAR_SCALE. Fixed spec to use correct type names.

Also fixed listTools.ts which used 'questionType' (wrong param name) and 'SCALE'.

Added Linear team ID to CLAUDE.md for future reference.
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 28, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6e1e621a-0169-4696-a2f7-3c68ead20440

📥 Commits

Reviewing files that changed from the base of the PR and between 3fd3d38 and 263c6c2.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • src/tools/listTools.ts
  • tsconfig.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/tools/listTools.ts

📝 Walkthrough

Walkthrough

Replaces sdk.forms.addQuestion to accept flattened question fields (title, type, optional required, options, linear-scale params) and return { formId, title, type, message }. Mirrors this change in tool metadata and adds Linear integration metadata in CLAUDE.md. Also adjusts tsconfig.json compiler ignoreDeprecations.

Changes

Cohort / File(s) Summary
Linear Integration Metadata
CLAUDE.md
Added Linear team metadata: team name "Google Drive", Linear team ID, and issue prefix GDRIVE-.
SDK Specification
src/sdk/spec.ts
Changed forms.addQuestion signature from a nested question: QuestionSpec to flattened params (title, type, optional required, options, scaleMin, scaleMax, scaleMinLabel, scaleMaxLabel) and updated return shape to { formId, title, type, message }; updated examples and docs.
Tool Metadata
src/tools/listTools.ts
Updated forms.addQuestion tool metadata to use type: QuestionType, listed supported question variants, added optional linear-scale and options params, and updated example payload. Also removed final newline at EOF.
TypeScript config
tsconfig.json
Set compilerOptions.ignoreDeprecations to "5.0" (suppresses deprecation diagnostics per setting); EOF newline removed.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 Hopped a change into the code tonight,
Questions flattened, fields in sight,
Scales and choices, tidy and bright,
Docs updated, metadata right —
I nibble bugs and bound with delight. 🥕✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and specifically describes the main change: aligning the addQuestion spec with the handler by flattening arguments and correcting type names, which is the primary objective of this PR.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/forms-addquestion-spec-mismatch
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch fix/forms-addquestion-spec-mismatch

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

cloudflare-workers-and-pages bot commented Mar 28, 2026

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 263c6c2 Commit Preview URL

Branch Preview URL
Mar 29 2026, 12:49 AM

@github-actions
Copy link
Copy Markdown

🔒 Security Scan Summary

Generated on: Sat Mar 28 19:05:50 UTC 2026
Commit: ae75455

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

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/tools/listTools.ts`:
- Around line 141-144: The addQuestion tool signature string is missing the
optional scaleMinLabel?: string and scaleMaxLabel?: string parameters; update
the signature for the addQuestion entry (the string value for "signature" in the
addQuestion tool) to include scaleMinLabel?: string and scaleMaxLabel?: string
(e.g., after scaleMin?: number, scaleMax?: number) so it matches the
AddQuestionOptions interface and the documented spec.
🪄 Autofix (Beta)

✅ Autofix completed


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2f760c57-25e0-49fc-8a3b-1078282b499b

📥 Commits

Reviewing files that changed from the base of the PR and between c4be21f and 3fd3d38.

📒 Files selected for processing (3)
  • CLAUDE.md
  • src/sdk/spec.ts
  • src/tools/listTools.ts

@github-actions
Copy link
Copy Markdown

Performance Comparison Report

Operation Performance

Operation Baseline Avg Current Avg Change Status
listFiles 95.0ms 50.1ms -47.3% 🚀 IMPROVEMENT
readFile 180.0ms 97.2ms -46.0% 🚀 IMPROVEMENT
createFile 250.0ms 148.1ms -40.8% 🚀 IMPROVEMENT
cacheOperation 45.0ms 48.0ms 6.7% ✅ OK

Memory Usage

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

Summary

  • 🚀 Improvements: 3
  • ❌ Regressions: 0

Performance report generated by Claude Code

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 29, 2026

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

Fixes Applied Successfully

Fixed 3 file(s) based on 1 unresolved review comment.

Files modified:

  • package-lock.json
  • src/tools/listTools.ts
  • tsconfig.json

Commit: 263c6c24d37f7ae7146506577932d36ff0f12d4b

The changes have been pushed to the fix/forms-addquestion-spec-mismatch branch.

Time taken: 8m 39s

Fixed 3 file(s) based on 1 unresolved review comment.

Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
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.

1 participant