Skip to content

feat(gmail): export filters as WebUI XML#553

Merged
steipete merged 2 commits intomainfrom
feat/gmail-filters-xml-export
May 5, 2026
Merged

feat(gmail): export filters as WebUI XML#553
steipete merged 2 commits intomainfrom
feat/gmail-filters-xml-export

Conversation

@steipete
Copy link
Copy Markdown
Collaborator

@steipete steipete commented May 5, 2026

Summary

  • make gog gmail filters export emit Gmail WebUI-importable Atom XML by default
  • resolve Gmail label IDs to names and map common filter actions to WebUI XML properties
  • keep the old API JSON export via --format json and global --json stdout compatibility
  • update README, generated command docs, and changelog

Closes #174.

Testing

  • go test -vet=off ./internal/cmd -run TestGmailFilters
  • make build
  • make docs-commands
  • make docs-site
  • live clawdbot@gmail.com smoke: created disposable label/filter, exported mailFilters.xml, parsed XML for hasTheWord, label, and shouldArchive, then deleted the filter and label
  • live JSON compatibility smoke: ./bin/gog --account clawdbot@gmail.com gmail filters export --format json --no-input | jq 'has("filters")'\n- make ci

@steipete steipete merged commit e8e1ac4 into main May 5, 2026
10 checks passed
@steipete steipete deleted the feat/gmail-filters-xml-export branch May 5, 2026 03:02
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b425d6ab73

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +174 to +178
data, err = json.MarshalIndent(payload, "", " ")
if err != nil {
return err
}
data = append(data, '\n')
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve JSON transforms for file exports

When --format json --out ... is used, this branch marshals with json.MarshalIndent instead of outfmt.WriteJSON, so JSON-mode transforms (--results-only / --select) are no longer applied to the exported file. Before this commit, gog gmail filters export --out ... always wrote through outfmt.WriteJSON, so scripts relying on projected/unwrapped output now get a different file payload even though the same global JSON flags are set.

Useful? React with 👍 / 👎.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Export Gmail filters in WebUI-compatible XML format

1 participant