gapic-generator-java icon indicating copy to clipboard operation
gapic-generator-java copied to clipboard

feat: bake gapic-generator-java into the hermetic build docker image

Open diegomarquezp opened this issue 1 year ago • 2 comments

Built on top of https://github.com/googleapis/sdk-platform-java/pull/3045 (needs to be merged first)

diegomarquezp avatar Jul 24 '24 20:07 diegomarquezp

@blakeli0 I removed gapic_generator_version altogether. We now only rely on DOCKER_GAPIC_GENERATOR_LOCATION that will point to the jar we need and not care about the location.

This however brought many changes in the test folder but most of them are simple.

diegomarquezp avatar Aug 09 '24 02:08 diegomarquezp

@JoeWang1127 @blakeli0 the integration tests now can't be locked to a specific generator version, so we will constantly need to update them.

A few ideas:

  • Add an --update flag to the integration tests
  • Keep a locked-in jar in the test resources folder and override the generator version
  • Add test-only logic in the Dockerfile (e.g. figure out if the jar should be downloaded or mvn install-ed by converting this version into an overridable ARG)

diegomarquezp avatar Aug 30 '24 01:08 diegomarquezp

spring downstream check failing because the release job still doesn't publish the maven artifacts

https://github.com/GoogleCloudPlatform/spring-cloud-gcp/pull/3138#issuecomment-2318598130

image

cc: @mpeddada1

diegomarquezp avatar Aug 30 '24 02:08 diegomarquezp

the integration tests now can't be locked to a specific generator version, so we will constantly need to update them

I think it's fine to test the snapshot version of the generator.

Ideally, running the generation can produce the same file even if the generator updates, though some changes in the generator can produce different code and we can update the golden file accordingly, just like the showcase integration test.

At this point, I think it's fine. However, we need to improvement the integration test:

  • Use golden file rather than branch in google-cloud-java
  • Provide an easy way to update the golden file

@blakeli0 WDYT?

JoeWang1127 avatar Aug 30 '24 13:08 JoeWang1127

From discussion with @blakeli0 and @JoeWang1127, we can lock in a specific version string of the generator, download it in our integration test and then override the well-known location via volumes

diegomarquezp avatar Aug 30 '24 18:08 diegomarquezp

@JoeWang1127 I modified the integration test to lock-in a specific generator jar downloaded via mvn. PTAL when you have a chance :)

diegomarquezp avatar Aug 31 '24 00:08 diegomarquezp

@JoeWang1127 I modified the integration test to lock-in a specific generator jar downloaded via mvn. PTAL when you have a chance :)

Thanks, could you change the pr body since this is no longer a pending issue.

JoeWang1127 avatar Aug 31 '24 13:08 JoeWang1127