-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate changelog, add a Makefile and Dependabot support (#105)
- Loading branch information
Showing
155 changed files
with
1,533 additions
and
1,518 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Maintained by the Couchbase Capella DevEx Integrations team | ||
* @couchbasecloud/couchbase-capella-terraform-provider-team |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: gomod | ||
directory: "/" | ||
schedule: | ||
interval: weekly | ||
day: wednesday | ||
reviewers: | ||
- "couchbasecloud/couchbase-capella-terraform-provider-team" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Acceptance Tests | ||
concurrency: | ||
group: acceptance-tests | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- 'README.md' | ||
- 'CHANGELOG.md' | ||
- 'LICENSE' | ||
- 'Makefile' | ||
- 'docs/**' | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
TF_VAR_auth_token: ${{ secrets.CAPELLA_AUTH_TOKEN }} | ||
TF_VAR_organization_id: ${{ secrets.CAPELLA_ORGANIZATION_ID }} | ||
TF_VAR_host: ${{ secrets.CAPELLA_HOST }} | ||
|
||
steps: | ||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v4 | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: 'go.mod' | ||
id: go | ||
- uses: actions/cache@v3 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go${{ env.GO_VERSION }}-${{ hashFiles('**/go.sum') }} | ||
- name: Run acceptance tests | ||
run: make testacc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Lint | ||
on: [pull_request] | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: read | ||
|
||
jobs: | ||
golangci: | ||
name: golangci-lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # needed for `only-new-issues` to compare diffs | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: 'go.mod' | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: latest | ||
args: "--config .golangci.yml" | ||
only-new-issues: true | ||
|
||
tfproviderlint: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: 'go.mod' | ||
- run: make tfcheck |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Unit Tests | ||
on: [pull_request] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code repository source code | ||
uses: actions/checkout@v4 | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: 'go.mod' | ||
id: go | ||
- uses: actions/cache@v3 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go${{ env.GO_VERSION }}-${{ hashFiles('**/go.sum') }} | ||
- name: Vet | ||
run: make vet | ||
- name: Test | ||
run: make test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
future-release=v1.0.0 | ||
since-tag=v1.0.0 | ||
date-format=%Y-%m-%d | ||
base=CHANGELOG.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,33 @@ | ||
# 1.0.0 (Unreleased) | ||
# Changelog | ||
|
||
## October 18 2023 | ||
UPGRADE NOTES: | ||
- Upgraded provider to use Golang 1.20+ and Terraform 1.5+ | ||
- Upgraded terraform-plugin-framework to 1.4.1 | ||
## [v1.0.0](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/tree/v1.0.0) (2023-11-10) | ||
|
||
BUG FIXES: | ||
- Update cluster will no longer fail for PoC organization with developer pro plan. | ||
- User removed from organization from Capella UI won't break the terraform provider. | ||
[Full Changelog](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/compare/d9a774ce9a0731bd15a6ca9eb9b7ea4d7f4e1d33...v1.0.0) | ||
|
||
ENHANCEMENTS: | ||
- Detailed examples and README with sample outputs | ||
**Merged pull requests:** | ||
|
||
- \[AV-67237\] Code Health - Create Acceptance Test Directory [\#87](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/pull/87) ([matty271828](https://github.com/matty271828)) | ||
- \[AV-64820\] App Services Terraform Provider Feature Branch [\#84](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/pull/84) ([nidhi07kumar](https://github.com/nidhi07kumar)) | ||
- \[AV-67060\] PP Bugs - Pass in sort by parameter [\#83](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/pull/83) ([matty271828](https://github.com/matty271828)) | ||
- \[AV-62009\] Code Health - Pass in Success Codes to Client [\#80](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/pull/80) ([matty271828](https://github.com/matty271828)) | ||
- \[AV-66360\] PP Bugs - Make resource object optional [\#76](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/pull/76) ([matty271828](https://github.com/matty271828)) | ||
- \[AV-65775\] List APIs - Database Credentials & Buckets Pagination [\#74](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/pull/74) ([matty271828](https://github.com/matty271828)) | ||
- \[AV-65679\] List APIs - Users, ApiKeys & Clusters Pagination [\#73](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/pull/73) ([matty271828](https://github.com/matty271828)) | ||
- \[AV-65771\] List APIs - Projects pagination [\#72](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/pull/72) ([matty271828](https://github.com/matty271828)) | ||
- \[AV-65452\] CREATE bucket with optional fields [\#68](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/pull/68) ([nidhi07kumar](https://github.com/nidhi07kumar)) | ||
- AV-66047 Add PR template [\#67](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/pull/67) ([rijuCB](https://github.com/rijuCB)) | ||
- Bump google.golang.org/grpc from 1.57.0 to 1.57.1 [\#66](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/pull/66) ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- \[AV-65773\] Allowlists Datasource - Pagination [\#65](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/pull/65) ([matty271828](https://github.com/matty271828)) | ||
- \[AV-65899\] PP Bugs - Move project roles into same array [\#64](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/pull/64) ([matty271828](https://github.com/matty271828)) | ||
- \[AV-63471\] User Resource - Update user using patch request [\#62](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/pull/62) ([matty271828](https://github.com/matty271828)) | ||
- \[AV-65088\] Better access example for creating db user [\#61](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/pull/61) ([Talina06](https://github.com/Talina06)) | ||
- \[AV-65076\] Fixed template.tfvars files for examples [\#60](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/pull/60) ([nidhi07kumar](https://github.com/nidhi07kumar)) | ||
- \[AV-64976\] User refresh state for users deleted from UI [\#59](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/pull/59) ([nidhi07kumar](https://github.com/nidhi07kumar)) | ||
- Fix added for various resources creation failing in main branch [\#58](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/pull/58) ([aniket-Kumar-c](https://github.com/aniket-Kumar-c)) | ||
- AV-65056: acceptance test poc for project [\#54](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/pull/54) ([aniket-Kumar-c](https://github.com/aniket-Kumar-c)) | ||
- Bump golang.org/x/net from 0.13.0 to 0.17.0 [\#51](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/pull/51) ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- \[AV-64572\] Code Health - Extract Schema State Validation [\#50](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/pull/50) ([matty271828](https://github.com/matty271828)) | ||
|
||
|
||
|
||
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor) | ||
|
||
BINARY_NAME=terraform-provider-couchbase-capella | ||
DESTINATION=./bin/$(BINARY_NAME) | ||
|
||
GOFLAGS=-mod=vendor | ||
GOOPTS="-p 2" | ||
GOFMT_FILES?=$$(find . -name '*.go') | ||
|
||
GITTAG=$(shell git describe --always --tags) | ||
VERSION=$(GITTAG:v%=%) | ||
LINKER_FLAGS=-s -w -X 'github.com/couchbasecloud/terraform-provider-couchbase-cloud/version.ProviderVersion=${VERSION}' | ||
|
||
GOLANGCI_VERSION=v1.55.2 | ||
|
||
export PATH := $(shell go env GOPATH)/bin:$(PATH) | ||
export SHELL := env PATH=$(PATH) /bin/bash | ||
|
||
default: build | ||
|
||
# Tries to configure GOPATH if it isn't set. | ||
ifndef $(GOPATH) | ||
GOPATH=$(shell go env GOPATH) | ||
endif | ||
|
||
.PHONY: help | ||
help: | ||
@grep -h -E '^[a-zA-Z_-]+:.*?$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | ||
|
||
.PHONY: build | ||
build: fmt | ||
go build -ldflags "$(LINKER_FLAGS)" -o $(DESTINATION) | ||
|
||
.PHONY: fmt | ||
fmt: | ||
@echo "==> Fixing source code with gofmt..." | ||
gofmt -s -w $(GOFMT_FILES) | ||
|
||
.PHONY: vet | ||
vet: | ||
@echo "==> Running go vet ." | ||
@go vet ./... ; if [ $$? -ne 0 ]; then \ | ||
echo ""; \ | ||
echo "Vet found suspicious constructs. Please check the reported constructs"; \ | ||
echo "and fix them if necessary before submitting the code for review."; \ | ||
exit 1; \ | ||
fi | ||
|
||
.PHONY: lint-fix | ||
lint-fix: | ||
@echo "==> Fixing linters errors..." | ||
fieldalignment -json -fix ./... | ||
golangci-lint run --fix | ||
|
||
.PHONY: setup | ||
setup: ## Install dev tools | ||
@echo "==> Installing dependencies..." | ||
go install github.com/client9/misspell/cmd/misspell@latest | ||
go install golang.org/x/tools/go/analysis/passes/fieldalignment/cmd/fieldalignment@latest | ||
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin $(GOLANGCI_VERSION) | ||
|
||
.PHONY: check | ||
check: tffmt tfcheck fmt docs-lint lint-fix test testacc | ||
|
||
.PHONY: docs-lint | ||
docs-lint: | ||
@echo "==> Checking docs against linters..." | ||
@misspell -error -source=text docs/ | ||
|
||
.PHONY: docs | ||
docs: | ||
@echo "Use this site to preview markdown rendering: https://registry.terraform.io/tools/doc-preview" | ||
|
||
.PHONY: terraform-check tfcheck | ||
tfcheck: terraform-check | ||
terraform-check: | ||
@terraform fmt -check=true -diff -recursive . | ||
|
||
.PHONY: terraform-fmt tffmt | ||
tffmt: terraform-fmt | ||
terraform-fmt: | ||
@terraform fmt -write -recursive -diff . | ||
.PHONY: terraform-check tfcheck | ||
|
||
TEST_FLAGS ?= -short -cover -race | ||
|
||
.PHONY: test | ||
test: | ||
go test $(TEST_FLAGS) ./... | ||
|
||
.PHONY: test-acceptance testacc | ||
testacc: test-acceptance | ||
test-acceptance: | ||
@[ "${TF_VAR_auth_token}" ] || ( echo "export TF_VAR_auth_token before running the acceptance tests"; exit 1 ) | ||
@[ "${TF_VAR_host}" ] || ( echo "export TF_VAR_host before running the acceptance tests"; exit 1 ) | ||
@[ "${TF_VAR_organization_id}" ] || ( echo "export TF_VAR_organization_id before running the acceptance tests"; exit 1 ) | ||
TF_ACC=1 go test -timeout=300m -v ./... -run TestAccOrganizationDataSource -run TestAccProjectResource -run TestAccCreateProjectWithReqFields -run TestAccCreateProjectOptFields -run TestAccValidProjectUpdate -run TestAccInvalidProjectResource -run TestAccDeleteProjectBeforeDestroy -run TestAccClusterResourceAzure -run TestAccClusterResourceGCP -run TestAccClusterResourceWithOnlyReqFieldAWS | ||
|
||
|
Oops, something went wrong.