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

Fix annotation processor #1744

Merged

Conversation

Polber
Copy link
Contributor

@Polber Polber commented Jul 23, 2024

#1677 changed the way that maven-compiler-plugin compiles annotation processors from being implicit to explicitly defined. The definition for @AutoValue annotations was added, but not @AutoService.

This caused the CommonTemplateJvmInitializer to not get compiled into the template jars with the @AutoService handler, which resulted in Beam not calling the necessary Jvm initialization methods for certain templates to work properly.

/**
* CommonTemplateJvmInitializer performs all the required steps to support CommonTemplateOptions.
*/
@AutoService(JvmInitializer.class)
public class CommonTemplateJvmInitializer implements JvmInitializer {

This was namely an issue with JDBC templates for users that rely on the --extraFilesToStage parameter to copy files from GCS to the extra_files directory on the Dataflow worker.

This PR adds the definition for the @AutoService annotation processor to affected modules.

Signed-off-by: Jeffrey Kinard <jeff@thekinards.com>
@Polber Polber self-assigned this Jul 23, 2024
Copy link

codecov bot commented Jul 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 42.31%. Comparing base (5be5817) to head (10bdd2a).

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #1744   +/-   ##
=========================================
  Coverage     42.31%   42.31%           
  Complexity     3180     3180           
=========================================
  Files           794      794           
  Lines         46244    46244           
  Branches       4951     4951           
=========================================
  Hits          19568    19568           
  Misses        25077    25077           
  Partials       1599     1599           
Components Coverage Δ
spanner-templates 63.69% <ø> (ø)
spanner-import-export 64.42% <ø> (ø)
spanner-live-forward-migration 74.97% <ø> (ø)
spanner-live-reverse-replication 51.84% <ø> (ø)
spanner-bulk-migration 82.79% <ø> (ø)

@Polber Polber requested review from Abacn and damccorm July 23, 2024 13:10
@Polber
Copy link
Contributor Author

Polber commented Jul 23, 2024

Test failure unrelated

@Polber Polber merged commit 63072f4 into GoogleCloudPlatform:main Jul 23, 2024
11 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants