fix: replace nonexistent Forms API list method with Drive files list#758
fix: replace nonexistent Forms API list method with Drive files list#758xiaolai wants to merge 1 commit intogoogleworkspace:mainfrom
Conversation
The Google Forms API v1 does not expose a list method on the forms resource. The recipe step `gws forms forms list` will always fail. Replace it with a Drive files list query filtered by the Forms MIME type, and add gws-drive as a prerequisite skill in both the frontmatter and the PREREQUISITE line. Co-Authored-By: Claude Code <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: b645741 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves a functional error in the 'recipe-collect-form-responses' skill where an invalid API call was being used to list forms. By switching to the Drive API, the recipe now correctly enables users to discover their form IDs, ensuring the subsequent steps in the workflow can execute successfully. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request updates the recipe-collect-form-responses skill to use the Google Drive API for listing forms, as the Forms API lacks a list method. The changes include updating the skill metadata, prerequisites, and the command-line instructions in the documentation. A review comment correctly identified that the Drive API query syntax requires single quotes for string literals and suggested filtering out trashed files to avoid potential errors and improve the clarity of the results.
| ## Steps | ||
|
|
||
| 1. List forms: `gws forms forms list` (if you don't have the form ID) | ||
| 1. Find your form ID: `gws drive files list --params '{"q": "mimeType = \"application/vnd.google-apps.form\""}' --format table` |
There was a problem hiding this comment.
The Google Drive API query syntax requires single quotes for string literals (e.g., mimeType = '...'). Using escaped double quotes (\") inside the query string will likely cause the API to return a 400 "Invalid query" error. Additionally, it is recommended to include trashed = false in the query to avoid listing deleted forms, which can be confusing for users.
| 1. Find your form ID: `gws drive files list --params '{"q": "mimeType = \"application/vnd.google-apps.form\""}' --format table` | |
| 1. Find your form ID: gws drive files list --params "{\"q\": \"mimeType = 'application/vnd.google-apps.form' and trashed = false\"}" --format table |
The
recipe-collect-form-responsesskill referencesgws forms forms listin step 1. The Google Forms API v1 does not have alistmethod on theformsresource — it only supportsget,create,patch,batchUpdate, andresponses.list. Calling this command will always return an API error, making it impossible for users to discover their form IDs through the recipe.The fix replaces step 1 with a Drive API files list query filtered to
application/vnd.google-apps.formMIME type, which correctly enumerates all Google Forms in the user's Drive. Since this now depends on the Drive API,gws-driveis added as a prerequisite skill in both the YAML frontmatterskills:list and thePREREQUISITEline in the body.