Repository navigation
Add --include-labels flag to the download command - #470
Merged
Merged
Conversation
mbrt
reviewed
Sep 28, 2026
mbrt
approved these changes
Sep 29, 2026
mbrt
enabled auto-merge
September 29, 2026 09:39
Owner
|
Thanks @ronnie! |
Codecov Report❌ Patch coverage is
❌ 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. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gmailctl downloadalways emits alabels: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-labelsflag todownload, defaulting to true. With--include-labels=false, the downloaded labels are dropped before the config is built, so the generated Jsonnet has neither thelabels:section nor its comment. Because labels management is opt-in based on the presence oflabelsin the config,diff,applyandeditthen leave labels alone with no further changes.--include-labelsflag ondownload(default true, existing behaviour unchanged).Test plan
go test ./...passes.go build ./cmd/gmailctl && ./gmailctl download --helpshows the new flag.--include-labels=falseoutput differ only by thelabels:section and its comment, anddiffignores a label added in the Gmail UI only for the config downloaded without labels.