Skip to content

Commit

Permalink
[Internal] Bumped terraform-plugin-framework branch to latest main (
Browse files Browse the repository at this point in the history
#3780)

## Changes
<!-- Summary of your changes that are easy to understand -->
Rebase the Plugin Framework branch to latest main + resolve conflicts:
9e8fd30

This needs to be merged before
#3719
can be merged. Rebasing the PR over main will lead to many
commits/changes so separating them in this PR.

## Tests
<!-- 
How is this tested? Please see the checklist below and also describe any
other relevant tests
-->
Unit 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

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: vuong-nguyen <44292934+nkvuong@users.noreply.github.com>
Co-authored-by: Alex Moschos <166370939+alexmos-db@users.noreply.github.com>
Co-authored-by: hectorcast-db <hector.castejon@databricks.com>
Co-authored-by: Aleksandar Dragojević <stingermssl@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alex Ott <alexey.ott@databricks.com>
Co-authored-by: Karol <lus.karol@gmail.com>
Co-authored-by: touchida <56789230+touchida@users.noreply.github.com>
Co-authored-by: Miles Yucht <miles@databricks.com>
Co-authored-by: Pieter Noordhuis <pieter.noordhuis@databricks.com>
Co-authored-by: mkubicek <milan.kubicek@mba.sdabocconi.it>
Co-authored-by: Renaud Hartert <renaud.hartert@databricks.com>
Co-authored-by: Divyansh Vijayvergia <171924202+Divyansh-db@users.noreply.github.com>
  • Loading branch information
14 people authored Jul 17, 2024
1 parent be7d694 commit 1f88025
Show file tree
Hide file tree
Showing 144 changed files with 3,278 additions and 962 deletions.
1 change: 1 addition & 0 deletions .codegen.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"formatter": "make fmt",
"changelog_config": ".codegen/changelog_config.yml",
"packages": {
".codegen/model.go.tmpl": "service/{{.Name}}_tf/model.go"
},
Expand Down
18 changes: 4 additions & 14 deletions .codegen/changelog.md.tmpl
Original file line number Diff line number Diff line change
@@ -1,22 +1,12 @@
# Version changelog

## {{.Version}}
{{- range .GroupChanges}}

### New Features and Improvements
{{range .Changes -}}
### {{.Type.Message}}
{{range .Changes}}
* {{.}}.
{{end}}

### Documentation Changes

### Exporter

### Internal Changes
{{if .DependencyUpdates}}
Dependency updates:
{{range .DependencyUpdates}}
* {{.}}.
{{- end -}}
{{- end}}
{{end}}

## {{.PrevVersion}}
18 changes: 18 additions & 0 deletions .codegen/changelog_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
change_types:
- message: New Features and Improvements
tag: "[Feature]"
- message: Bug Fixes
tag: "[Fix]"
- message: Documentation
tag: "[Doc]"
- message: Internal Changes
tag: "[Internal]"
- message: Dependency Updates
tag: "[Dependency]"
- message: Exporter
tag: "[Exporter]"
# Does not appear in the Changelog. Only for PR validation.
- message: Release
tag: "[Release]"
# Default for messages without a tag
- message: Other Changes
2 changes: 2 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ updates:
directory: "/"
schedule:
interval: "daily"
commit-message:
prefix: "[Dependency] "
25 changes: 25 additions & 0 deletions .github/workflows/message.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Validate Commit Message

on:
pull_request:
types: [opened, synchronize, edited]

jobs:

validate:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Validate Tag
run: |
TAG=$(echo ${{ github.event.pull_request.title }} | sed -ne 's/\[\(.*\)\].*/\1/p')
if grep -q "tag: \"\[$TAG\]\"" .codegen/changelog_config.yml; then
echo "Valid tag found: [$TAG]"
else
echo "Invalid or missing tag in commit message: [$TAG]"
exit 1
fi
14 changes: 10 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
tags:
- '*'
merge_group:
types: [checks_requested]

jobs:
goreleaser:
Expand All @@ -19,21 +21,25 @@ jobs:
with:
go-version: 1.22.x

# The default cache key for this action considers only the `go.sum` file.
# We include .goreleaser.yaml here to differentiate from the cache used by the push action
# that runs unit tests. This job produces and uses a different cache.
cache-dependency-path: |
go.sum
.goreleaser.yml
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v2
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
PASSPHRASE: ${{ secrets.PASSPHRASE }}

- name: Pull external libraries
run: make vendor

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: ~> v2
args: release --clean
args: release --clean ${{ !startsWith(github.ref, 'refs/tags/v') && '--snapshot' || '' }}
env:
# use GITHUB_TOKEN that is already available in secrets.GITHUB_TOKEN
# https://docs.github.com/en/free-pro-team@latest/actions/reference/authentication-in-a-workflow#permissions-for-the-github_token
Expand Down
11 changes: 10 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
version: 2

before:
hooks:
- go mod download

builds:
- env:
- CGO_ENABLED=0
Expand All @@ -15,18 +18,22 @@ builds:
goarch:
- amd64
- arm64

archives:
- format: zip
name_template: '{{ .ProjectName }}_{{ replace .Version "v" "" }}_{{ .Os }}_{{ .Arch }}'
files:
- LICENSE*
- CHANGELOG*
- NOTICE*

checksum:
name_template: '{{ .ProjectName }}_{{ replace .Version "v" "" }}_SHA256SUMS'
algorithm: sha256

snapshot:
name_template: "{{ .Tag }}"

signs:
- artifacts: checksum
args:
Expand All @@ -36,11 +43,13 @@ signs:
- "${signature}"
- "--detach-sign"
- "${artifact}"

changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'

release:
draft: true
draft: true
3 changes: 3 additions & 0 deletions .terraform-registry
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Request: Change owner to @mgyucht
Registry link: https://registry.terraform.io/namespaces/databricks, https://registry.terraform.io/providers/databricks/databricks/latest/docs
Request by: miles@databricks.com
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Version changelog

## 1.48.3

### Internal Changes
* Bump Go SDK to `0.43.2` ([#3750](https://github.com/databricks/terraform-provider-databricks/pull/3750))
* Added new `APIErrorBody` struct and update deps ([#3745](https://github.com/databricks/terraform-provider-databricks/pull/3745))

## 1.48.2

### New Features and Improvements
* Added isolation mode support for `databricks_external_location` & `databricks_storage_credential` ([#3704](https://github.com/databricks/terraform-provider-databricks/pull/3704)).
* Add terraform support for periodic triggers ([#3700](https://github.com/databricks/terraform-provider-databricks/pull/3700)).


## 1.48.1

### New Features and Improvements
Expand Down
12 changes: 6 additions & 6 deletions access/resource_ip_access_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"net/http"
"testing"

"github.com/databricks/databricks-sdk-go/apierr"
"github.com/databricks/databricks-sdk-go/service/settings"
"github.com/databricks/terraform-provider-databricks/common"
"github.com/databricks/terraform-provider-databricks/qa"

"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -93,7 +93,7 @@ func TestAPIACLCreate_Error(t *testing.T) {
{
Method: http.MethodPost,
Resource: "/api/2.0/ip-access-lists",
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "RESOURCE_ALREADY_EXISTS",
Message: "IP access list with type (" + TestingListTypeString + ") and label (" + TestingLabel + ") already exists",
},
Expand Down Expand Up @@ -185,7 +185,7 @@ func TestIPACLUpdate_Error(t *testing.T) {
ExpectedRequest: settings.UpdateIpAccessList{
Enabled: TestingEnabled,
},
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "SERVER_ERROR",
Message: "Something unexpected happened",
},
Expand Down Expand Up @@ -240,7 +240,7 @@ func TestIPACLRead_NotFound(t *testing.T) {
{
Method: http.MethodGet,
Resource: "/api/2.0/ip-access-lists/" + TestingId + "?",
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "RESOURCE_DOES_NOT_EXIST",
Message: "Can't find an IP access list with id: " + TestingId + ".",
},
Expand All @@ -260,7 +260,7 @@ func TestIPACLRead_Error(t *testing.T) {
{
Method: http.MethodGet,
Resource: "/api/2.0/ip-access-lists/" + TestingId + "?",
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "SERVER_ERROR",
Message: "Something unexpected happened",
},
Expand Down Expand Up @@ -298,7 +298,7 @@ func TestIPACLDelete_Error(t *testing.T) {
{
Method: http.MethodDelete,
Resource: fmt.Sprintf("/api/2.0/ip-access-lists/%s?", TestingId),
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "INVALID_STATE",
Message: "Something went wrong",
},
Expand Down
14 changes: 7 additions & 7 deletions aws/resource_group_instance_profile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package aws
import (
"testing"

"github.com/databricks/databricks-sdk-go/apierr"
"github.com/databricks/terraform-provider-databricks/common"
"github.com/databricks/terraform-provider-databricks/scim"

"github.com/databricks/terraform-provider-databricks/qa"
Expand Down Expand Up @@ -56,7 +56,7 @@ func TestResourceGroupInstanceProfileCreate_Error(t *testing.T) {
{
Method: "PATCH",
Resource: "/api/2.0/preview/scim/v2/Groups/abc",
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "INVALID_REQUEST",
Message: "Internal error happened",
},
Expand All @@ -80,7 +80,7 @@ func TestResourceGroupInstanceProfileCreate_Error_InvalidARN(t *testing.T) {
{
Method: "PATCH",
Resource: "/api/2.0/preview/scim/v2/Groups/abc",
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "INVALID_REQUEST",
Message: "Internal error happened",
},
Expand All @@ -103,7 +103,7 @@ func TestResourceGroupInstanceProfileCreate_Error_OtherARN(t *testing.T) {
{
Method: "PATCH",
Resource: "/api/2.0/preview/scim/v2/Groups/abc",
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "INVALID_REQUEST",
Message: "Internal error happened",
},
Expand Down Expand Up @@ -152,7 +152,7 @@ func TestResourceGroupInstanceProfileRead_NotFound(t *testing.T) {
{
Method: "GET",
Resource: "/api/2.0/preview/scim/v2/Groups/abc?attributes=roles",
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "NOT_FOUND",
Message: "Item not found",
},
Expand Down Expand Up @@ -192,7 +192,7 @@ func TestResourceGroupInstanceProfileRead_Error(t *testing.T) {
{
Method: "GET",
Resource: "/api/2.0/preview/scim/v2/Groups/abc?attributes=roles",
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "INVALID_REQUEST",
Message: "Internal error happened",
},
Expand Down Expand Up @@ -232,7 +232,7 @@ func TestResourceGroupInstanceProfileDelete_Error(t *testing.T) {
{
Method: "PATCH",
Resource: "/api/2.0/preview/scim/v2/Groups/abc",
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "INVALID_REQUEST",
Message: "Internal error happened",
},
Expand Down
10 changes: 5 additions & 5 deletions aws/resource_instance_profile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package aws
import (
"testing"

"github.com/databricks/databricks-sdk-go/apierr"
"github.com/databricks/terraform-provider-databricks/common"
"github.com/databricks/terraform-provider-databricks/qa"

"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -114,7 +114,7 @@ func TestResourceInstanceProfileCreate_Error(t *testing.T) {
{
Method: "POST",
Resource: "/api/2.0/instance-profiles/add",
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "INVALID_REQUEST",
Message: "Internal error happened",
},
Expand Down Expand Up @@ -249,7 +249,7 @@ func TestResourceInstanceProfileRead_Error(t *testing.T) {
{
Method: "GET",
Resource: "/api/2.0/instance-profiles/list",
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "INVALID_REQUEST",
Message: "Internal error happened",
},
Expand Down Expand Up @@ -289,7 +289,7 @@ func TestResourceInstanceProfileDelete_Error(t *testing.T) {
{
Method: "POST",
Resource: "/api/2.0/instance-profiles/remove",
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "INVALID_REQUEST",
Message: "Internal error happened",
},
Expand Down Expand Up @@ -356,7 +356,7 @@ func TestResourceInstanceProfileUpdate_Error(t *testing.T) {
{
Method: "POST",
Resource: "/api/2.0/instance-profiles/edit",
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "INVALID_REQUEST",
Message: "Internal error happened",
},
Expand Down
6 changes: 3 additions & 3 deletions aws/resource_service_principal_role_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package aws
import (
"testing"

"github.com/databricks/databricks-sdk-go/apierr"
"github.com/databricks/terraform-provider-databricks/common"
"github.com/databricks/terraform-provider-databricks/scim"

"github.com/databricks/terraform-provider-databricks/qa"
Expand Down Expand Up @@ -53,7 +53,7 @@ func TestResourceServicePrincipalRoleCreate_Error(t *testing.T) {
{
Method: "PATCH",
Resource: "/api/2.0/preview/scim/v2/ServicePrincipals/abc",
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "INVALID_REQUEST",
Message: "Internal error happened",
},
Expand Down Expand Up @@ -119,7 +119,7 @@ func TestResourceServicePrincipalRoleRead_NotFound(t *testing.T) {
{
Method: "GET",
Resource: "/api/2.0/preview/scim/v2/ServicePrincipals/abc?attributes=roles",
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "NOT_FOUND",
Message: "Item not found",
},
Expand Down
Loading

0 comments on commit 1f88025

Please sign in to comment.