feat(services): register Apps Script and Google Photos APIs#544
feat(services): register Apps Script and Google Photos APIs#544dumko2001 wants to merge 4 commits intogoogleworkspace:mainfrom
Conversation
🦋 Changeset detectedLatest commit: bee9754 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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 enhances the system's capabilities by integrating two new Google services, Apps Script and Google Photos, into the core service registry. This integration streamlines the process for users to interact with these APIs, providing convenient aliases and ensuring that the necessary authentication scopes are correctly managed during the login procedure. Highlights
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. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request registers the Apps Script and Google Photos APIs, allowing them to be used with short aliases. The change is a straightforward addition to the list of known services. My review identifies that tests for the new services are not included, despite being indicated on the PR checklist. Adding these tests would improve maintainability and prevent future regressions.
| ServiceEntry { | ||
| aliases: &["script"], | ||
| api_name: "script", | ||
| version: "v1", | ||
| description: "Manage Apps Script projects and deployments", | ||
| }, | ||
| ServiceEntry { | ||
| aliases: &["photos"], | ||
| api_name: "photoslibrary", | ||
| version: "v1", | ||
| description: "Manage Google Photos library", | ||
| }, |
There was a problem hiding this comment.
The PR checklist indicates that tests have been added, but no tests for these new services are present in the diff. To prevent regressions and ensure correct service resolution, please add test cases for script and photos to the test_resolve_service_known function.
For example:
assert_eq!(
resolve_service("script").unwrap(),
("script".to_string(), "v1".to_string())
);
assert_eq!(
resolve_service("photos").unwrap(),
("photoslibrary".to_string(), "v1".to_string())
);|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request registers the Apps Script and Google Photos APIs, allowing them to be used with short aliases. The changes are correct, but they are missing corresponding unit tests to verify that the new service aliases resolve correctly. Adding these tests is important to ensure the feature works as expected and to prevent future regressions.
| ServiceEntry { | ||
| aliases: &["script"], | ||
| api_name: "script", | ||
| version: "v1", | ||
| description: "Manage Apps Script projects and deployments", | ||
| }, | ||
| ServiceEntry { | ||
| aliases: &["photos"], | ||
| api_name: "photoslibrary", | ||
| version: "v1", | ||
| description: "Manage Google Photos library", | ||
| }, |
There was a problem hiding this comment.
The contribution checklist states that tests have been added, but there are no new tests in test_resolve_service_known to verify that the new script and photos aliases resolve correctly. Please add test cases for these new services to prevent regressions.
For example, you could add the following to the test:
assert_eq!(
resolve_service("script").unwrap(),
("script".to_string(), "v1".to_string())
);
assert_eq!(
resolve_service("photos").unwrap(),
("photoslibrary".to_string(), "v1".to_string())
);|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request registers the Apps Script and Google Photos APIs, allowing them to be used with short aliases. The change is straightforward, but it's missing corresponding tests to verify that the new services are resolved correctly, which contradicts the PR checklist. Additionally, the new services are not added in alphabetical order, which impacts maintainability. Please address these points to improve the quality of the change.
| ServiceEntry { | ||
| aliases: &["script"], | ||
| api_name: "script", | ||
| version: "v1", | ||
| description: "Manage Apps Script projects and deployments", | ||
| }, | ||
| ServiceEntry { | ||
| aliases: &["photos"], | ||
| api_name: "photoslibrary", | ||
| version: "v1", | ||
| description: "Manage Google Photos library", | ||
| }, |
There was a problem hiding this comment.
There are a couple of issues with this addition:
-
Missing Tests: The PR checklist is marked as having tests, but no tests were added for the new
scriptandphotosservices. Please add assertions totest_resolve_service_knownto verify that the new aliases resolve correctly. -
Alphabetical Order: For maintainability and a better user experience in help messages, the
SERVICESlist should be kept sorted alphabetically.photosshould be listed beforescript.
Here's a suggestion to fix the ordering:
| ServiceEntry { | |
| aliases: &["script"], | |
| api_name: "script", | |
| version: "v1", | |
| description: "Manage Apps Script projects and deployments", | |
| }, | |
| ServiceEntry { | |
| aliases: &["photos"], | |
| api_name: "photoslibrary", | |
| version: "v1", | |
| description: "Manage Google Photos library", | |
| }, | |
| ServiceEntry { | |
| aliases: &["photos"], | |
| api_name: "photoslibrary", | |
| version: "v1", | |
| description: "Manage Google Photos library", | |
| }, | |
| ServiceEntry { | |
| aliases: &["script"], | |
| api_name: "script", | |
| version: "v1", | |
| description: "Manage Apps Script projects and deployments", | |
| }, |
|
Alphabetized the entire |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds new service registrations for the Google Photos API (photoslibrary) and the Apps Script API (script) to the SERVICES constant array in src/services.rs. The existing service entries in this array were also reordered. Corresponding unit tests were added to verify the correct resolution of these new services, and a new changeset file was created to document this feature.
Description
Formally register the Apps Script (
script) and Google Photos (photos) APIs in the built-in services list. This enables users to access these services using short aliases and ensures that the correct OAuth scopes are included in the login flow picker.Fixes #163, #205
Checklist:
AGENTS.mdguidelines (no generatedgoogle-*crates).cargo fmt --allto format the code perfectly.cargo clippy -- -D warningsand resolved all warnings.pnpx changeset) to document my changes.