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

Migrated databricks_ip_access_list resource to Go SDK #2306

Merged
merged 9 commits into from
May 19, 2023
Merged

Migrated databricks_ip_access_list resource to Go SDK #2306

merged 9 commits into from
May 19, 2023

Conversation

tanmay-db
Copy link
Contributor

@tanmay-db tanmay-db commented May 16, 2023

Changes

  • Migrate IP ACL to Go SDK
  • Update and enable integration tests
  • Fix tests to use body for updates
  • No relevant change is needed to be updated in docs since argument references are the same.

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

Integration test: internal/acceptance/ip_access_list_test.go. Full integration test suite is also running successfully.

@alexott alexott requested review from a team May 16, 2023 18:37
@tanmay-db tanmay-db removed the request for review from a team May 16, 2023 21:03
@tanmay-db tanmay-db changed the title [WIP] Migrated IP ACL to GO SDK [WIP] Migrated IP ACL to Go SDK May 17, 2023
@codecov-commenter
Copy link

codecov-commenter commented May 18, 2023

Codecov Report

Merging #2306 (9656c58) into master (0ad69a8) will decrease coverage by 0.10%.
The diff coverage is 61.53%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2306      +/-   ##
==========================================
- Coverage   88.67%   88.58%   -0.10%     
==========================================
  Files         140      140              
  Lines       11551    11546       -5     
==========================================
- Hits        10243    10228      -15     
- Misses        874      879       +5     
- Partials      434      439       +5     
Impacted Files Coverage Δ
access/resource_ip_access_list.go 80.95% <60.00%> (-19.05%) ⬇️
exporter/importables.go 89.04% <66.66%> (-0.16%) ⬇️

common.DataToStructPointer(d, s, &iacl)
return NewIPAccessListsAPI(ctx, c).Update(d.Id(), iacl)
iacl.IpAccessListId = d.Id()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need to do this because Update call doesn't take id so we have to pass it through the resource data.
Any reason why we don't pass id through the Update method call?

Comment on lines +25 to +26
TestingIpAddresses = []string{"1.2.3.4", "1.2.4.0/24"}
TestingIpAddressesState = []any{"1.2.3.4", "1.2.4.0/24"}
Copy link
Contributor Author

@tanmay-db tanmay-db May 19, 2023

Choose a reason for hiding this comment

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

We should rename this (IP -> Ip) as well for consistency (although not required)

UpdatedAt: 87939234,
UpdatorUserID: 1234556,
Enabled: TestingEnabled,
Method: http.MethodPatch,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Put -> Patch because: https://docs.databricks.com/api-explorer/workspace/ipaccesslists/update update uses PATCH. Can this be breaking for customers? Also why was put using query parameters earlier (wasn't taking expected request)? Should put use body?

Comment on lines -40 to -43
Label string `json:"label"`
ListType string `json:"list_type"`
IPAddresses []string `json:"ip_addresses"`
Enabled bool `json:"enabled,omitempty" tf:"default:true"`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since all these are same, I don't think updates is needed in docs.

@tanmay-db tanmay-db changed the title [WIP] Migrated IP ACL to Go SDK Migrated IP ACL to Go SDK May 19, 2023
@tanmay-db tanmay-db requested review from alexott, nfx and a team May 19, 2023 10:09
Copy link
Contributor

@nfx nfx left a comment

Choose a reason for hiding this comment

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

lgtm for code, make PR title changelog-friendly

@tanmay-db tanmay-db changed the title Migrated IP ACL to Go SDK Migrated databricks_ip_access_list Resource to Go SDK May 19, 2023
@tanmay-db tanmay-db requested a review from nfx May 19, 2023 12:36
@nfx nfx changed the title Migrated databricks_ip_access_list Resource to Go SDK Migrated databricks_ip_access_list resource to Go SDK May 19, 2023
@nfx nfx merged commit 42d62ee into databricks:master May 19, 2023
@nfx nfx mentioned this pull request May 22, 2023
nfx added a commit that referenced this pull request May 22, 2023
 * **Removed support for releasing 32-bit binaries** ([#2315](#2315), [#2320](#2320)).
 * Added more information on impact of using a cluster policy in [databricks_cluster](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/cluster) resource ([#2313](#2313)).
 * Added missing `serverless` option to [databricks_pipeline](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/pipeline) ([#2308](#2308)).
 * Updated `channel` and `edition` values in [databricks_pipeline](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/pipeline) docs ([#2322](#2322)).
 * Automatically add `CAN_MANAGE` permission on [databricks_instance_pool](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/instance_pool) for calling user ([#2298](#2298)).
 * Migrated [databricks_ip_access_list](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/ip_access_list) resource to Go SDK ([#2306](#2306)).

Updated dependency versions:

 * Bump github.com/stretchr/testify from 1.8.2 to 1.8.3 ([#2317](#2317)).
 * Bump github.com/databricks/databricks-sdk-go from v0.8.1 to v0.9.0 ([#2327](#2327)).
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