Skip to content

Add --include-labels flag to the download command - #470

Merged
mbrt merged 2 commits into
mbrt:masterfrom
ronnie:download-no-labels
Sep 29, 2026
Merged

mbrt merged 2 commits into
mbrt:masterfrom
ronnie:download-no-labels

Conversation

@ronnie

@ronnie ronnie commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

gmailctl download always emits a labels: section (plus a comment explaining that labels management is optional and can be removed by hand). Users who prefer to keep managing labels in the Gmail UI currently have to delete that section manually after every download.

This adds an --include-labels flag to download, defaulting to true. With --include-labels=false, the downloaded labels are dropped before the config is built, so the generated Jsonnet has neither the labels: section nor its comment. Because labels management is opt-in based on the presence of labels in the config, diff, apply and edit then leave labels alone with no further changes.

  • New --include-labels flag on download (default true, existing behaviour unchanged).
  • One-sentence README note in the "Migrate from another solution" section.

Test plan

  • go test ./... passes.
  • go build ./cmd/gmailctl && ./gmailctl download --help shows the new flag.
  • Manually verified against a real account: default output and --include-labels=false output differ only by the labels: section and its comment, and diff ignores a label added in the Gmail UI only for the config downloaded without labels.

Comment thread cmd/gmailctl/cmd/download_test.go Outdated
Comment thread cmd/gmailctl/cmd/download_cmd.go Outdated
Comment thread cmd/gmailctl/cmd/download_test.go Outdated
Comment thread README.md Outdated
@ronnie ronnie changed the title Add --no-labels flag to the download command Add --include-labels flag to the download command Sep 28, 2026
@mbrt
mbrt enabled auto-merge September 29, 2026 09:39
@mbrt

mbrt commented Sep 29, 2026

Copy link
Copy Markdown
Owner

Thanks @ronnie!

@codecov

codecov Bot commented Sep 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 14.28571% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 42.24%. Comparing base (9cf4f0b) to head (51632ea).
⚠️ Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
cmd/gmailctl/cmd/download_cmd.go 14.28% 6 Missing ⚠️

❌ Your patch check has failed because the patch coverage (14.28%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #470      +/-   ##
==========================================
+ Coverage   41.94%   42.24%   +0.30%     
==========================================
  Files          54       54              
  Lines        3710     3728      +18     
==========================================
+ Hits         1556     1575      +19     
+ Misses       2053     2052       -1     
  Partials      101      101              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mbrt
mbrt merged commit 05682f1 into mbrt:master Sep 29, 2026
3 of 4 checks passed
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.

2 participants