refactor(sdk,mcp,cli): enforce report filter and label color validation at SDK boundary#291
Merged
adriannoes merged 2 commits intoJun 11, 2026
Conversation
This was referenced Jun 10, 2026
Danielmoraisg
approved these changes
Jun 11, 2026
Danielmoraisg
approved these changes
Jun 11, 2026
6f9248b to
febf922
Compare
…on at SDK boundary Report ReportCardsFilter preflight and label color normalization were decisions wired at twelve effect sites (six MCP report tools, six CLI commands). Move them into the SDK funnel they all forward through: ReportService create/update/export methods normalize the filter and raise ValueError with the planner message, and PipeConfigService create_label/update_label normalize the hex color. One decision point replaces twelve leaf guards; MCP returns the same error envelope via an explicit ValueError catch and the CLI maps ValueError to exit code 2 (typer.BadParameter for report commands), so messages and exit codes are unchanged. Also renames validate_report_cards_filter -> report_cards_filter_error to match its str|None return (error message or None). Co-authored-by: Gabriel Custodio <gbrlcustodio@users.noreply.github.com>
Restore CLI preflight at option-parse time using SDK planners so invalid input fails before get_authenticated_client. Extract prepare_report_cards_filter for shared use; rename stale tests; amend CHANGELOG and reports docs per review.
c9fbca0 to
f731b2f
Compare
fabb4f1
into
feat/card-phase-erg/6-docs-and-skills
1 check passed
3 tasks
adriannoes
added a commit
that referenced
this pull request
Jun 11, 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
ReportServicecreate/update/export methods now normalize the filter and raiseValueErrorwith the planner message;PipeConfigService.create_label/update_labelnormalize the hex color. The twelve leaf guards are deleted; MCP mapsValueErrorto the samebuild_report_error_payloadenvelope and the CLI maps it to exit code 2 (typer.BadParameteron report commands), so messages and exit codes are unchanged.validate_report_cards_filter->report_cards_filter_error, matching itsstr | Noneerrors-as-values return.PR 7 of the card-phase stack, stacked on #285.
The diff exceeds the usual 10-file guideline because it is one structural move (one decision point replacing twelve guards, with relocated test coverage); it nets less code at the surfaces.