Skip to content

feat: remove slides.find and sheets.find in favor of drive.search#271

Open
allenhutchison wants to merge 3 commits intomainfrom
issue-268-remove-slides-sheets-find
Open

feat: remove slides.find and sheets.find in favor of drive.search#271
allenhutchison wants to merge 3 commits intomainfrom
issue-268-remove-slides-sheets-find

Conversation

@allenhutchison
Copy link
Contributor

Closes #268

Summary

Remove the redundant find methods from SlidesService and SheetsService, consolidating all file-finding through drive.search. This also drops the Drive API dependency (drive_v3, getDriveClient, buildDriveSearchQuery, MIME_TYPES) from both services entirely.

Changes

Service cleanup

  • Remove slides.find and sheets.find tool registrations from index.ts
  • Remove find methods and Drive API dependencies from SlidesService and SheetsService
  • Remove associated tests and Drive API mocks

Documentation

  • Update WORKSPACE-Context.md with MIME type filter examples for Docs, Sheets, and Slides
  • Fix stale docs.find/docs.move references in Docs skill → now references drive.search/drive.moveFile
  • Create new Sheets skill (skills/sheets/SKILL.md) with drive.search guidance
  • Create new Slides skill (skills/slides/SKILL.md) with drive.search guidance

Migration

Users should use drive.search with MIME type filters instead:

  • Sheets: mimeType='application/vnd.google-apps.spreadsheet' and name contains 'query'
  • Slides: mimeType='application/vnd.google-apps.presentation' and name contains 'query'

Verification

  • All 420 tests pass
  • Build succeeds
  • Net: 138 additions, 293 deletions

Closes #268

Remove the redundant find methods from SlidesService and SheetsService,
consolidating all file-finding through drive.search. This also drops
the Drive API dependency (drive_v3, getDriveClient, buildDriveSearchQuery,
MIME_TYPES) from both services entirely.

Changes:
- Remove slides.find and sheets.find tool registrations from index.ts
- Remove find methods and Drive API deps from SlidesService and SheetsService
- Remove associated tests and Drive API mocks
- Update WORKSPACE-Context.md with MIME type filter examples for all types
- Fix stale docs.find/docs.move references in Docs skill
- Create new Sheets and Slides skills with drive.search guidance
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, 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 streamlines the file-finding capabilities across Google Workspace services by deprecating redundant find methods in SlidesService and SheetsService. The change consolidates all search operations into the more generic and powerful drive.search tool, promoting a unified approach to file discovery. This refactoring also reduces the direct dependency of individual services on the Drive API, leading to a cleaner and more maintainable codebase, while ensuring users are guided to the correct and consistent method for searching documents, spreadsheets, and presentations.

Highlights

  • Consolidated File Search: Removed dedicated slides.find and sheets.find methods, centralizing all Google Workspace file discovery through drive.search.
  • Reduced Service Dependencies: Eliminated direct Google Drive API dependencies (drive_v3, getDriveClient, buildDriveSearchQuery, MIME_TYPES) from SlidesService and SheetsService, simplifying their architecture.
  • Updated Documentation and Skill Guides: Revised WORKSPACE-Context.md and skills/docs/SKILL.md to reflect the new drive.search approach, and introduced new skill documentation for Sheets and Slides (skills/sheets/SKILL.md, skills/slides/SKILL.md) with explicit guidance on using drive.search with MIME type filters.
  • Cleaned Up Test Suite: Removed associated test cases and Drive API mocks related to the deprecated find methods in SheetsService.test.ts and SlidesService.test.ts.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • skills/docs/SKILL.md
    • Updated guidance for finding documents to use drive.search with MIME type filters.
    • Corrected references for moving documents from docs.move to drive.moveFile.
  • skills/sheets/SKILL.md
    • Added new skill documentation for Google Sheets, including instructions for finding spreadsheets using drive.search.
  • skills/slides/SKILL.md
    • Added new skill documentation for Google Slides, providing guidance on finding presentations via drive.search.
  • workspace-server/WORKSPACE-Context.md
    • Expanded examples for finding Google Docs, Sheets, and Slides to explicitly use drive.search with specific MIME type queries.
  • workspace-server/src/tests/services/SheetsService.test.ts
    • Removed the mockDriveAPI declaration and its associated setup.
    • Deleted all test cases related to the sheetsService.find method.
  • workspace-server/src/tests/services/SlidesService.test.ts
    • Removed the mockDriveAPI declaration and its associated setup.
    • Deleted all test cases related to the slidesService.find method.
  • workspace-server/src/index.ts
    • Removed the registration of the slides.find tool from the server.
    • Removed the registration of the sheets.find tool from the server.
  • workspace-server/src/services/SheetsService.ts
    • Removed the import of drive_v3 from googleapis.
    • Deleted the getDriveClient private method.
    • Removed imports for buildDriveSearchQuery and MIME_TYPES.
    • Removed the find public method, which previously handled spreadsheet searches.
  • workspace-server/src/services/SlidesService.ts
    • Removed the import of drive_v3 from googleapis.
    • Deleted the getDriveClient private method.
    • Removed imports for buildDriveSearchQuery and MIME_TYPES.
    • Removed the find public method, which previously handled presentation searches.
Activity
  • All 420 tests passed successfully.
  • The build completed without any issues.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request effectively refactors the file search functionality by removing the specific slides.find and sheets.find methods in favor of the more generic drive.search. The changes are well-executed, including updates to tests and extensive documentation improvements with new skill files for Sheets and Slides. My review includes a couple of suggestions to further improve consistency and code cleanliness.

Remove the Docs/Sheets/Slides section (format selection, content handling)
since these are now covered by individual skills. Replace inline Sheets
nuances with a skill cross-reference, add Slides cross-reference.
### Finding Documents

Use `docs.find` to search by title. Supports pagination with `pageToken`.
Use `drive.search` with a document MIME type filter to find Google Docs:
Copy link
Contributor

Choose a reason for hiding this comment

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

ah didn't realize there are specific skills that need to be updated with #256. Thanks!

Address PR review feedback:
- Remove buildDriveSearchQuery and MIME_TYPES from DriveQueryBuilder.ts
  (no longer used after removing slides.find and sheets.find)
- Keep only escapeQueryString (still used by DriveService)
- Rewrite DriveQueryBuilder tests to cover escapeQueryString only
- Add fullText contains note to Docs skill for consistency
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.

Remove slides.find and sheets.find in favor of drive.search

2 participants