Skip to content

chore: add grpc-protoscope sample app for Keploy gRPC field-ordering bug#215

Open
anjupathak03 wants to merge 5 commits intomainfrom
chore/add-grpc-protoscope-sample
Open

chore: add grpc-protoscope sample app for Keploy gRPC field-ordering bug#215
anjupathak03 wants to merge 5 commits intomainfrom
chore/add-grpc-protoscope-sample

Conversation

@anjupathak03
Copy link
Copy Markdown
Contributor

@anjupathak03 anjupathak03 commented Apr 6, 2026

What

Adds grpc-protoscope/ — a minimal Go gRPC client-server sample app that reproduces the Keploy gRPC field-ordering bug (protoscope indentation causing false SCHEMA_BROKEN failures).

Why

A user reported that Keploy was failing gRPC tests even though recorded and replayed responses had identical structure and values. The only difference was the order of repeated fields inside nested protobuf sub-messages — which is perfectly valid in protobuf. This sample app reproduces that exact scenario using rand.Shuffle + raw wire encoding.

What's included

  • proto/search.proto — Protobuf schema matching the bug report structure
  • server/main.go — gRPC server with randomized wire field ordering via protowire + rawCodec
  • client/main.go — gRPC client that calls the Search RPC
  • keploy.yml — Keploy configuration
  • README.md — Full bug analysis, root cause, and reproduction steps

Copilot AI review requested due to automatic review settings April 6, 2026 09:57
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds new minimal reproduction sample apps to the samples-go repo to help debug Keploy replay issues (gRPC protoscope canonicalization + SSE preflight port resolution), and updates CI to build multi-command Go modules.

Changes:

  • Added grpc-protoscope/ Go gRPC client/server repro that emits raw protobuf wire bytes with randomized repeated-field ordering.
  • Added sse-preflight/ tiny dual-port HTTP/SSE repro for CORS preflight being replayed on the wrong port.
  • Updated CI build workflow to run go build ./... per module (supports multiple ./cmd/* entrypoints).

Reviewed changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
sse-preflight/README.md Documents SSE preflight repro steps.
sse-preflight/go.mod Declares the module for the SSE sample.
sse-preflight/cmd/server/main.go Dual HTTP + SSE server for the preflight/404 repro.
sse-preflight/cmd/client/main.go Sends an OPTIONS preflight request to the SSE endpoint.
README.md Adds sse-preflight to the top-level sample list.
grpc-protoscope/server/main.go gRPC server that returns manually-built wire bytes with shuffled repeated entries.
grpc-protoscope/client/main.go gRPC client that calls Search and prints response fields.
grpc-protoscope/proto/search.proto Proto schema mirroring the bug report structure.
grpc-protoscope/searchpb/search.pb.go Generated protobuf types for the sample.
grpc-protoscope/searchpb/search_grpc.pb.go Generated gRPC stubs for the sample.
grpc-protoscope/README.md Detailed root-cause analysis + repro instructions for the gRPC issue.
grpc-protoscope/keploy.yml Keploy config for recording/replaying the gRPC sample.
grpc-protoscope/keploy/.gitignore Ignores Keploy reports output.
grpc-protoscope/keploy/test-set-0/tests/test-1.yaml Recorded Keploy test artifact (ordering variant).
grpc-protoscope/keploy/test-set-1/tests/test-1.yaml Recorded Keploy test artifact (ordering variant).
grpc-protoscope/keploy/test-set-2/tests/test-1.yaml Recorded Keploy test artifact (ordering variant).
grpc-protoscope/go.mod Module/dependencies for grpc-protoscope (currently includes local replace).
grpc-protoscope/go.sum Dependency lockfile for grpc-protoscope.
.github/workflows/build.yml Builds each sample module via go build ./....
Comments suppressed due to low confidence (1)

grpc-protoscope/go.mod:66

  • replace go.keploy.io/server/v3 => /home/anju/keploy hard-codes a local absolute path, so this module won’t build for anyone else (including CI). Remove the replace and either (a) depend on a real published go.keploy.io/server/v3 version, or (b) avoid the dependency entirely if it isn’t needed for the sample build/run steps.
)

replace go.keploy.io/server/v3 => /home/anju/keploy


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread grpc-protoscope/go.mod
Comment thread grpc-protoscope/server/main.go
Comment thread grpc-protoscope/server/main.go Outdated
Comment thread grpc-protoscope/README.md
Comment thread grpc-protoscope/README.md Outdated
Comment thread README.md
@anjupathak03 anjupathak03 force-pushed the chore/add-grpc-protoscope-sample branch from 7cae59f to 5d812fb Compare April 6, 2026 10:15
@anjupathak03 anjupathak03 force-pushed the chore/add-grpc-protoscope-sample branch from f08fbac to 5f0889f Compare April 7, 2026 05:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 8 changed files in this pull request and generated 9 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread grpc-protoscope/go.mod Outdated
Comment thread grpc-protoscope/README.md Outdated
Comment thread grpc-protoscope/server/main.go
Comment thread grpc-protoscope/server/main.go Outdated
Comment thread grpc-protoscope/server/main.go
Comment thread grpc-protoscope/server/main.go Outdated
Comment thread grpc-protoscope/client/main.go Outdated
Comment thread grpc-protoscope/client/main.go
Comment thread grpc-protoscope/server/main.go Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants