Validate template execution results - #144
Open
Rishabh060105 wants to merge 2 commits into
Open
Conversation
Signed-off-by: Rishabh Jain <rishabhj2005@email.com>
Contributor
Author
|
Hi @mttrbrts , I reviewed the changes against the pointers provided in the original issue and updated the branch accordingly. What changed
Validation
|
Contributor
|
Hey @Rishabh060105 , I think this is already covered in pr by @mttrbrts . |
Signed-off-by: Rishabh Jain <rishabhj2005@email.com>
Contributor
Author
|
Hey @devanshi00,. The PR(PR #166) validates the runtime class hierarchy, while this PR #144 validates the returned execution structure itself. I’ve resolved all the conflicts, keeping only the missing TypeScript result-shape checks and their tests.It ensures required fields like result, state, and events are present and correctly shaped. |
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.
Validate TemplateArchiveProcessor execution results
This PR adds the runtime validation requested in #135 so TypeScript template logic fails fast when it returns malformed execution output.
Changes
trigger()result before returning it:resultmust be an objectstatemust be an objecteventsmust be an arrayinit()result contains a state objectresult, missingstate, and non-arrayeventsmainand resolves the previous conflictsRelated issue
Validation
npm test: 84 tests and 40 snapshots passedAuthor checklist