Skip to content

feat: add gRPC plugin support to scaffold subcommand#146

Open
outofcoffee wants to merge 1 commit into
developfrom
claude/sweet-mendel-XhMUR
Open

feat: add gRPC plugin support to scaffold subcommand#146
outofcoffee wants to merge 1 commit into
developfrom
claude/sweet-mendel-XhMUR

Conversation

@outofcoffee
Copy link
Copy Markdown
Contributor

@outofcoffee outofcoffee commented Jun 4, 2026

Summary

This PR adds .imposter.yaml generation and support for generating gRPC mock configurations in the Imposter CLI scaffolding tool.

The CLI can now discover protobuf files, generate appropriate gRPC plugin configurations, and create a .imposter.yaml file with the necessary version and plugin settings.

Key Changes

  • Proto file discovery: Added internal/protobuf/discovery.go to discover .proto files in the configuration directory, following the same pattern as OpenAPI and WSDL discovery
  • gRPC configuration generation: Added internal/impostermodel/grpc.go to handle gRPC mock config generation from protobuf files
  • Config file updates: Extended ConfigGenerationOptions to include ProtoFilePath and added GrpcPluginConfig struct to support gRPC-specific configuration
  • .imposter.yaml generation: Implemented writeDotImposterYaml() function to create a .imposter.yaml file that specifies the Imposter version (5-beta for gRPC) and required plugins
  • Enhanced logging and error messages: Updated discovery logging to include proto files and error messages to mention protobuf specs
  • Test coverage: Added test cases for gRPC mock generation with and without script engines, plus test data with a sample pet_store.proto file
  • Documentation: Updated scaffold command help text to mention protobuf files alongside OpenAPI and WSDL

Implementation Details

  • The gRPC plugin configuration is only added to .imposter.yaml when proto files are detected; otherwise, the version defaults to "latest"
  • Proto file paths are converted to basenames when stored in the plugin configuration, consistent with how OpenAPI and WSDL files are handled
  • The implementation follows existing patterns for other plugin types (OpenAPI, WSDL) to maintain consistency

…upport

The scaffold subcommand now generates a .imposter.yaml file with
IMPOSTER_LOG_LEVEL=DEBUG in the env section and version set to latest
(with comments linking to docs). When protobuf files are discovered,
the version is set to 5-beta and the grpc plugin is included.

https://claude.ai/code/session_013sb3Nsbk8NGa7HSuwjqs3h
@outofcoffee outofcoffee self-assigned this Jun 4, 2026
@outofcoffee outofcoffee added the enhancement New feature or request label Jun 4, 2026
@outofcoffee outofcoffee changed the title Add gRPC plugin support to Imposter CLI scaffolding feat: add gRPC plugin support to Imposter CLI scaffolding Jun 4, 2026
@outofcoffee outofcoffee changed the title feat: add gRPC plugin support to Imposter CLI scaffolding feat: add gRPC plugin support to scaffold subcommand Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants