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

Adds databricks_volumes as data source #3150

Merged
merged 7 commits into from
Feb 2, 2024
Merged

Conversation

karolusz
Copy link
Contributor

Changes

Adds databricks_volumes data source.

A set of volumes ids (full names) becomes available as a data source, in a similar fashion to existing Unity Catalogs objects data sources (e.g. databricks_schemas or databricks_tables).

Closes #3133

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

@karolusz karolusz requested review from a team as code owners January 25, 2024 00:53
@karolusz karolusz requested review from tanmay-db and removed request for a team January 25, 2024 00:53
@karolusz karolusz changed the title Adds databricks_volumes as data source Adds databricks_volumes as data source Jan 27, 2024
Copy link
Contributor

@tanmay-db tanmay-db left a comment

Choose a reason for hiding this comment

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

This looks good to me, however there is concern of usability of list of ids instead of getting information for each id. We should also have databricks_volume resource so we can query information for each id.

In list of ids, maybe we should provide their respective names as well because getting a list of ids won't be very useful in their own. Let's discuss this more in terraform office hours today.

We do this for other data sources as well for example: databricks_share, databricks_service_principal

docs/data-sources/volumes.md Outdated Show resolved Hide resolved
docs/data-sources/volumes.md Show resolved Hide resolved
@karolusz
Copy link
Contributor Author

karolusz commented Jan 29, 2024

This looks good to me, however there is concern of usability of list of ids instead of getting information for each id. We should also have databricks_volume resource so we can query information for each id.

In list of ids, maybe we should provide their respective names as well because getting a list of ids won't be very useful in their own. Let's discuss this more in terraform office hours today.

We do this for other data sources as well for example: databricks_share, databricks_service_principal

The only viable use currently would be to loop over all volumes in the schema when creating databricks_grants resources for those volumes.

databricks_shares and databricks_service_principals data sources return some list of identifiers, which then allows you to reference specific instances of those resources via databricks_share and databricks_service_principal.

Please let me know what is decided internally and I would be happy to make the adjustments accordingly.

Copy link
Contributor

@tanmay-db tanmay-db left a comment

Choose a reason for hiding this comment

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

LGTM given we have similar data sources for schemas, metastores so this is consistent with that.

@codecov-commenter
Copy link

codecov-commenter commented Jan 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (fe54a55) 83.54% compared to head (dca634c) 83.56%.
Report is 5 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3150      +/-   ##
==========================================
+ Coverage   83.54%   83.56%   +0.01%     
==========================================
  Files         168      169       +1     
  Lines       15034    15045      +11     
==========================================
+ Hits        12560    12572      +12     
+ Misses       1733     1732       -1     
  Partials      741      741              
Files Coverage Δ
catalog/data_volumes.go 100.00% <100.00%> (ø)
provider/provider.go 94.47% <100.00%> (+0.03%) ⬆️

... and 1 file with indirect coverage changes

@karolusz
Copy link
Contributor Author

karolusz commented Feb 1, 2024

this will need a little rework after the latest changes

@karolusz
Copy link
Contributor Author

karolusz commented Feb 1, 2024

Small changes were made to solve a merge conflict.

@alexott alexott added this pull request to the merge queue Feb 2, 2024
Merged via the queue into databricks:main with commit 00538fc Feb 2, 2024
5 checks passed
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.

[FEATURE] Data source for databricks_volume
4 participants