terraform-provider-databricks icon indicating copy to clipboard operation
terraform-provider-databricks copied to clipboard

Jobs GoSDK schema migration

Open edwardfeng-db opened this issue 1 year ago • 2 comments

Changes

  • Make typeToSchema check and reuse information for registered resources in the resourceProviderRegistry
  • Taking Library out of the registry because the only customization is not needed in other resources
  • Migrating jobs resource schema to use the GoSDK schema
    • Constructed resource provider with CustomizeSchema function that takes in all of the existing customizations
    • Tried making the new schema as similar as possible to the original schema
    • Updated the schema used in the resource as well as in DataToStructPointer and StructToData function calls
    • Updated resource_job_test
  • Adding CustomizeSchemaResourceSpecific function so that customizations don't always have to be shared for registry references

Tests

  • [x] make test run locally
  • [ ] relevant change in docs/ folder
  • [x] covered with integration tests in internal/acceptance
  • [x] relevant acceptance tests are passing
  • [x] using Go SDK

edwardfeng-db avatar May 02 '24 11:05 edwardfeng-db

Codecov Report

Attention: Patch coverage is 88.55721% with 23 lines in your changes are missing coverage. Please review.

Project coverage is 82.67%. Comparing base (4927dc0) to head (2991cee). Report is 7 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3532      +/-   ##
==========================================
- Coverage   82.69%   82.67%   -0.02%     
==========================================
  Files         183      184       +1     
  Lines       18826    18961     +135     
==========================================
+ Hits        15568    15676     +108     
- Misses       2341     2363      +22     
- Partials      917      922       +5     
Files Coverage Δ
clusters/resource_cluster.go 84.81% <100.00%> (+0.08%) :arrow_up:
clusters/resource_library.go 79.48% <100.00%> (+0.53%) :arrow_up:
jobs/resource_job.go 91.61% <100.00%> (+1.74%) :arrow_up:
common/customizable_schema.go 74.83% <30.00%> (-2.50%) :arrow_down:
common/reflect_resource.go 80.90% <27.27%> (-1.26%) :arrow_down:

... and 8 files with indirect coverage changes

codecov-commenter avatar May 03 '24 11:05 codecov-commenter

Triggered integration tests and confirmed that no failure is related to this change

edwardfeng-db avatar May 04 '24 14:05 edwardfeng-db