Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google FS API New #234

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft

Google FS API New #234

wants to merge 8 commits into from

Conversation

pellicceama
Copy link
Collaborator

@pellicceama pellicceama commented Jan 22, 2025

Important

Introduces Google File Storage API integration with listing, downloading, and exporting capabilities, enhances SharePoint adapter, and adds comprehensive tests.

  • Google File Storage API Integration:
    • Adds googleAdapter in google-adapter/index.ts for listing, downloading, and exporting files.
    • Implements downloadFileById for Google Drive in google-adapter/index.ts.
    • Adds mappers for Google Drive entities in google-adapter/mapper.ts.
  • SharePoint Adapter Enhancements:
    • Updates sharepoint-adapter/index.ts to improve file retrieval and downloading.
    • Implements downloadFileById for SharePoint in sharepoint-adapter/index.ts.
    • Updates mappers for SharePoint entities in sharepoint-adapter/mappers.ts.
  • Router and API Changes:
    • Updates fileStorageRouter in router.ts to include new endpoints for Google and SharePoint.
    • Modifies createRouterHandler.ts to handle new API routes.
    • Updates proxyHandler.ts to support new proxy logic.
  • Testing:
    • Adds comprehensive tests in router.spec.ts for Google and SharePoint functionalities.
  • Miscellaneous:
    • Updates dependencies in package.json files for new SDKs and tools.

This description was created by Ellipsis for bb215af. It will automatically update as commits are pushed.

… API

	modified:   apps/web/app/api/debug/route.ts
	modified:   connectors/connector-google/server.ts
	modified:   kits/sdk/openapi.json
	modified:   kits/sdk/openapi.types.d.ts
	modified:   packages/api/createRouterHandler.ts
	modified:   packages/api/package.json
	modified:   packages/api/proxyHandler.ts
	modified:   packages/engine-backend/context.ts
	modified:   packages/trpc/package.json
	modified:   pnpm-lock.yaml
	modified:   unified/unified-file-storage/adapters/index.ts
	modified:   unified/unified-file-storage/adapters/sharepoint-adapter/index.ts
	modified:   unified/unified-file-storage/adapters/sharepoint-adapter/mappers.ts
	new file:   unified/unified-file-storage/generate.cjs
	modified:   unified/unified-file-storage/package.json
	modified:   unified/unified-file-storage/router.spec.ts
	modified:   unified/unified-file-storage/router.ts
	modified:   unified/unified-file-storage/unifiedModels.ts
Copy link

vercel bot commented Jan 22, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
openint ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 22, 2025 4:50am

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Reviewed everything up to bb215af in 2 minutes and 30 seconds

More details
  • Looked at 2125 lines of code in 23 files
  • Skipped 1 files when reviewing.
  • Skipped posting 4 drafted comments based on config settings.
1. unified/unified-file-storage/adapters/google-adapter/index.ts:91
  • Draft comment:
    The listDriveGroups function is returning an empty list of items. It should map the response data to the unified DriveGroup model using the mappers, similar to how it's done in listFiles.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable:
    The fact that listDrives also returns an empty list suggests this may be intentional behavior. Without seeing the requirements or understanding the Google Drive API capabilities around drive groups, I can't be certain if this is a bug or intended behavior. The comment makes assumptions about how it should work without clear evidence.
    I could be wrong about the intentionality - maybe both functions are incorrectly implemented. Also, the similarity to listDrives might not be relevant if they serve different purposes.
    While both functions could be wrong, without clear requirements or API documentation showing that drive groups should exist and be mappable, keeping a speculative comment would violate the rule about needing strong evidence.
    Delete the comment since we don't have strong evidence that returning an empty list is incorrect behavior for drive groups.
2. unified/unified-file-storage/adapters/sharepoint-adapter/index.ts:284
  • Draft comment:
    The listFiles function throws an error if input.cursor is provided without a drive_id. Consider allowing pagination without a drive_id.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The listFiles function in the SharePoint adapter has a potential issue with pagination. It throws an error if input.cursor is provided without a drive_id, which might not be necessary. Consider allowing pagination without a drive_id.
3. unified/unified-file-storage/adapters/sharepoint-adapter/index.ts:125
  • Draft comment:
    The downloadFileById function does not handle the case where downloadResponse.body is null. Ensure to handle this case to avoid unexpected behavior.
  • Reason this comment was not posted:
    Comment did not seem useful.
4. unified/unified-file-storage/adapters/google-adapter/index.ts:70
  • Draft comment:
    The downloadFileById function does not handle the case where res.response.body is null. Ensure to handle this case to avoid unexpected behavior.
  • Reason this comment was not posted:
    Comment did not seem useful.

Workflow ID: wflow_7auvKDXx0m7B6Vjq


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

throw new TRPCError({code: 'NOT_FOUND', message: 'No drives found'})
}

return {
Copy link

Choose a reason for hiding this comment

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

The listDrives function is returning an empty list of items. It should map the response data to the unified Drive model using the mappers, similar to how it's done in listFiles.

Copy link
Collaborator

@openint-bot openint-bot left a comment

Choose a reason for hiding this comment

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

Looks good high level, left some non blocking comments though.

@@ -147,3 +148,11 @@ jobs:
git fetch origin main
git checkout main
git push origin main:production -f
- name: Wait for 5 minutes for any remaining Vercel Main Branch Deployment that's in flight
Copy link
Collaborator

Choose a reason for hiding this comment

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

Our deployment is not guaranteed to take 5 mins. Could be longer sometimes

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ack

@@ -1,123 +1,8 @@
// import {clerkClient} from '@clerk/nextjs/server'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this related?

@@ -6,7 +6,8 @@
"dependencies": {
"@openint/cdk": "workspace:*",
"@openint/util": "workspace:*",
"@opensdks/runtime": "^0.0.19"
"@opensdks/runtime": "^0.0.19",
"@opensdks/sdk-google": "*"
Copy link
Collaborator

Choose a reason for hiding this comment

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

hmm we should probably version this at least with ^...

@pellicceama pellicceama changed the title WIP Google FS API New Google FS API New Jan 27, 2025
@pellicceama pellicceama marked this pull request as draft January 27, 2025 01:32
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.

2 participants