refactor(BUZZ-231): clarify audience helpers and share json output - #530
Merged
Merged
Conversation
Co-authored-by: Cursor <[email protected]>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused refactor preserves existing behavior and has no unresolved review findings.
Review effort: Balanced
Findings: None
What changed in this PR
Refines the audience commands introduced in #527 by clarifying shared helpers and consolidating JSON output handling.
Changes:
- Adds command-specific flag and validation helpers.
- Centralizes
--jsonregistration and uses the API response type for count output, preserving{"count":N}.
| File | Description |
|---|---|
| cmd/audience/filter_input.go | Adds named helpers and shared JSON flag binding. |
| cmd/audience/count.go | Uses count helpers and the API response type. |
| cmd/audience/breakdown.go | Uses breakdown helpers and shared JSON state. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
sarahweeks-prolific
marked this pull request as ready for review
October 2, 2026 13:56
matt-kinton
approved these changes
Oct 2, 2026
SeanAlexanderHarris
approved these changes
Oct 5, 2026
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
Follow-up to #527 for Matt's post-merge comments on
audience count/audience breakdown.Call sites no longer pass a naked bool into shared helpers.
--jsonis registered once with the other audience flags. Both commands emit the client/API response type for--jsoninstead of count inventing its own DTO.Implementation
addCountFlags/addBreakdownFlagsand validation intovalidateCount/validateBreakdown. The bool stays insidefilter_input.go.-j/--jsoninto the shared flag registrar (still hand-bound —shared.AddOutputFlagswould steal-tfrom--template-path).--jsonnow marshalsclient.EligibilityCountResponse, matching breakdown's use ofclient.FilterBreakdownResponse.CountResultis gone. Wire JSON is still{"count":N}.Testing
Existing
cmd/audiencetests cover the same paths; no behaviour change.go test ./cmd/audience/...passes.