Repository navigation
recorded(match): evaluate on the engine (verify includeRequests) so repeated-key and JSON-body array rules (rift#1553/#1579) match - #350
Merged
Conversation
…rules apply recorded(match) filtered the journal with a JVM copy of Mountebank's predicate rules. That copy drifted from the engine three times (#330, #335, and rift 0.24.0's repeated-key and JSON-body array rules), so a filter could disagree with what the engine matched. It now asks the engine's verify with includeRequests, as verify itself does since #127: one call, the engine's answer, and inject predicates work too. PredicateEvaluator is no longer called and is deprecated for removal. Closes #337
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.
Closes #337
Why
Imposter.recorded(RequestMatch)andSpace.recorded(RequestMatch)filtered the journal withPredicateEvaluator, a JVM copy of Mountebank's predicate rules. On rift 0.24.0 it disagrees with the engine on:injectpredicates, which it threw on.This is the third time it has drifted (#330, #335). The triage comment on #337 explains the decision.
What
recorded(match)makes onePOST /imposters/:port/verifycall withincludeRequests(embedded:rift_verify) and returns the engine's matches in journal order. A space adds itsflowId. A non-recording imposter still gets an empty list.requestsarray is aCommunicationErrorrather than a silent empty list (RecordedRequests.readMatched).PredicateEvaluatoris no longer called. It is@Deprecated(since = "0.3.8", forRemoval = true). rift-scala excludes it inFacadeCoverage.recorded(match)javadoc onImposter/Spaceanddocs/design/sdk-api.md(§§ verify, match grammar table).Tests
RecordedMatchOnEngineTest(4 tests):requestsis an error.VerifyIntegrationTest: two tests that pinned the client-side filter now assert the engine call. The obsolete client-filter case was removed fromSpaceRecordedTest.RecordedMatchArraysIT(live, all lanes), checking seven rules from 0.24:deepEqualsmultiset;1.0matches1;"";verifyon engine v0.24.0 (macOS arm64, JDK 21) passed on SPAWN and EMBEDDED,XPathRecordedMatchITincluded.🤖 Generated with Claude Code