From 409d8e89bc386df3cb5641fd0506b164284b303e Mon Sep 17 00:00:00 2001 From: Tadayuki Onishi Date: Sun, 25 Aug 2024 01:38:27 +0900 Subject: [PATCH 1/4] service/user label to PR by labeler Signed-off-by: Tadayuki Onishi --- .github/labeler.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/labeler.yml b/.github/labeler.yml index 4a77b2f..fe57c63 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,6 +1,9 @@ service/phone: - changed-files: - any-glob-to-any-file: internal/services/phone/**/* +service/user: +- changed-files: + - any-glob-to-any-file: internal/services/user/**/* spec: - changed-files: - any-glob-to-any-file: spec/**/* From 1730641db4d6c188145911a2847655175b553acd Mon Sep 17 00:00:00 2001 From: Tadayuki Onishi Date: Sun, 25 Aug 2024 01:38:45 +0900 Subject: [PATCH 2/4] fix Makefile Signed-off-by: Tadayuki Onishi --- Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index f59e89f..aec25cc 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,7 @@ TEST?=$$(go list ./... |grep -v 'vendor') DEV := folio-sec PROVIDER := zoom -# VERSION := $(shell git describe --abbrev=0 --tags --match "v*") -VERSION := v0.0.1 +VERSION := $(shell cat version) PLUGINS := ${HOME}/bin/plugins/registry.terraform.io/${DEV}/${PROVIDER} BIN := terraform-provider-zoom_${VERSION} @@ -61,7 +60,7 @@ build: @mkdir -p dist go build -o dist/${BIN} . -# Run go build. Output to dist/. +# Run go build. Move artifact to terraform plugins dir .PHONY: build_override build_override: build mkdir -p ${PLUGINS} From f381b00864cf53fc31afeb7295cb0f39ce594d0f Mon Sep 17 00:00:00 2001 From: Tadayuki Onishi Date: Sun, 25 Aug 2024 01:39:02 +0900 Subject: [PATCH 3/4] update readme Signed-off-by: Tadayuki Onishi --- README.md | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 71 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index dc6cb06..d5ee802 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,15 @@ - Examples (`examples/`) and generated documentation (`docs/`), - Miscellaneous meta files. +## Documentation + +Full, comprehensive documentation is available on the [Terraform Registory](https://registry.terraform.io/providers/folio-sec/zoom). [API documentation](https://developers.zoom.us/docs/api/) is also available for non-Terraform or service specific information. + ## Requirements - [Terraform](https://developer.hashicorp.com/terraform/downloads) - [Go](https://golang.org/doc/install) +- [Node.js](https://nodejs.org/en/download/package-manager) (to patch Open API Specification files) ## Building The Provider @@ -68,14 +73,75 @@ In order to run the full suite of Acceptance tests, run `make testacc`. ## Debugging the Provider +Setup your zoom application from https://marketplace.zoom.us/user/build then get the secrets beforehand. + +### Case 1. Local install + +You can debug developing provider using following steps: + +1. `make local_install` +1. Edit `~/.terraformrc` using the output comment +1. `cd examples/resources/zoom_phone_autoreceiptionist` +1. `TF_LOG_PROVIDER=debug terraform apply` + +### Case 2. Using Visual Studio Code + You can debug developing provider using following steps: -- Setup your zoom application from https://marketplace.zoom.us/user/build then get the secrets. -- `make local_install` -- Edit `~/.terraformrc` using the output comment -- `cd examples/resources/zoom_phone_autoreceiptionist` -- `TF_LOG_PROVIDER=debug terraform apply` +1. Launch your Visual Studio Code app +1. Select `Debug Terraform Provier` configuration and start a debugging session from "Run and Debug" view +1. Copy a `TF_REATTACH_PROVIDERS={...}` output from "Debug Console" tab +1. `cd examples/resources/zoom_phone_autoreceiptionist` +1. `TF_REATTACH_PROVIDERS={...} TF_LOG_PROVIDER=debug terraform apply` ## Release We use release management by [tagpr](https://github.com/Songmu/tagpr). When merging tagpr PR, next version would be released by github-actions. + +## Contribution + +See also [CONTRIBUTING.md](CONTRIBUTING.md). + +### DCO Sign-Off Methods + +The sign-off is a simple line at the end of the explanation for the patch, which certifies that you wrote it or otherwise have the right to pass it on as an open-source patch. + +The DCO requires a sign-off message in the following format appear on each commit in the pull request: + +```txt +Signed-off-by: Sample Developer sample@example.com +``` + +The text can either be manually added to your commit body, or you can add either `-s` or `--signoff` to your usual `git` commit commands. + +#### Auto sign-off + +The following method is examples only and are not mandatory. + +```sh +touch .git/hooks/prepare-commit-msg +chmod +x .git/hooks/prepare-commit-msg +``` + +Edit the `prepare-commit-msg` file like: + +```sh +#!/bin/sh + +name=$(git config user.name) +email=$(git config user.email) + +if [ -z "${name}" ]; then + echo "empty git config user.name" + exit 1 +fi + +if [ -z "${email}" ]; then + echo "empty git config user.email" + exit 1 +fi + +git interpret-trailers --if-exists doNothing --trailer \ + "Signed-off-by: ${name} <${email}>" \ + --in-place "$1" +``` From ef90651ab9dada0fbea87f9622f4cddc02daa345 Mon Sep 17 00:00:00 2001 From: Tadayuki Onishi Date: Sun, 25 Aug 2024 01:45:49 +0900 Subject: [PATCH 4/4] fix makefile version format Signed-off-by: Tadayuki Onishi --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index aec25cc..cf073c7 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ TEST?=$$(go list ./... |grep -v 'vendor') DEV := folio-sec PROVIDER := zoom -VERSION := $(shell cat version) +VERSION := v$(shell cat version) PLUGINS := ${HOME}/bin/plugins/registry.terraform.io/${DEV}/${PROVIDER} BIN := terraform-provider-zoom_${VERSION}