feat(storage): add Object Contexts support to GCS metadata and listing#32
feat(storage): add Object Contexts support to GCS metadata and listing#32thiyaguk09 wants to merge 6 commits intomainfrom
Conversation
Updated internal request mapping in `file.ts` and `bucket.ts` to include `contexts` in JSON payloads and `filter` in query strings. Fixed baseline unit tests to accommodate the updated destination metadata structure.
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 integrates support for Google Cloud Storage Object Contexts into the client library. This feature allows for more granular, structured metadata to be associated with objects, which can then be used for advanced filtering during object listing. The changes encompass modifications to core file and bucket operations to handle contexts, alongside robust validation and extensive testing to ensure correct behavior and data integrity. Highlights
🧠 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
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. 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
|
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces support for Object Contexts in GCS, a significant new feature. The changes are comprehensive, touching on file and bucket operations for creation, updates, copying, combining, and listing with context-based filters. The implementation is accompanied by a good set of unit and system tests. My review includes a few suggestions to improve TypeScript type definitions for correctness and to enhance documentation and code consistency. Overall, this is a well-executed feature addition.
Note: Security Review did not run due to the size of the PR.
There was a problem hiding this comment.
Code Review
This pull request introduces support for Object Contexts in GCS metadata and listing, updating Bucket and File classes to handle contexts in combine, copy, save, and setMetadata operations, and adding a validateContexts utility function to ensure context keys and values do not contain forbidden characters. A critical security vulnerability has been identified: the context validation to prevent filter injection is not consistently applied across all relevant methods. Specifically, createWriteStream and createResumableUpload are missing this crucial validation, which could allow malicious contexts to be set and exploited for filter injection. Addressing this inconsistency is essential for the robustness of the new feature. Additionally, minor issues include an inconsistent coding style in error handling and an incorrect JSDoc comment in the new utility function.
This reverts commit fa9586a.
Description
Impact
Testing
Additional Information
Checklist
Fixes #issue_number_goes_here 🦕