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

Fixed updating owners for UC resources #3189

Merged
merged 17 commits into from
Feb 2, 2024
Merged

Fixed updating owners for UC resources #3189

merged 17 commits into from
Feb 2, 2024

Conversation

tanmay-db
Copy link
Contributor

@tanmay-db tanmay-db commented Jan 31, 2024

Changes

We make additional update request even when there are no other updates other than owner. The error is expected since after updating the owner, we won't be able to update other fields and to fix this we return earlier before proceeding further.

Connections resource would be fixed later once NameArg is removed.

Tests

Unit and Integration tests. Tested the tests individually. Nightly job is running...

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

@tanmay-db tanmay-db requested review from a team as code owners January 31, 2024 16:13
@tanmay-db tanmay-db requested review from mgyucht and removed request for a team January 31, 2024 16:13
@tanmay-db tanmay-db changed the title [WIP] Fix updating owners [WIP] Fix updating owners for UC resources Jan 31, 2024
@codecov-commenter
Copy link

codecov-commenter commented Jan 31, 2024

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Comparison is base (2d5f808) 83.55% compared to head (df401b5) 83.55%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3189   +/-   ##
=======================================
  Coverage   83.55%   83.55%           
=======================================
  Files         168      168           
  Lines       15034    15054   +20     
=======================================
+ Hits        12561    12578   +17     
- Misses       1732     1734    +2     
- Partials      741      742    +1     
Files Coverage Δ
catalog/resource_catalog.go 68.70% <100.00%> (+0.48%) ⬆️
catalog/resource_external_location.go 77.52% <100.00%> (+0.51%) ⬆️
catalog/resource_metastore.go 86.15% <100.00%> (+0.43%) ⬆️
catalog/resource_schema.go 76.78% <100.00%> (+0.42%) ⬆️
sharing/resource_recipient.go 79.66% <100.00%> (+0.71%) ⬆️
catalog/resource_share.go 86.08% <0.00%> (-1.53%) ⬇️
catalog/resource_storage_credential.go 47.40% <50.00%> (+0.06%) ⬆️
catalog/resource_volume.go 85.29% <0.00%> (-2.59%) ⬇️

... and 1 file with indirect coverage changes

@mgyucht
Copy link
Contributor

mgyucht commented Feb 1, 2024

Let's make sure this is integration tested before merging.

@tanmay-db tanmay-db changed the title [WIP] Fix updating owners for UC resources Fix updating owners for UC resources Feb 1, 2024
Copy link
Contributor

@nkvuong nkvuong left a comment

Choose a reason for hiding this comment

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

looks good to me

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.

LGTM, let's make sure integration tests pass.

Can we update the docs to describe the behavior for UC resources? I.e. that when changing owner & other fields, we first update the owner, then other fields, and that other fields are updated using the new owner's permissions, so if your principal is not an owner, you can't change those fields

@tanmay-db
Copy link
Contributor Author

Integration tests passed and added doc.

@tanmay-db tanmay-db changed the title Fix updating owners for UC resources Fixed updating owners for UC resources Feb 2, 2024
@tanmay-db tanmay-db added this pull request to the merge queue Feb 2, 2024
Merged via the queue into main with commit 4213468 Feb 2, 2024
5 checks passed
@tanmay-db tanmay-db deleted the owner-upd branch February 2, 2024 14:04
tanmay-db added a commit that referenced this pull request Feb 5, 2024
### New Features and Improvements
* Exporter: timestamps are now added to log entries ([#3146](#3146)).
* Validate metastore id for databricks_grant and databricks_grants resources ([#3159](#3159)).
* Exporter: Skip emitting of clusters that come from more cluster sources ([#3161](#3161)).
* Fix typo in docs ([#3166](#3166)).
* Migrate cluster schema to use the go-sdk struct ([#3076](#3076)).
* Introduce Generic Settings Resource ([#2997](#2997)).
* Update actions/setup-go to v5 ([#3154](#3154)).
* Change default branch from `master` to `main` ([#3174](#3174)).
* Add .codegen.json configuration ([#3180](#3180)).
* Exporter: performance improvements for big workspaces ([#3167](#3167)).
* update ([#3192](#3192)).
* Exporter: fix generation of cluster policy resources ([#3185](#3185)).
* Fix unit test ([#3201](#3201)).
* Suppress diff should apply to new fields added in the same chained call to CustomizableSchema ([#3200](#3200)).
* Various documentation updates ([#3198](#3198)).
* Use common.Resource consistently throughout the provider ([#3193](#3193)).
* Extending customizable schema with `AtLeastOneOf`, `ExactlyOneOf`, `RequiredWith` ([#3182](#3182)).
* Fix `databricks_connection` regression when creating without owner ([#3186](#3186)).
* add test code for job task order ([#3183](#3183)).
* Allow using empty strings as job parameters ([#3158](#3158)).
* Fix notebook parameters in acceptance test ([#3205](#3205)).
* Exporter: Add retries for `Search`, `ReadContext` and `Import` operations when importing the resource ([#3202](#3202)).
* Fixed updating owners for UC resources ([#3189](#3189)).
* Adds `databricks_volumes` as data source  ([#3150](#3150)).

### Documentation Changes

### Exporter

### Internal Changes
@tanmay-db tanmay-db mentioned this pull request Feb 5, 2024
github-merge-queue bot pushed a commit that referenced this pull request Feb 6, 2024
* Release v1.35.1

### New Features and Improvements
* Exporter: timestamps are now added to log entries ([#3146](#3146)).
* Validate metastore id for databricks_grant and databricks_grants resources ([#3159](#3159)).
* Exporter: Skip emitting of clusters that come from more cluster sources ([#3161](#3161)).
* Fix typo in docs ([#3166](#3166)).
* Migrate cluster schema to use the go-sdk struct ([#3076](#3076)).
* Introduce Generic Settings Resource ([#2997](#2997)).
* Update actions/setup-go to v5 ([#3154](#3154)).
* Change default branch from `master` to `main` ([#3174](#3174)).
* Add .codegen.json configuration ([#3180](#3180)).
* Exporter: performance improvements for big workspaces ([#3167](#3167)).
* update ([#3192](#3192)).
* Exporter: fix generation of cluster policy resources ([#3185](#3185)).
* Fix unit test ([#3201](#3201)).
* Suppress diff should apply to new fields added in the same chained call to CustomizableSchema ([#3200](#3200)).
* Various documentation updates ([#3198](#3198)).
* Use common.Resource consistently throughout the provider ([#3193](#3193)).
* Extending customizable schema with `AtLeastOneOf`, `ExactlyOneOf`, `RequiredWith` ([#3182](#3182)).
* Fix `databricks_connection` regression when creating without owner ([#3186](#3186)).
* add test code for job task order ([#3183](#3183)).
* Allow using empty strings as job parameters ([#3158](#3158)).
* Fix notebook parameters in acceptance test ([#3205](#3205)).
* Exporter: Add retries for `Search`, `ReadContext` and `Import` operations when importing the resource ([#3202](#3202)).
* Fixed updating owners for UC resources ([#3189](#3189)).
* Adds `databricks_volumes` as data source  ([#3150](#3150)).

### Documentation Changes

### Exporter

### Internal Changes

* upd

* readable

* upd

* upd
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.

4 participants