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

Jobs GoSDK schema migration #3532

Merged
merged 3 commits into from
May 8, 2024
Merged

Conversation

edwardfeng-db
Copy link
Contributor

@edwardfeng-db edwardfeng-db commented May 2, 2024

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

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

@edwardfeng-db edwardfeng-db force-pushed the edwardfeng-db/go-sdk-jobs-migration-new branch 2 times, most recently from 99eef11 to 3dfdcd8 Compare May 2, 2024 21:38
@codecov-commenter
Copy link

codecov-commenter commented May 3, 2024

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%) ⬆️
clusters/resource_library.go 79.48% <100.00%> (+0.53%) ⬆️
jobs/resource_job.go 91.61% <100.00%> (+1.74%) ⬆️
common/customizable_schema.go 74.83% <30.00%> (-2.50%) ⬇️
common/reflect_resource.go 80.90% <27.27%> (-1.26%) ⬇️

... and 8 files with indirect coverage changes

@edwardfeng-db edwardfeng-db force-pushed the edwardfeng-db/go-sdk-jobs-migration-new branch from 03ad8ae to 42cfdd3 Compare May 3, 2024 11:30
@edwardfeng-db edwardfeng-db marked this pull request as ready for review May 3, 2024 11:41
@edwardfeng-db edwardfeng-db requested review from a team as code owners May 3, 2024 11:41
@edwardfeng-db edwardfeng-db requested review from hectorcast-db and removed request for a team May 3, 2024 11:41
@edwardfeng-db edwardfeng-db changed the title Jobs GoSDK migration Jobs GoSDK schema migration May 3, 2024
@edwardfeng-db edwardfeng-db requested review from mgyucht and tanmay-db and removed request for hectorcast-db May 3, 2024 11:43
Copy link
Contributor

@mgyucht mgyucht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the autotermination change intentional? Seems like that may be needed/desired only for databricks_cluster resource.

jobs/resource_job.go Outdated Show resolved Hide resolved
jobs/resource_job.go Outdated Show resolved Hide resolved
jobs/resource_job_test.go Outdated Show resolved Hide resolved
@edwardfeng-db edwardfeng-db requested a review from mgyucht May 3, 2024 13:27
@edwardfeng-db edwardfeng-db force-pushed the edwardfeng-db/go-sdk-jobs-migration-new branch from 0c00f75 to b71970b Compare May 4, 2024 13:40
@edwardfeng-db
Copy link
Contributor Author

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

@edwardfeng-db edwardfeng-db requested a review from alexott May 6, 2024 14:51
Copy link
Contributor

@mgyucht mgyucht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job! Almost there. We should remove cluster_id and cluster_source from wherever "new_cluster" appears in this schema, otherwise the new schema looks good.

clusters/resource_cluster.go Outdated Show resolved Hide resolved
common/reflect_resource.go Outdated Show resolved Hide resolved
@edwardfeng-db edwardfeng-db requested a review from mgyucht May 7, 2024 13:20
@mgyucht mgyucht added this pull request to the merge queue May 8, 2024
Merged via the queue into main with commit a285f58 May 8, 2024
5 checks passed
@mgyucht mgyucht deleted the edwardfeng-db/go-sdk-jobs-migration-new branch May 8, 2024 14:56
tanmay-db added a commit that referenced this pull request May 13, 2024
### New Features and Improvements
* fix ([#3542](#3542)).
* Update data_aws_crossaccount_policy to format resource string with account and region ([#3544](#3544)).
* Robust retries for workspace get-status ([#3550](#3550)).
* Fix error message typo in mounts.go ([#3552](#3552)).
* State the options for run_if ([#3548](#3548)).
* Exporter: don't emit all UC objects when handling dependencies ([#3556](#3556)).
* Added state upgrader to remove `max_clusters_per_user` and ebs volume attributes set to zero ([#3551](#3551)).
* Exporter: track removed objects during the `Emit` phase ([#3554](#3554)).
* Jobs GoSDK schema migration ([#3532](#3532)).
* Exporter: optimize generation of `databricks_group_member` resource ([#3559](#3559)).

### Documentation Changes

### Exporter

### Internal Changes
@tanmay-db tanmay-db mentioned this pull request May 13, 2024
github-merge-queue bot pushed a commit that referenced this pull request May 14, 2024
* Release v1.43.0

### New Features and Improvements
* fix ([#3542](#3542)).
* Update data_aws_crossaccount_policy to format resource string with account and region ([#3544](#3544)).
* Robust retries for workspace get-status ([#3550](#3550)).
* Fix error message typo in mounts.go ([#3552](#3552)).
* State the options for run_if ([#3548](#3548)).
* Exporter: don't emit all UC objects when handling dependencies ([#3556](#3556)).
* Added state upgrader to remove `max_clusters_per_user` and ebs volume attributes set to zero ([#3551](#3551)).
* Exporter: track removed objects during the `Emit` phase ([#3554](#3554)).
* Jobs GoSDK schema migration ([#3532](#3532)).
* Exporter: optimize generation of `databricks_group_member` resource ([#3559](#3559)).

### Documentation Changes

### Exporter

### Internal Changes

* -

* -

* -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants