Storage list by AustinBenoit · Pull Request #1842 · firebase/firebase-cpp-sdk

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 introduces a significant new feature to the Storage SDK: a List API. This API allows developers to efficiently browse and manage the contents of their storage buckets by retrieving lists of files and sub-folders, with support for pagination to handle large datasets. This enhancement provides a more robust and flexible way to interact with stored data.

Highlights

  • New List API: Added a new List API to the Storage SDK, enabling users to retrieve a paginated list of files and prefixes within a storage reference across all supported platforms (Android, iOS, Desktop).
  • Cross-Platform Implementation: Implemented the List API functionality for Android, iOS, and Desktop platforms, ensuring consistent behavior and integration with native SDKs where applicable.
  • Integration Testing: Included a new integration test to validate the functionality of the List API, covering basic listing and pagination scenarios.

🧠 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
  • release_build_files/readme.md
    • Updated release notes to announce the addition of the Storage List API.
  • storage/CMakeLists.txt
    • Added src/common/list_result.cc to the build configuration.
  • storage/integration_test/src/integration_test.cc
    • Introduced TestList to verify the new List API, including pagination and handling of prefixes and items.
  • storage/src/android/storage_reference_android.cc
    • Added JNI method lookups for List and ListWithToken methods.
    • Implemented logic within FutureCallback to process ListResult objects returned from the Java SDK.
  • storage/src/android/storage_reference_android.h
    • Included firebase/storage/list_result.h.
    • Declared List and ListLastResult methods for the Android internal implementation.
  • storage/src/common/list_result.cc
    • Added implementation for the StorageListResult class, managing prefixes, items, and next page tokens.
  • storage/src/common/list_result_internal.h
    • Added an internal header defining StorageListResultInternal to manage the data for StorageListResult.
  • storage/src/common/storage_reference.cc
    • Implemented the public List and ListLastResult methods, delegating to the internal implementation.
  • storage/src/desktop/curl_requests.cc
    • Added ReturnedListResponse to handle and parse JSON responses from the REST API for list operations, converting them into StorageListResult objects.
  • storage/src/desktop/curl_requests.h
    • Declared the ReturnedListResponse class for processing list API responses.
  • storage/src/desktop/storage_reference_desktop.cc
    • Implemented the desktop version of the List API, constructing REST API requests with appropriate parameters for prefixes, max results, and page tokens.
  • storage/src/desktop/storage_reference_desktop.h
    • Added new StorageReferenceFn enums for kStorageReferenceFnList and kStorageReferenceFnListInternal.
    • Declared List and ListLastResult methods for the desktop internal implementation.
  • storage/src/include/firebase/storage/list_result.h
    • Added a new public header defining the StorageListResult class, which encapsulates the results of a list operation.
  • storage/src/include/firebase/storage/storage_reference.h
    • Included firebase/storage/list_result.h.
    • Added public declarations for the List and ListLastResult methods to the StorageReference class.
  • storage/src/ios/storage_reference_ios.h
    • Included firebase/storage/list_result.h.
    • Declared List and ListLastResult methods for the iOS internal implementation.
  • storage/src/ios/storage_reference_ios.mm
    • Implemented the iOS version of the List API, integrating with FIRStorageReference and handling completion blocks to convert native results to C++ StorageListResult objects.
Activity
  • AustinBenoit created this pull request to add a new feature.
  • The author has added a new integration test to ensure the new functionality works as expected.
  • Testing was performed by running the new integration test in the test runner.
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.

  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.