Skip to content

feat(services): add Chrome Web Store API to the service registry#855

Open
MaximStone wants to merge 1 commit into
googleworkspace:mainfrom
MaximStone:feat/add-chrome-web-store-service
Open

feat(services): add Chrome Web Store API to the service registry#855
MaximStone wants to merge 1 commit into
googleworkspace:mainfrom
MaximStone:feat/add-chrome-web-store-service

Conversation

@MaximStone

Copy link
Copy Markdown

What

Registers the Chrome Web Store API (chromewebstore, v1.1) in the static service registry (crates/google-workspace/src/services.rs).

Why

chromewebstore is a Discovery-listed Google API for managing your own store items — the canonical programmatic way to upload and publish Chrome extensions / themes / apps (the API behind tools like chrome-webstore-upload). It wasn't in the registry, so:

$ gws chromewebstore items get --params '{"itemId":"…"}'
Unknown service 'chromewebstore'. Known services: drive, sheets, … script.
Use '<api>:<version>' syntax for unlisted APIs.

The suggested <api>:<version> escape hatch doesn't actually help here: parse_service_and_version splits the colon but still calls resolve_service, which only knows registered aliases — so the API was unreachable by any invocation.

How

Per AGENTS.md ("when adding a new service, you only need to register it in services.rs and verify the Discovery URL pattern in discovery.rs"), this is a one-entry change. No discovery.rs change is needed: the standard https://www.googleapis.com/discovery/v1/apis/chromewebstore/v1.1/rest URL 404s, but the existing $discovery/rest fallback already fetches https://chromewebstore.googleapis.com/$discovery/rest?version=v1.1 (HTTP 200) — the same path Forms/Keep/Meet use.

Verification

# unit test (added)
$ cargo test -p google-workspace services::
test services::tests::test_resolve_service_known ... ok   # now also asserts chromewebstore → v1.1

# end-to-end against the live discovery doc (no auth needed)
$ gws schema chromewebstore.items.get
{ "description": "Gets your own Chrome Web Store item.", "httpMethod": "GET",
  "path": "chromewebstore/v1.1/items/{itemId}", … }

Methods now exposed: items.insert / items.get / items.update (media upload of the .zip) / items.publish.
Scopes: https://www.googleapis.com/auth/chromewebstore (+ .readonly).

This unlocks a full publish flow, e.g.:

$ gws chromewebstore items update  --itemId <ID> --upload dist.zip
$ gws chromewebstore items publish --itemId <ID>

cargo fmt --check and cargo clippy are clean.

@changeset-bot

changeset-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 2ea6da1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@google-cla

google-cla Bot commented Jun 25, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

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 expands the capabilities of the Google Workspace CLI tool by registering the Chrome Web Store API. By adding this service to the registry, users can now interact with the API to upload, update, and publish Chrome extensions directly through the CLI, resolving previous issues where the service was unreachable.

Highlights

  • Service Registration: Added the Chrome Web Store API (v1.1) to the static service registry, enabling programmatic management of extensions and themes.
  • Testing: Included a unit test to verify that the new 'chromewebstore' alias correctly resolves to the expected API name and version.
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 the 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 counterproductive. 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

  1. Review the Generative AI Prohibited Use Policy, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request adds support for the Chrome Web Store API to the Google Workspace services list by registering a new ServiceEntry for chromewebstore (version v1.1) and adding a corresponding unit test to verify service resolution. There are no review comments, and the changes look correct and complete.

The Chrome Web Store API (`chromewebstore`, v1.1) is a Discovery-listed
Google API for managing your own store items — uploading and publishing
Chrome extensions, themes, and apps. It was not in the static service
registry, so `gws chromewebstore ...` failed with "Unknown service".

The error text suggests `<api>:<version>` for unlisted APIs, but that
path still calls `resolve_service`, which only knows the registered
aliases — so there was no way to reach the API at all.

Register it like any other service (per AGENTS.md, new services only need
a `services.rs` entry). Its discovery doc is served from
`https://chromewebstore.googleapis.com/$discovery/rest?version=v1.1`,
which the existing `$discovery/rest` fallback in `discovery.rs` already
handles (the standard `discovery/v1/apis/...` URL 404s for this API).

Verified end-to-end:
  $ gws schema chromewebstore.items.get   # returns the live method schema
Methods exposed: items.insert / get / update (media upload) / publish.
Scopes: https://www.googleapis.com/auth/chromewebstore (+ .readonly).
@MaximStone MaximStone force-pushed the feat/add-chrome-web-store-service branch from 10b7b9d to 2ea6da1 Compare June 25, 2026 22:27
@googleworkspace-bot

Copy link
Copy Markdown
Collaborator

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request adds support for the Chrome Web Store API (chromewebstore v1.1) to the list of Google Workspace services and includes a corresponding unit test to verify its resolution. There are no review comments, and I have no additional feedback to provide as the changes are straightforward and correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants