spring-attic / spring-cloud-gcp

Integration for Google Cloud Platform APIs with Spring
Apache License 2.0
704 stars 694 forks source link

Fix auditing when running through DatastoreTemplate.performTransaction #2604

Closed fpavageau closed 3 years ago

fpavageau commented 3 years ago

The new DatastoreTemplate instance should have the same ApplicationEventPublisher as the original one, so that AuditingHandler can be called.

Fixes #2603

codecov[bot] commented 3 years ago

Codecov Report

Merging #2604 (fb40156) into master (7231b7d) will decrease coverage by 7.22%. The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2604      +/-   ##
============================================
- Coverage     81.29%   74.06%   -7.23%     
+ Complexity     2396     2168     -228     
============================================
  Files           267      267              
  Lines          7798     7800       +2     
  Branches        808      808              
============================================
- Hits           6339     5777     -562     
- Misses         1113     1644     +531     
- Partials        346      379      +33     
Flag Coverage Δ Complexity Δ
integration ? ?
unittests 74.06% <100.00%> (-0.02%) 0.00 <1.00> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ Complexity Δ
...oud/gcp/data/datastore/core/DatastoreTemplate.java 86.34% <100.00%> (-9.24%) 128.00 <1.00> (-18.00)
...ringframework/cloud/gcp/data/firestore/AutoId.java 0.00% <0.00%> (-100.00%) 0.00% <0.00%> (-3.00%)
...gcp/secretmanager/SecretManagerPropertySource.java 0.00% <0.00%> (-100.00%) 0.00% <0.00%> (-4.00%)
...a/spanner/repository/query/SpannerQueryMethod.java 0.00% <0.00%> (-100.00%) 0.00% <0.00%> (-6.00%)
...retmanager/SecretManagerPropertySourceLocator.java 0.00% <0.00%> (-100.00%) 0.00% <0.00%> (-2.00%)
...figure/config/GcpConfigBootstrapConfiguration.java 0.00% <0.00%> (-100.00%) 0.00% <0.00%> (-2.00%)
...epository/config/SpannerRepositoriesRegistrar.java 0.00% <0.00%> (-100.00%) 0.00% <0.00%> (-3.00%)
...ository/config/DatastoreRepositoriesRegistrar.java 0.00% <0.00%> (-100.00%) 0.00% <0.00%> (-3.00%)
...e/spanner/GcpSpannerEmulatorAutoConfiguration.java 0.00% <0.00%> (-90.91%) 0.00% <0.00%> (-2.00%)
...restore/GcpFirestoreEmulatorAutoConfiguration.java 0.00% <0.00%> (-84.85%) 0.00% <0.00%> (-4.00%)
... and 56 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 7231b7d...278d09c. Read the comment docs.

meltsufin commented 3 years ago

@fpavageau BTW, no need to squash or force-push in branches/PRs because we always squash commits on merge to master. Do you want to add your name to DatastoreTemplate.java? If not, I'm happy to merge.

fpavageau commented 3 years ago

I added my name to the test class, I guess that's enough.