Add recipe-apply-filter-to-existing-emails#739
Add recipe-apply-filter-to-existing-emails#739ldub wants to merge 1 commit intogoogleworkspace:mainfrom
Conversation
Adds a recipe for applying a Gmail filter's label/archive actions to existing messages via messages.batchModify — the API equivalent of the Gmail UI's "also apply filter to matching conversations" checkbox, which has no parameter on filters.create.
🦋 Changeset detectedLatest commit: 50f2da6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
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. |
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 adds a new productivity recipe to the Google Workspace CLI registry. The recipe enables users to programmatically apply Gmail filter actions to existing messages, effectively replicating the 'apply to matching conversations' functionality currently missing from the Gmail API's filter creation endpoint. The changes are strictly limited to configuration and documentation files. 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 introduces a new recipe, apply-filter-to-existing-emails, which enables applying Gmail filter actions to existing messages through the API. The changes include the addition of the recipe to the registry, a new skill documentation file, and updates to the main skills list. I have no feedback to provide.
Description
Adds a new recipe skill,
recipe-apply-filter-to-existing-emails, that documents how to apply a Gmail filter's actions to existing messages — the API equivalent of the Gmail UI's "Also apply filter to matching conversations" checkbox, which has no parameter onfilters.createand is tracked as feature request Google Issue Tracker #62715881.The recipe walks through:
gws gmail users settings filters get— read the filter'scriteriaandactiongws gmail users messages list— translate criteria to a Gmail search querygws gmail users messages batchModify— apply the filter's label mutations in bulk (up to 1000 ids per request)in:inboxcautionnotes two constraints: the 1000-id batch limit, and thatforwardactions on a filter cannot be replayed against past messages.The diff is TOML + auto-generated Markdown only — no Rust changes. A
--dry-runis not applicable (no new CLI surface).Development practices followed
docs/CONTRIBUTING.mdandAGENTS.mdin full. Confirmed the contribution pattern: recipes are TOML entries incrates/google-workspace-cli/registry/recipes.toml;skills/recipe-*/SKILL.mdanddocs/skills.mdare auto-generated bygws generate-skills, not handwritten.[[recipes]]entry withname,title,description(under the 120-charFRONTMATTER_DESCRIPTION_LIMIT),category = "productivity",services = ["gmail"],steps, andcaution.skills/recipe-apply-filter-to-existing-emails/SKILL.mdanddocs/skills.mdviacargo run -- generate-skills. Reverted unrelated drift that the regeneration picked up from upstream Discovery Document updates (ChatfindGroupChats, DrivegenerateCseToken, Events patch wording, sheets-append--rangedescription) — those belong in a separate PR..changeset/recipe-apply-filter-to-existing-emails.mdwith"@googleworkspace/cli": patch.cargo fmt --all -- --check(clean) andcargo test(701 passed; includestest_registry_references, which validates thatservices = ["gmail"]resolves to a valid gws alias).cargo clippy --all-targets -- -D warnings. It surfaces ~10 pre-existing errors on cleanupstream/main(assert_eq!with bool literal, very-complex-type, etc. inmain.rs,commands.rs,executor.rs) that are unrelated to this diff. Likely a clippy-version skew against CI.Checklist
AGENTS.mdguidelines (no generatedgoogle-*crates).cargo fmt --all— clean.cargo clippy -- -D warnings— pre-existing errors on upstream main, none introduced by this diff. Noted above.test_registry_references) covers the new entry. No new Rust logic, so no additional tests needed..changeset/recipe-apply-filter-to-existing-emails.md, patch).