Reject invalid store execute variables - #8321
Open
dmerand wants to merge 3 commits into
Open
Conversation
Assisted-By: devx/02b9a955-e9da-4fba-97d1-f625c956a647
…variable-validation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds local validation for store execute GraphQL variables so only non-null JSON objects are accepted, preventing invalid variable payloads from reaching the GraphQL client.
Changes:
- Introduces
validateVariablesto rejectnull, arrays, and primitive JSON values (and rejects explicitly empty--variablesinput). - Preserves existing malformed-JSON and missing-file error paths while rethrowing the new validation
AbortErrors unchanged. - Adds regression tests for invalid inline/file variables and a changeset documenting the user-facing behavior change.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/store/src/cli/services/store/execute/request.ts | Adds local variables parsing/validation and new AbortError paths for invalid variable shapes. |
| packages/store/src/cli/services/store/execute/request.test.ts | Adds coverage for invalid variables inputs and acceptance of {} variables. |
| .changeset/fuzzy-store-variables.md | Declares a patch changeset for rejecting invalid variables before requests are sent. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Assisted-By: devx/2f4bde52-9531-4910-bbc1-5ed7182a4a59
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.
WHY are these changes introduced?
--variablesand--variable-fileaccepted non-object JSON values, which reached GraphQL despite the variables object contract.WHAT is this pull request doing?
Validate variable JSON locally and raise
AbortErrorfor null, arrays, primitives, and explicit empty inline input. Preserve malformed JSON and missing-file errors, including their contextual output. Add focused inline and file-backed regression coverage.How to test your changes?
Post-release steps
None.
Checklist
patch) and added a changeset.