The gem name provided to the gapic-generator-ruby has to match the package name specified in protos otherwise the VERSION constant is incorrectly referenced in the generated code #325
Labels
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
previously called
the description on how to reproduce the bug at the end of this comment still applies but the issue is slightly wider.
The placement in the directory structure and modules generated for the
version.rb
file are governed by thegem name
parameter supplied via the<service>.yml
file in the CI tests or via the--ruby-cloud-gem-name
parameter when generating with the docker image. ( See also #323 ).The placement of the service-level files is governed by the
package name
parameter, derived from the protobuf file, from thepackage
parameter (orruby_package
option if provided).The
gem name
must partially map to thepackage name
, e.g. for showcasegem name
ofgoogle-showcase
maps to thepackage name
frompackage google.showcase.v1beta1
or for the grpc_service_config testing thegem name
oftesting-grpc_service_config
will map to thepackage name
fromoption ruby_package = "Testing::GrpcServiceConfig";
. The mapping can be partial (excluding version).If the mapping is wrong, like in the example below where we just give
showcase
as the gem name -- theversion.rb
file ends up in the wrong folder and the tests fail, unhelpfully.Example of how to repro:
when generating showcase:
if we run tests with
bundle exec rake ci
we get an error like this for every testing method:
There is a VERSION constant in generated code:
but it's in a file
/lib/showcase/version.rb
while the rest of the code is underlib/google/showcase
.The text was updated successfully, but these errors were encountered: