Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How smart can grpc-replay be when inferring dynamic/ID fields? #2

Open
bradleyjkemp opened this issue Apr 30, 2019 · 1 comment
Open
Labels
design question Issues discussing open-ended design questions and tradeoffs grpc-replay

Comments

@bradleyjkemp
Copy link
Owner

Related: #1

A very common flow is for the client to send a Create request and receive in response some sort of handle that they can later use to Read/Update/Delete the resource they just created.
It would be really nice if grpc-replay could infer these fields and dynamically substitute them into later requests.

Detection process:

  • If a value is returned in a response that is later used in a request
  • The value is of type string (anything else?)
  • The value is the only field that differs between the actual response and the dump response

Where we are certain a field is an ID we can substitute immediately. When unsure, can prompt the user to tell us if we should treat the field as an ID.

A command-line flag would be useful to force fields to be treated as IDs.

Questions:

  • Under what conditions are we certain that something is an ID?
  • Is it ok to re-try a request if we change our mind about whether something is an ID? (would want to at least inform the user and likely prompt them whether or not to continue)
  • What information do we need to prompt the user for them to be able to decide if something is an ID
@bradleyjkemp bradleyjkemp added the design question Issues discussing open-ended design questions and tradeoffs label Apr 30, 2019
@bradleyjkemp
Copy link
Owner Author

I think we can solve this to start with by allowing the use of "variables" within replays: if a variable appears in the expected server response then it gets assigned to and the same value will be sent if the variable later appears in a client message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design question Issues discussing open-ended design questions and tradeoffs grpc-replay
Projects
None yet
Development

No branches or pull requests

1 participant