feat(storage): add Object Contexts samples and system tests#4
feat(storage): add Object Contexts samples and system tests#4thiyaguk09 wants to merge 3 commits intomainfrom
Conversation
- Add `setObjectContexts.js` to demonstrate CRUD and deletion of contexts. - Add `getObjectContexts.js` to show retrieval of structured metadata. - Add `listObjectsWithContextFilter.js` to demonstrate server-side filtering. - Implement comprehensive system tests in `files.test.js` covering presence, absence (-), and existence (:) filter operators. - Ensure samples use correct 'contexts' field with 'custom' map structure.
|
/gemini summary |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces new samples for managing and filtering object contexts in Google Cloud Storage, including scripts for getting, setting, and listing contexts, along with corresponding system tests. Feedback was provided to correct a filename in the usage instructions, improve error handling by wrapping all metadata operations within a single try-catch block, and remove a redundant assertion in the test suite.
Summary of ChangesThis pull request introduces new samples and corresponding system tests for managing and filtering Google Cloud Storage object contexts. The changes provide clear examples for developers on how to interact with the 'contexts' metadata field, including setting, retrieving, and performing server-side filtering using various operators. 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. Activity
|
There was a problem hiding this comment.
Code Review
This pull request introduces new samples for managing and filtering Google Cloud Storage object contexts. I have identified a few improvements: the usage metadata in listObjectContexts.js should be updated to match the filename, the internal try-catch block in setObjectContexts.js can be removed for cleaner error handling, and a redundant assertion in files.test.js should be deleted.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces new Node.js samples for managing and filtering Google Cloud Storage object contexts, including scripts to set, get, and list objects based on custom metadata, along with corresponding system tests. I have no further feedback, as the reviewer's comment regarding console.error in the test cleanup block does not provide a specific actionable code suggestion.
Description
setObjectContexts.jsto demonstrate CRUD and deletion of contexts.getObjectContexts.jsto show retrieval of structured metadata.listObjectsWithContextFilter.jsto demonstrate server-side filtering.files.test.jscovering presence, absence (-), and existence (:) filter operators.Checklist
npm test(see Testing)npm run lint(see Style)GoogleCloudPlatform/nodejs-docs-samples. Not a fork.