diff --git a/.github/ISSUE_TEMPLATE/00_bug_report.yml b/.github/ISSUE_TEMPLATE/00_bug_report.yml new file mode 100644 index 0000000..3482ca7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/00_bug_report.yml @@ -0,0 +1,158 @@ +name: "Report a Bug" +description: "Create a bug report to help us improve." +title: "[Bug]: " +labels: ["bug"] +body: + - type: markdown + attributes: + value: | + Hi there, + Thank you for opening an issue! Please note that we try to keep the this issue tracker reserved for + bug reports and feature requests related to the InfluxDB provider. + + - type: markdown + attributes: + value: | + # Terraform and InfluxDB V3 Provider Versions + + Please run `terraform -v` to show the Terraform Core and provider version(s). If you are not running the latest version of either the provider or Terraform Core, please consider upgrading, as your issue may have already been fixed. + + [Terraform documentation on provider versioning](https://www.terraform.io/docs/configuration/providers.html#provider-versions) + + - type: input + id: tf_version + attributes: + label: Terraform Core Version + description: The semantic version of Terraform Core used when experiencing the bug. If multiple versions have been tested, a comma separated list. + placeholder: "X.Y.Z" + validations: + required: true + + - type: input + id: influxdb_version + attributes: + label: InfluxDB V3 Provider Version + description: The semantic version of the InfluxDB V3 Provider used when experiencing the bug. If multiple versions have been tested, a comma separated list. + placeholder: "X.Y.Z" + validations: + required: true + + - type: markdown + attributes: + value: | + # Description + + In the next few fields, please provide any useful information you can around what resources are affected, what you expected to happen, and what actually happened. There is also a field to optionally provide a small snippet of any relevant error or panic output. + + Note that there is a section later in the form to provide more complete Terraform configuration and logging information. These fields should instead be thought of as the place to briefly describe the bug. + + - type: textarea + id: affected + attributes: + label: Affected Resource(s) + description: Please list the affected resource(s) and/or data source(s). + placeholder: "* influxdb3_xxx" + validations: + required: false + + - type: textarea + id: expected-behavior + attributes: + label: Expected Behavior + description: What should have happened? + validations: + required: true + + - type: textarea + id: actual-behavior + attributes: + label: Actual Behavior + description: What actually happened? + validations: + required: true + + - type: textarea + id: log_snippet + attributes: + label: Relevant Error/Panic Output Snippet + description: | + If applicable, provide a relevant snippet from the error or panic output. This will be rendered as `shell`, so there is no need to add a [code fence](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks). + render: shell + validations: + required: false + + - type: markdown + attributes: + value: | + # Configuration and Logging + + Here, we ask that you provide the Terraform configuration and, when possible, the debug logs. For configurations or logs of more than just a few lines, it's preferred to either share a Gist link or zip the files and upload them. + + Terraform configurations or debug logs under 25MB may be [attached directly in the field](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/attaching-files). Files larger than this should be uploaded to a file hosting service and a link shared. + + For your security you can also encrypt the files using our [GPG public key](https://keybase.io/hashicorp). + + **Note:** These form fields do not automatically render, so you will need to use [code fence(s)](https://help.github.com/articles/basic-writing-and-formatting-syntax/#quoting-code) to achieve proper formatting. + + - type: textarea + id: tf_config + attributes: + label: Terraform Configuration Files + description: | + Please paste, upload, or link to a file or Gist containing all Terraform configurations required to reproduce the bug. See note above for additional information on file size restrictions and encrypting. + + Bug reports without a functional reproduction may be closed without investigation. + validations: + required: true + + - type: textarea + id: repro + attributes: + label: Steps to Reproduce + description: Please list the steps required to reproduce the issue. + validations: + required: true + + - type: textarea + id: debug_logs + attributes: + label: Debug Output + description: | + If possible, please paste, upload, or link to a file or Gist containing debug logs. See note above for additional information on file size restrictions and encrypting. + + To obtain the debug output, see the [Terraform documentation on debugging](https://www.terraform.io/docs/internals/debugging.html). + validations: + required: false + + - type: textarea + id: panic_logs + attributes: + label: Panic Output + description: If Terraform produced a panic, please paste, upload, or link to a file or Gist containing the output of the `crash.log`. + validations: + required: false + + - type: markdown + attributes: + value: | + # Additional Information + + For the final two fields, optionally provide any additional context that might help the community or maintainers to investigate the bug. This might be additional references that you found when troubleshooting, similar bug reports, or specifics about your environment that might be unique. + + - type: textarea + attributes: + label: Important Factoids + description: Are there anything atypical about your configuration or environment that we should know about? + validations: + required: false + + - type: textarea + id: references + attributes: + label: References + description: | + Where possible, please supply links to vendor documentation, other GitHub issues (open or closed) or pull requests that give additional context. + + [Information about referencing Github Issues](https://help.github.com/articles/basic-writing-and-formatting-syntax/#referencing-issues-and-pull-requests) + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/01_feature_request.md b/.github/ISSUE_TEMPLATE/01_feature_request.md new file mode 100644 index 0000000..a04895a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/01_feature_request.md @@ -0,0 +1,41 @@ +--- +name: Feature request +about: Suggest a new feature or other enhancement. +labels: feature-request + +--- + + + + +#### Use-cases + + +#### Attempted Solutions + + +#### Proposal + diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..3915c08 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: Terraform Language or Workflow Questions + url: https://discuss.hashicorp.com + about: Please ask Terraform language or workflow related questions through the HashiCorp Discuss forum \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..083500a --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,42 @@ + +### Description + + + +### Relations + + +Closes #0000 + +### References + + + +### Output from Acceptance Testing + + +```console +% make testacc + +... +``` diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..73bb4d3 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,15 @@ +# See GitHub's documentation for more information on this file: +# https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates +version: 2 +updates: + - package-ecosystem: "gomod" + directory: "/" + schedule: + interval: "daily" + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + # TODO: Dependabot only updates hashicorp GHAs in the template repository, the following lines can be removed for consumers of this template + allow: + - dependency-name: "hashicorp/*" diff --git a/.github/workflows/auto-assign.yml b/.github/workflows/auto-assign.yml new file mode 100644 index 0000000..9edd200 --- /dev/null +++ b/.github/workflows/auto-assign.yml @@ -0,0 +1,19 @@ +name: PR +on: + issues: + types: [opened] + pull_request: + types: [opened] +jobs: + auto-assign: + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + steps: + - name: 'Auto-assign issue' + uses: pozil/auto-assign-issue@v1 + with: + repo-token: ${{ secrets.BOT_GITHUB_TOKEN }} + assignees: thulasirajkomminar + numOfAssignee: 1 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..5ba5f9b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,32 @@ +name: CI + +on: + pull_request: + branches: + - main + paths-ignore: + - docs/** + - examples/** + - .github/** + +jobs: + codecov: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - uses: actions/setup-go@v5 + with: + go-version: 'stable' + + - name: Gather dependencies + run: go mod download + + - name: Run coverage + run: go test -race -coverprofile=coverage.txt -covermode=atomic ./... + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_ORG_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 0000000..bc6dbcb --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -0,0 +1,36 @@ +name: PR + +on: + pull_request: + branches: + - main + paths-ignore: + - docs/** + - examples/** + - .github/** + +permissions: + checks: write + contents: read + pull-requests: write + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + fetch-depth: 0 + + - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 + with: + go-version-file: "go.mod" + cache: true + + - name: Install GoReleaser + uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0 + with: + install-only: true + + - name: Run GoReleaser + run: goreleaser build --clean --skip=validate diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..3eb4d1f --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,41 @@ +# Terraform Provider release workflow. +name: Release + +# This GitHub action creates a release when a tag that matches the pattern +# "v*" (e.g. v0.1.0) is created. +on: + push: + tags: + - 'v*' + +# Releases need permissions to read and write the repository contents. +# GitHub considers creating releases and uploading assets as writing contents. +permissions: + contents: write + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + # Allow goreleaser to access older tag information. + fetch-depth: 0 + - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 + with: + go-version-file: 'go.mod' + cache: true + - name: Import GPG key + uses: crazy-max/ghaction-import-gpg@01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4 # v6.1.0 + id: import_gpg + with: + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + passphrase: ${{ secrets.PASSPHRASE }} + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0 + with: + args: release --clean + env: + # GitHub sets the GITHUB_TOKEN secret automatically. + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}