From aa943e4a354307dfb8f9f1d7ef170b340db97c29 Mon Sep 17 00:00:00 2001 From: Service Account - Terraform Provider DevEx <100357958+hc-github-team-tf-provider-devex@users.noreply.github.com> Date: Tue, 4 Jun 2024 13:07:55 -0400 Subject: [PATCH 01/71] [CI] terraform-devex-repos automation --- .github/workflows/add-content-to-project.yml | 40 -------------------- 1 file changed, 40 deletions(-) delete mode 100644 .github/workflows/add-content-to-project.yml diff --git a/.github/workflows/add-content-to-project.yml b/.github/workflows/add-content-to-project.yml deleted file mode 100644 index eeb91e1e..00000000 --- a/.github/workflows/add-content-to-project.yml +++ /dev/null @@ -1,40 +0,0 @@ -# Based on https://github.com/leonsteinhaeuser/project-beta-automations - -name: "Add Issues/PRs to TF Provider DevEx team board" - -on: - issues: - types: [opened, reopened] - pull_request_target: - # NOTE: The way content is added to project board is equivalent to an "upsert". - # Calling it multiple times will be idempotent. - # - # See https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ - # to see the reasoning behind using `pull_request_target` instead of `pull_request` - types: [opened, reopened, ready_for_review] - -jobs: - add-content-to-project: - name: "Add Content to project" - runs-on: ubuntu-latest - steps: - - name: "Set Issue to 'Priority = Triage Next'" - uses: leonsteinhaeuser/project-beta-automations@939000fb1900c9fc4f7b5058a09d9f833ebc6859 # v2.2.1 - if: github.event_name == 'issues' - with: - gh_token: ${{ secrets.TF_DEVEX_PROJECT_GITHUB_TOKEN }} - organization: "hashicorp" - project_id: 99 #< https://github.com/orgs/hashicorp/projects/99 - resource_node_id: ${{ github.event.issue.node_id }} - operation_mode: custom_field - custom_field_values: '[{\"name\":\"Priority\",\"type\":\"single_select\",\"value\":\"Triage Next\"}]' - - name: "Set Pull Request to 'Priority = Triage Next'" - uses: leonsteinhaeuser/project-beta-automations@939000fb1900c9fc4f7b5058a09d9f833ebc6859 # v2.2.1 - if: github.event_name == 'pull_request_target' - with: - gh_token: ${{ secrets.TF_DEVEX_PROJECT_GITHUB_TOKEN }} - organization: "hashicorp" - project_id: 99 #< https://github.com/orgs/hashicorp/projects/99 - resource_node_id: ${{ github.event.pull_request.node_id }} - operation_mode: custom_field - custom_field_values: '[{\"name\":\"Priority\",\"type\":\"single_select\",\"value\":\"Triage Next\"}]' From 4f0cc34e522e1fee950498d36280486a72397925 Mon Sep 17 00:00:00 2001 From: Service Account - Terraform Provider DevEx <100357958+hc-github-team-tf-provider-devex@users.noreply.github.com> Date: Tue, 4 Jun 2024 13:08:08 -0400 Subject: [PATCH 02/71] [CI] terraform-devex-repos automation --- .github/workflows/jira-sync.yml | 39 --------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 .github/workflows/jira-sync.yml diff --git a/.github/workflows/jira-sync.yml b/.github/workflows/jira-sync.yml deleted file mode 100644 index 737d56a5..00000000 --- a/.github/workflows/jira-sync.yml +++ /dev/null @@ -1,39 +0,0 @@ -on: - issues: - types: [closed, deleted, reopened] - pull_request_target: - types: [closed, reopened] - -name: Jira Sync - -jobs: - sync: - runs-on: ubuntu-latest - name: Jira sync - steps: - - - name: Login - uses: atlassian/gajira-login@45fd029b9f1d6d8926c6f04175aa80c0e42c9026 # v3.0.1 - if: contains(github.event.pull_request.labels.*.name, 'tf-devex-triage') || contains(github.event.issue.labels.*.name, 'tf-devex-triage') - env: - JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }} - JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }} - JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }} - - name: Search for existing issue - id: search - if: contains(github.event.pull_request.labels.*.name, 'tf-devex-triage') || contains(github.event.issue.labels.*.name, 'tf-devex-triage') - uses: tomhjp/gh-action-jira-search@04700b457f317c3e341ce90da5a3ff4ce058f2fa # v0.2.2 - with: - jql: 'project="TFECO" and "Team (R&D)[Labels]"="TF-DevEx" and description ~ "${{ github.event.issue.html_url || github.event.pull_request.html_url }}" and labels in (Github)' - - name: Close task - if: ( github.event.action == 'closed' || github.event.action == 'deleted' ) && steps.search.outputs.issue - uses: atlassian/gajira-transition@38fc9cd61b03d6a53dd35fcccda172fe04b36de3 # v3.0.1 - with: - issue: ${{ steps.search.outputs.issue }} - transition: "Closed" - - name: Reopen task - if: github.event.action == 'reopened' && steps.search.outputs.issue - uses: atlassian/gajira-transition@38fc9cd61b03d6a53dd35fcccda172fe04b36de3 # v3.0.1 - with: - issue: ${{ steps.search.outputs.issue }} - transition: "To Do" From f68807badc70d42571f806078cd7e6cdf3cf63ab Mon Sep 17 00:00:00 2001 From: Service Account - Terraform Provider DevEx <100357958+hc-github-team-tf-provider-devex@users.noreply.github.com> Date: Tue, 4 Jun 2024 13:09:33 -0400 Subject: [PATCH 03/71] [CI] terraform-devex-repos automation --- .github/workflows/send-to-jira.yml | 36 ------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 .github/workflows/send-to-jira.yml diff --git a/.github/workflows/send-to-jira.yml b/.github/workflows/send-to-jira.yml deleted file mode 100644 index 6cf5ae5a..00000000 --- a/.github/workflows/send-to-jira.yml +++ /dev/null @@ -1,36 +0,0 @@ -on: - issues: - types: [labeled] - -name: Jira Sync - -jobs: - sync: - runs-on: ubuntu-latest - name: Jira sync - steps: - - - name: Login - uses: atlassian/gajira-login@45fd029b9f1d6d8926c6f04175aa80c0e42c9026 # v3.0.1 - if: github.event.label.name == 'tf-devex-triage' - env: - JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }} - JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }} - JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }} - - name: Search for existing issue - id: search - if: github.event.label.name == 'tf-devex-triage' - uses: tomhjp/gh-action-jira-search@04700b457f317c3e341ce90da5a3ff4ce058f2fa # v0.2.2 - with: - jql: 'project="TFECO" and "Team (R&D)[Labels]"="TF-DevEx" and description ~ "${{ github.event.issue.html_url || github.event.pull_request.html_url }}" and labels in (Github)' - - - name: Create task in DevEx board - if: github.event.label.name == 'tf-devex-triage' && !steps.search.outputs.issue - uses: atlassian/gajira-create@59e177c4f6451399df5b4911c2211104f171e669 # v3.0.1 - with: - project: TFECO - issuetype: "Task" - summary: "[GH] ${{ github.event.issue.title || github.event.pull_request.title }}" - description: "${{ github.event.issue.html_url || github.event.pull_request.html_url }} \n Synced by Github Actions, tagged by ${{ github.actor }}" - # customfield_10091 is Team (R&D) - fields: '{"customfield_10091": ["TF-DevEx"], "labels": ["Github"]}' From b83f067a18f2af903e61e3222e0dba8a0d904108 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 5 Jun 2024 11:18:02 -0400 Subject: [PATCH 04/71] Bump golang.org/x/text from 0.15.0 to 0.16.0 (#384) Bumps [golang.org/x/text](https://github.com/golang/text) from 0.15.0 to 0.16.0. - [Release notes](https://github.com/golang/text/releases) - [Commits](https://github.com/golang/text/compare/v0.15.0...v0.16.0) --- updated-dependencies: - dependency-name: golang.org/x/text dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Austin Valle --- go.mod | 6 +++--- go.sum | 18 ++++++++++-------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index 0f36e326..be169daf 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/zclconf/go-cty v1.14.4 go.abhg.dev/goldmark/frontmatter v0.2.0 golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df - golang.org/x/text v0.15.0 + golang.org/x/text v0.16.0 ) require ( @@ -49,8 +49,8 @@ require ( github.com/spf13/cast v1.5.0 // indirect golang.org/x/crypto v0.21.0 // indirect golang.org/x/mod v0.17.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/tools v0.13.0 // indirect + golang.org/x/sys v0.20.0 // indirect + golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect gopkg.in/yaml.v2 v2.3.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 6fb9296c..039fda9d 100644 --- a/go.sum +++ b/go.sum @@ -147,10 +147,12 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= -golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -159,8 +161,8 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= @@ -168,13 +170,13 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= -golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= -golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From a34e01a2ab5ab7ce3ae006d7f935d60dcce7a389 Mon Sep 17 00:00:00 2001 From: Service Account - Terraform Provider DevEx <100357958+hc-github-team-tf-provider-devex@users.noreply.github.com> Date: Fri, 7 Jun 2024 16:20:55 -0400 Subject: [PATCH 05/71] [CI] terraform-devex-repos automation From 5070800a68a43fb801ea39aa350f7b04c0fbd9a9 Mon Sep 17 00:00:00 2001 From: Service Account - Terraform Provider DevEx <100357958+hc-github-team-tf-provider-devex@users.noreply.github.com> Date: Fri, 7 Jun 2024 16:22:07 -0400 Subject: [PATCH 06/71] [CI] terraform-devex-repos automation --- .github/workflows/ci-changie.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-changie.yml b/.github/workflows/ci-changie.yml index e1c0f40a..57219686 100644 --- a/.github/workflows/ci-changie.yml +++ b/.github/workflows/ci-changie.yml @@ -1,3 +1,6 @@ +# DO NOT EDIT - This GitHub Workflow is managed by automation +# https://github.com/hashicorp/terraform-devex-repos + # Continuous integration handling for changie name: ci-changie @@ -15,9 +18,10 @@ jobs: check: runs-on: ubuntu-latest steps: + # Ensure terraform-devex-repos is updated on version changes. - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + # Ensure terraform-devex-repos is updated on version changes. - uses: miniscruff/changie-action@6dcc2533cac0495148ed4046c438487e4dceaa23 # v2.0.0 with: version: latest args: batch patch --dry-run - From 47036d6d2c02bc1ac098805ee923379d09a1fde9 Mon Sep 17 00:00:00 2001 From: Service Account - Terraform Provider DevEx <100357958+hc-github-team-tf-provider-devex@users.noreply.github.com> Date: Fri, 7 Jun 2024 16:22:54 -0400 Subject: [PATCH 07/71] [CI] terraform-devex-repos automation --- .changie.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.changie.yaml b/.changie.yaml index 1216b591..37089da1 100644 --- a/.changie.yaml +++ b/.changie.yaml @@ -1,3 +1,5 @@ +# DO NOT EDIT - This GitHub Workflow is managed by automation +# https://github.com/hashicorp/terraform-devex-repos changesDir: .changes unreleasedDir: unreleased changelogPath: CHANGELOG.md From a99dcb95e3f8a94244a1f312d8250ab63d0c647c Mon Sep 17 00:00:00 2001 From: Service Account - Terraform Provider DevEx <100357958+hc-github-team-tf-provider-devex@users.noreply.github.com> Date: Mon, 10 Jun 2024 16:08:01 -0400 Subject: [PATCH 08/71] [CI] Update lock workflow file --- .github/workflows/lock.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml index 922282c7..8b519cf9 100644 --- a/.github/workflows/lock.yml +++ b/.github/workflows/lock.yml @@ -15,13 +15,7 @@ jobs: - uses: dessant/lock-threads@1bf7ec25051fe7c00bdd17e6a7cf3d7bfb7dc771 # v5.0.1 with: github-token: ${{ github.token }} - issue-comment: > - I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues. - - If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. issue-inactive-days: '30' - pr-comment: > - I'm going to lock this pull request because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active contributions. - - If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. + issue-lock-reason: resolved pr-inactive-days: '30' + pr-lock-reason: resolved From 9de3ec7de918ce83aa32df7084b63ff7e887108c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 14 Jun 2024 14:11:47 -0400 Subject: [PATCH 09/71] Bump github.com/yuin/goldmark from 1.7.1 to 1.7.2 (#385) Bumps [github.com/yuin/goldmark](https://github.com/yuin/goldmark) from 1.7.1 to 1.7.2. - [Release notes](https://github.com/yuin/goldmark/releases) - [Commits](https://github.com/yuin/goldmark/compare/v1.7.1...v1.7.2) --- updated-dependencies: - dependency-name: github.com/yuin/goldmark dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index be169daf..66c8f7d8 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/hashicorp/terraform-json v0.22.1 github.com/mattn/go-colorable v0.1.13 github.com/rogpeppe/go-internal v1.12.0 - github.com/yuin/goldmark v1.7.1 + github.com/yuin/goldmark v1.7.2 github.com/yuin/goldmark-meta v1.1.0 github.com/zclconf/go-cty v1.14.4 go.abhg.dev/goldmark/frontmatter v0.2.0 diff --git a/go.sum b/go.sum index 039fda9d..18a60055 100644 --- a/go.sum +++ b/go.sum @@ -125,8 +125,8 @@ github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/yuin/goldmark v1.7.1 h1:3bajkSilaCbjdKVsKdZjZCLBNPL9pYzrCakKaf4U49U= -github.com/yuin/goldmark v1.7.1/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= +github.com/yuin/goldmark v1.7.2 h1:NjGd7lO7zrUn/A7eKwn5PEOt4ONYGqpxSEeZuduvgxc= +github.com/yuin/goldmark v1.7.2/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= github.com/yuin/goldmark-meta v1.1.0 h1:pWw+JLHGZe8Rk0EGsMVssiNb/AaPMHfSRszZeUeiOUc= github.com/yuin/goldmark-meta v1.1.0/go.mod h1:U4spWENafuA7Zyg+Lj5RqK/MF+ovMYtBvXi1lBb2VP0= github.com/zclconf/go-cty v1.14.4 h1:uXXczd9QDGsgu0i/QFR/hzI5NYCHLf6NQw/atrbnhq8= From 601fa80d93f630917e67c93e5e97b8d73b3a7d13 Mon Sep 17 00:00:00 2001 From: "hashicorp-tsccr[bot]" <129506189+hashicorp-tsccr[bot]@users.noreply.github.com> Date: Fri, 21 Jun 2024 11:15:21 -0400 Subject: [PATCH 10/71] SEC-090: Automated trusted workflow pinning (2024-06-17) (#386) * Result of tsccr-helper -log-level=info gha update -latest . * Add version to .goreleaser file --------- Co-authored-by: hashicorp-tsccr[bot] Co-authored-by: Austin Valle --- .github/workflows/release.yml | 2 +- .goreleaser.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 444a2523..5dfe0022 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -93,7 +93,7 @@ jobs: cd .changes sed -e "1{/# /d;}" -e "2{/^$/d;}" ${{ needs.changelog-version.outputs.version }}.md > /tmp/release-notes.txt - - uses: goreleaser/goreleaser-action@5742e2a039330cbb23ebf35f046f814d4c6ff811 # v5.1.0 + - uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: diff --git a/.goreleaser.yml b/.goreleaser.yml index b6514e75..3ead1e46 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,3 +1,4 @@ +version: 2 project_name: tfplugindocs builds: - main: ./cmd/tfplugindocs From b021fc83dc00d070f1efe598709a5ae370a3e849 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Jun 2024 16:45:19 -0400 Subject: [PATCH 11/71] Bump github.com/yuin/goldmark from 1.7.2 to 1.7.3 (#388) Bumps [github.com/yuin/goldmark](https://github.com/yuin/goldmark) from 1.7.2 to 1.7.3. - [Release notes](https://github.com/yuin/goldmark/releases) - [Commits](https://github.com/yuin/goldmark/compare/v1.7.2...v1.7.3) --- updated-dependencies: - dependency-name: github.com/yuin/goldmark dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 66c8f7d8..22808a2b 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/hashicorp/terraform-json v0.22.1 github.com/mattn/go-colorable v0.1.13 github.com/rogpeppe/go-internal v1.12.0 - github.com/yuin/goldmark v1.7.2 + github.com/yuin/goldmark v1.7.3 github.com/yuin/goldmark-meta v1.1.0 github.com/zclconf/go-cty v1.14.4 go.abhg.dev/goldmark/frontmatter v0.2.0 diff --git a/go.sum b/go.sum index 18a60055..278ac929 100644 --- a/go.sum +++ b/go.sum @@ -125,8 +125,8 @@ github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/yuin/goldmark v1.7.2 h1:NjGd7lO7zrUn/A7eKwn5PEOt4ONYGqpxSEeZuduvgxc= -github.com/yuin/goldmark v1.7.2/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= +github.com/yuin/goldmark v1.7.3 h1:fdk0a/y60GsS4NbEd13GSIP+d8OjtTkmluY32Dy1Z/A= +github.com/yuin/goldmark v1.7.3/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= github.com/yuin/goldmark-meta v1.1.0 h1:pWw+JLHGZe8Rk0EGsMVssiNb/AaPMHfSRszZeUeiOUc= github.com/yuin/goldmark-meta v1.1.0/go.mod h1:U4spWENafuA7Zyg+Lj5RqK/MF+ovMYtBvXi1lBb2VP0= github.com/zclconf/go-cty v1.14.4 h1:uXXczd9QDGsgu0i/QFR/hzI5NYCHLf6NQw/atrbnhq8= From 1e02488a42ab7853506518f7e970b57bc65f6f69 Mon Sep 17 00:00:00 2001 From: "hashicorp-tsccr[bot]" <129506189+hashicorp-tsccr[bot]@users.noreply.github.com> Date: Mon, 24 Jun 2024 16:55:31 -0400 Subject: [PATCH 12/71] Result of tsccr-helper -log-level=info gha update -latest . (#387) Co-authored-by: hashicorp-tsccr[bot] Co-authored-by: Austin Valle --- .github/workflows/ci-changie.yml | 2 +- .github/workflows/compliance.yml | 2 +- .github/workflows/release.yml | 6 +++--- .github/workflows/test.yml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-changie.yml b/.github/workflows/ci-changie.yml index 57219686..de5554dd 100644 --- a/.github/workflows/ci-changie.yml +++ b/.github/workflows/ci-changie.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest steps: # Ensure terraform-devex-repos is updated on version changes. - - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 # Ensure terraform-devex-repos is updated on version changes. - uses: miniscruff/changie-action@6dcc2533cac0495148ed4046c438487e4dceaa23 # v2.0.0 with: diff --git a/.github/workflows/compliance.yml b/.github/workflows/compliance.yml index 8db9cfd1..51d71992 100644 --- a/.github/workflows/compliance.yml +++ b/.github/workflows/compliance.yml @@ -11,7 +11,7 @@ jobs: copywrite: runs-on: ubuntu-latest steps: - - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - uses: hashicorp/setup-copywrite@32638da2d4e81d56a0764aa1547882fc4d209636 # v1.1.3 - run: copywrite headers --plan - run: copywrite license --plan diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5dfe0022..3a6ec9c8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,7 +25,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 with: fetch-depth: 0 # Avoid persisting GITHUB_TOKEN credentials as they take priority over our service account PAT for `git push` operations @@ -54,7 +54,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 with: fetch-depth: 0 # Default input is the SHA that initially triggered the workflow. As we created a new commit in the previous job, @@ -79,7 +79,7 @@ jobs: contents: write # Needed for goreleaser to create GitHub release issues: write # Needed for goreleaser to close associated milestone steps: - - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 with: ref: ${{ inputs.versionNumber }} fetch-depth: 0 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a7f277d8..fad4956c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,7 +21,7 @@ jobs: git config --global core.eol lf - name: Check out code - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - name: Setup Go uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1 with: From e95d6f3e3b548d6c6778ac7a7dbf05eac6cbb21d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 25 Jun 2024 17:12:58 -0400 Subject: [PATCH 13/71] Bump github.com/yuin/goldmark from 1.7.3 to 1.7.4 (#389) Bumps [github.com/yuin/goldmark](https://github.com/yuin/goldmark) from 1.7.3 to 1.7.4. - [Release notes](https://github.com/yuin/goldmark/releases) - [Commits](https://github.com/yuin/goldmark/compare/v1.7.3...v1.7.4) --- updated-dependencies: - dependency-name: github.com/yuin/goldmark dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 22808a2b..b24a83b3 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/hashicorp/terraform-json v0.22.1 github.com/mattn/go-colorable v0.1.13 github.com/rogpeppe/go-internal v1.12.0 - github.com/yuin/goldmark v1.7.3 + github.com/yuin/goldmark v1.7.4 github.com/yuin/goldmark-meta v1.1.0 github.com/zclconf/go-cty v1.14.4 go.abhg.dev/goldmark/frontmatter v0.2.0 diff --git a/go.sum b/go.sum index 278ac929..3e54ed93 100644 --- a/go.sum +++ b/go.sum @@ -125,8 +125,8 @@ github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/yuin/goldmark v1.7.3 h1:fdk0a/y60GsS4NbEd13GSIP+d8OjtTkmluY32Dy1Z/A= -github.com/yuin/goldmark v1.7.3/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= +github.com/yuin/goldmark v1.7.4 h1:BDXOHExt+A7gwPCJgPIIq7ENvceR7we7rOS9TNoLZeg= +github.com/yuin/goldmark v1.7.4/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= github.com/yuin/goldmark-meta v1.1.0 h1:pWw+JLHGZe8Rk0EGsMVssiNb/AaPMHfSRszZeUeiOUc= github.com/yuin/goldmark-meta v1.1.0/go.mod h1:U4spWENafuA7Zyg+Lj5RqK/MF+ovMYtBvXi1lBb2VP0= github.com/zclconf/go-cty v1.14.4 h1:uXXczd9QDGsgu0i/QFR/hzI5NYCHLf6NQw/atrbnhq8= From ed65cf0674195113543e302c419c66be80a2a57f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 25 Jun 2024 17:22:19 -0400 Subject: [PATCH 14/71] Bump github.com/hashicorp/copywrite from 0.18.0 to 0.19.0 in /tools (#390) Bumps [github.com/hashicorp/copywrite](https://github.com/hashicorp/copywrite) from 0.18.0 to 0.19.0. - [Release notes](https://github.com/hashicorp/copywrite/releases) - [Changelog](https://github.com/hashicorp/copywrite/blob/main/.goreleaser.yaml) - [Commits](https://github.com/hashicorp/copywrite/compare/v0.18.0...v0.19.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/copywrite dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Austin Valle --- tools/go.mod | 2 +- tools/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/go.mod b/tools/go.mod index ba85d85e..4a4affd2 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -2,7 +2,7 @@ module tools go 1.21 -require github.com/hashicorp/copywrite v0.18.0 +require github.com/hashicorp/copywrite v0.19.0 require ( github.com/AlecAivazis/survey/v2 v2.3.6 // indirect diff --git a/tools/go.sum b/tools/go.sum index b903a248..0d402390 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -147,8 +147,8 @@ github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslC github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI= github.com/hashicorp/consul/api v1.13.0/go.mod h1:ZlVrynguJKcYr54zGaDbaL3fOvKC9m72FhPvA8T35KQ= github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= -github.com/hashicorp/copywrite v0.18.0 h1:6f3aBDyQLBXhD6cdGSnsEM37vCDi3JJrkbR9HPBJf5c= -github.com/hashicorp/copywrite v0.18.0/go.mod h1:6wvQH+ICDoD2bpjO1RJ6fi+h3aY5NeLEM12oTkEtFoc= +github.com/hashicorp/copywrite v0.19.0 h1:f9LVxTDBfFYeQmdBpOsZ+HWknXonI8ZwubbO/RwyuCo= +github.com/hashicorp/copywrite v0.19.0/go.mod h1:6wvQH+ICDoD2bpjO1RJ6fi+h3aY5NeLEM12oTkEtFoc= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= From aa7c313b8f04b85b0deea8988f8cf972b2383347 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Jul 2024 14:49:28 -0400 Subject: [PATCH 15/71] Bump github.com/zclconf/go-cty from 1.14.4 to 1.15.0 (#392) Bumps [github.com/zclconf/go-cty](https://github.com/zclconf/go-cty) from 1.14.4 to 1.15.0. - [Release notes](https://github.com/zclconf/go-cty/releases) - [Changelog](https://github.com/zclconf/go-cty/blob/main/CHANGELOG.md) - [Commits](https://github.com/zclconf/go-cty/compare/v1.14.4...v1.15.0) --- updated-dependencies: - dependency-name: github.com/zclconf/go-cty dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index b24a83b3..57aecdf1 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/rogpeppe/go-internal v1.12.0 github.com/yuin/goldmark v1.7.4 github.com/yuin/goldmark-meta v1.1.0 - github.com/zclconf/go-cty v1.14.4 + github.com/zclconf/go-cty v1.15.0 go.abhg.dev/goldmark/frontmatter v0.2.0 golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df golang.org/x/text v0.16.0 diff --git a/go.sum b/go.sum index 3e54ed93..0a4381ba 100644 --- a/go.sum +++ b/go.sum @@ -129,8 +129,8 @@ github.com/yuin/goldmark v1.7.4 h1:BDXOHExt+A7gwPCJgPIIq7ENvceR7we7rOS9TNoLZeg= github.com/yuin/goldmark v1.7.4/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= github.com/yuin/goldmark-meta v1.1.0 h1:pWw+JLHGZe8Rk0EGsMVssiNb/AaPMHfSRszZeUeiOUc= github.com/yuin/goldmark-meta v1.1.0/go.mod h1:U4spWENafuA7Zyg+Lj5RqK/MF+ovMYtBvXi1lBb2VP0= -github.com/zclconf/go-cty v1.14.4 h1:uXXczd9QDGsgu0i/QFR/hzI5NYCHLf6NQw/atrbnhq8= -github.com/zclconf/go-cty v1.14.4/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= +github.com/zclconf/go-cty v1.15.0 h1:tTCRWxsexYUmtt/wVxgDClUe+uQusuI443uL6e+5sXQ= +github.com/zclconf/go-cty v1.15.0/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= go.abhg.dev/goldmark/frontmatter v0.2.0 h1:P8kPG0YkL12+aYk2yU3xHv4tcXzeVnN+gU0tJ5JnxRw= go.abhg.dev/goldmark/frontmatter v0.2.0/go.mod h1:XqrEkZuM57djk7zrlRUB02x8I5J0px76YjkOzhB4YlU= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= From fd28c5cde32d69b3da192284b41a76053d197091 Mon Sep 17 00:00:00 2001 From: "hashicorp-tsccr[bot]" <129506189+hashicorp-tsccr[bot]@users.noreply.github.com> Date: Tue, 23 Jul 2024 13:07:11 -0400 Subject: [PATCH 16/71] Result of tsccr-helper -log-level=info gha update -latest . (#394) Co-authored-by: hashicorp-tsccr[bot] --- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3a6ec9c8..05421746 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -84,7 +84,7 @@ jobs: ref: ${{ inputs.versionNumber }} fetch-depth: 0 - - uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1 + - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: go-version-file: 'go.mod' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fad4956c..50dbff7c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,7 +23,7 @@ jobs: - name: Check out code uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - name: Setup Go - uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1 + uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: go-version-file: 'go.mod' - name: Run linters From 6d976f006f52abc86f2dbd153c091a254cef66c5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Aug 2024 15:18:56 -0400 Subject: [PATCH 17/71] Bump github.com/hashicorp/hc-install from 0.7.0 to 0.8.0 (#395) Bumps [github.com/hashicorp/hc-install](https://github.com/hashicorp/hc-install) from 0.7.0 to 0.8.0. - [Release notes](https://github.com/hashicorp/hc-install/releases) - [Commits](https://github.com/hashicorp/hc-install/compare/v0.7.0...v0.8.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/hc-install dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 5 +++-- go.sum | 12 ++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 57aecdf1..1709cc67 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/google/go-cmp v0.6.0 github.com/hashicorp/cli v1.1.6 github.com/hashicorp/go-version v1.7.0 - github.com/hashicorp/hc-install v0.7.0 + github.com/hashicorp/hc-install v0.8.0 github.com/hashicorp/terraform-exec v0.21.0 github.com/hashicorp/terraform-json v0.22.1 github.com/mattn/go-colorable v0.1.13 @@ -37,6 +37,7 @@ require ( github.com/hashicorp/go-checkpoint v0.5.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect + github.com/hashicorp/go-retryablehttp v0.7.7 // indirect github.com/hashicorp/go-uuid v1.0.3 // indirect github.com/huandu/xstrings v1.3.3 // indirect github.com/imdario/mergo v0.3.15 // indirect @@ -48,7 +49,7 @@ require ( github.com/shopspring/decimal v1.3.1 // indirect github.com/spf13/cast v1.5.0 // indirect golang.org/x/crypto v0.21.0 // indirect - golang.org/x/mod v0.17.0 // indirect + golang.org/x/mod v0.19.0 // indirect golang.org/x/sys v0.20.0 // indirect golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect gopkg.in/yaml.v2 v2.3.0 // indirect diff --git a/go.sum b/go.sum index 0a4381ba..2ae4faec 100644 --- a/go.sum +++ b/go.sum @@ -58,16 +58,20 @@ github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuD github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= +github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k= +github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= +github.com/hashicorp/go-retryablehttp v0.7.7 h1:C8hUCYzor8PIfXHa4UrZkU4VvK8o9ISHxT2Q8+VepXU= +github.com/hashicorp/go-retryablehttp v0.7.7/go.mod h1:pkQpWZeYWskR+D1tR2O5OcBFOxfA7DoAO6xtkuQnHTk= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/hc-install v0.7.0 h1:Uu9edVqjKQxxuD28mR5TikkKDd/p55S8vzPC1659aBk= -github.com/hashicorp/hc-install v0.7.0/go.mod h1:ELmmzZlGnEcqoUMKUuykHaPCIR1sYLYX+KSggWSKZuA= +github.com/hashicorp/hc-install v0.8.0 h1:LdpZeXkZYMQhoKPCecJHlKvUkQFixN/nvyR1CdfOLjI= +github.com/hashicorp/hc-install v0.8.0/go.mod h1:+MwJYjDfCruSD/udvBmRB22Nlkwwkwf5sAB6uTIhSaU= github.com/hashicorp/terraform-exec v0.21.0 h1:uNkLAe95ey5Uux6KJdua6+cv8asgILFVWkd/RG0D2XQ= github.com/hashicorp/terraform-exec v0.21.0/go.mod h1:1PPeMYou+KDUSSeRE9szMZ/oHf4fYUmB923Wzbq1ICg= github.com/hashicorp/terraform-json v0.22.1 h1:xft84GZR0QzjPVWs4lRUwvTcPnegqlyS7orfb5Ltvec= @@ -141,8 +145,8 @@ golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOM golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df h1:UA2aFVmmsIlefxMk29Dp2juaUSth8Pyn3Tq5Y5mJGME= golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= -golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= +golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= From 5a6a37b41c957ce14a4ebdbc8280c492703be97d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Aug 2024 13:06:52 -0400 Subject: [PATCH 18/71] Bump golang.org/x/text from 0.16.0 to 0.17.0 (#396) Bumps [golang.org/x/text](https://github.com/golang/text) from 0.16.0 to 0.17.0. - [Release notes](https://github.com/golang/text/releases) - [Commits](https://github.com/golang/text/compare/v0.16.0...v0.17.0) --- updated-dependencies: - dependency-name: golang.org/x/text dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 1709cc67..cb3a46f1 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/zclconf/go-cty v1.15.0 go.abhg.dev/goldmark/frontmatter v0.2.0 golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df - golang.org/x/text v0.16.0 + golang.org/x/text v0.17.0 ) require ( diff --git a/go.sum b/go.sum index 2ae4faec..c29e061d 100644 --- a/go.sum +++ b/go.sum @@ -155,8 +155,8 @@ golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -174,8 +174,8 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= From 95b98745915ac0d48764d2f7034068ca5ecaddc1 Mon Sep 17 00:00:00 2001 From: "hashicorp-tsccr[bot]" <129506189+hashicorp-tsccr[bot]@users.noreply.github.com> Date: Tue, 13 Aug 2024 10:26:30 -0400 Subject: [PATCH 19/71] Result of tsccr-helper -log-level=info gha update -latest . (#397) Co-authored-by: hashicorp-tsccr[bot] --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 50dbff7c..3143ea1c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,7 +27,7 @@ jobs: with: go-version-file: 'go.mod' - name: Run linters - uses: golangci/golangci-lint-action@a4f60bb28d35aeee14e6880718e0c85ff1882e64 # v6.0.1 + uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86 # v6.1.0 with: version: latest args: --timeout=3m From a58ba8935264de28545ffa9356c5fdbedec5cb9d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 6 Sep 2024 09:11:19 -0400 Subject: [PATCH 20/71] Bump golang.org/x/text from 0.17.0 to 0.18.0 (#399) * Bump golang.org/x/text from 0.17.0 to 0.18.0 Bumps [golang.org/x/text](https://github.com/golang/text) from 0.17.0 to 0.18.0. - [Release notes](https://github.com/golang/text/releases) - [Commits](https://github.com/golang/text/compare/v0.17.0...v0.18.0) --- updated-dependencies: - dependency-name: golang.org/x/text dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * lint fixes --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Austin Valle --- .golangci.yml | 2 +- go.mod | 2 +- go.sum | 4 ++-- internal/mdplain/mdplain_test.go | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index a62a6274..82a43ddd 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -11,6 +11,7 @@ linters: - forcetypeassert - gofmt - gosimple + - govet - ineffassign - makezero - misspell @@ -22,7 +23,6 @@ linters: - unconvert - unparam - unused - - vet run: # Prevent false positive timeouts in CI diff --git a/go.mod b/go.mod index cb3a46f1..37e6f30d 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/zclconf/go-cty v1.15.0 go.abhg.dev/goldmark/frontmatter v0.2.0 golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df - golang.org/x/text v0.17.0 + golang.org/x/text v0.18.0 ) require ( diff --git a/go.sum b/go.sum index c29e061d..ad2d1298 100644 --- a/go.sum +++ b/go.sum @@ -174,8 +174,8 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= -golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= diff --git a/internal/mdplain/mdplain_test.go b/internal/mdplain/mdplain_test.go index 9bf6dcfd..e4c77211 100644 --- a/internal/mdplain/mdplain_test.go +++ b/internal/mdplain/mdplain_test.go @@ -32,7 +32,7 @@ func TestPlainMarkdown(t *testing.T) { return } if !cmp.Equal(expected, actual) { - t.Errorf(cmp.Diff(expected, actual)) + t.Error(cmp.Diff(expected, actual)) } } From bb757d2a3d3b06b6e1147eb9735623d287ae26b2 Mon Sep 17 00:00:00 2001 From: Austin Valle Date: Mon, 9 Sep 2024 10:46:58 -0400 Subject: [PATCH 21/71] all: Bump minimum Go module version to 1.22 (#400) * all: Bump minimum Go module version to 1.22 * add changelog --- .changes/unreleased/NOTES-20240909-102809.yaml | 7 +++++++ go.mod | 2 +- tools/go.mod | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 .changes/unreleased/NOTES-20240909-102809.yaml diff --git a/.changes/unreleased/NOTES-20240909-102809.yaml b/.changes/unreleased/NOTES-20240909-102809.yaml new file mode 100644 index 00000000..df9a5848 --- /dev/null +++ b/.changes/unreleased/NOTES-20240909-102809.yaml @@ -0,0 +1,7 @@ +kind: NOTES +body: 'all: This Go module has been updated to Go 1.22 per the [Go support policy](https://go.dev/doc/devel/release#policy). + It is recommended to review the [Go 1.22 release notes](https://go.dev/doc/go1.22) + before upgrading. Any consumers building on earlier Go versions may experience errors.' +time: 2024-09-09T10:28:09.020608-04:00 +custom: + Issue: "400" diff --git a/go.mod b/go.mod index 37e6f30d..22be4332 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/hashicorp/terraform-plugin-docs -go 1.21 +go 1.22.7 require ( github.com/Kunde21/markdownfmt/v3 v3.1.0 diff --git a/tools/go.mod b/tools/go.mod index 4a4affd2..9938d4ca 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -1,6 +1,6 @@ module tools -go 1.21 +go 1.22.7 require github.com/hashicorp/copywrite v0.19.0 From 5e263242a470146fc846a7481cd0a79c8c6297b1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Sep 2024 11:45:56 -0400 Subject: [PATCH 22/71] Bump github.com/hashicorp/hc-install from 0.8.0 to 0.8.1 (#401) Bumps [github.com/hashicorp/hc-install](https://github.com/hashicorp/hc-install) from 0.8.0 to 0.8.1. - [Release notes](https://github.com/hashicorp/hc-install/releases) - [Commits](https://github.com/hashicorp/hc-install/compare/v0.8.0...v0.8.1) --- updated-dependencies: - dependency-name: github.com/hashicorp/hc-install dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 22be4332..54641a2e 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/google/go-cmp v0.6.0 github.com/hashicorp/cli v1.1.6 github.com/hashicorp/go-version v1.7.0 - github.com/hashicorp/hc-install v0.8.0 + github.com/hashicorp/hc-install v0.8.1 github.com/hashicorp/terraform-exec v0.21.0 github.com/hashicorp/terraform-json v0.22.1 github.com/mattn/go-colorable v0.1.13 @@ -49,7 +49,7 @@ require ( github.com/shopspring/decimal v1.3.1 // indirect github.com/spf13/cast v1.5.0 // indirect golang.org/x/crypto v0.21.0 // indirect - golang.org/x/mod v0.19.0 // indirect + golang.org/x/mod v0.20.0 // indirect golang.org/x/sys v0.20.0 // indirect golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect gopkg.in/yaml.v2 v2.3.0 // indirect diff --git a/go.sum b/go.sum index ad2d1298..80dad1cf 100644 --- a/go.sum +++ b/go.sum @@ -70,8 +70,8 @@ github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/C github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/hc-install v0.8.0 h1:LdpZeXkZYMQhoKPCecJHlKvUkQFixN/nvyR1CdfOLjI= -github.com/hashicorp/hc-install v0.8.0/go.mod h1:+MwJYjDfCruSD/udvBmRB22Nlkwwkwf5sAB6uTIhSaU= +github.com/hashicorp/hc-install v0.8.1 h1:gXSB7PP7GF4RqQtW0amN+bjhYQjK2Djb1i3hb9RRK/w= +github.com/hashicorp/hc-install v0.8.1/go.mod h1:UA1NStrLn4o5bIWTZvblOaEExxX1tIEHq01VpG90K0I= github.com/hashicorp/terraform-exec v0.21.0 h1:uNkLAe95ey5Uux6KJdua6+cv8asgILFVWkd/RG0D2XQ= github.com/hashicorp/terraform-exec v0.21.0/go.mod h1:1PPeMYou+KDUSSeRE9szMZ/oHf4fYUmB923Wzbq1ICg= github.com/hashicorp/terraform-json v0.22.1 h1:xft84GZR0QzjPVWs4lRUwvTcPnegqlyS7orfb5Ltvec= @@ -145,8 +145,8 @@ golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOM golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df h1:UA2aFVmmsIlefxMk29Dp2juaUSth8Pyn3Tq5Y5mJGME= golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= -golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= +golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= From 78924db01b32cdba19fb1b991ed4c4b2e3fad0ee Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 12 Sep 2024 06:40:25 -0400 Subject: [PATCH 23/71] Bump github.com/hashicorp/hc-install from 0.8.1 to 0.9.0 (#402) Bumps [github.com/hashicorp/hc-install](https://github.com/hashicorp/hc-install) from 0.8.1 to 0.9.0. - [Release notes](https://github.com/hashicorp/hc-install/releases) - [Commits](https://github.com/hashicorp/hc-install/compare/v0.8.1...v0.9.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/hc-install dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 54641a2e..aaaf63b4 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/google/go-cmp v0.6.0 github.com/hashicorp/cli v1.1.6 github.com/hashicorp/go-version v1.7.0 - github.com/hashicorp/hc-install v0.8.1 + github.com/hashicorp/hc-install v0.9.0 github.com/hashicorp/terraform-exec v0.21.0 github.com/hashicorp/terraform-json v0.22.1 github.com/mattn/go-colorable v0.1.13 @@ -49,7 +49,7 @@ require ( github.com/shopspring/decimal v1.3.1 // indirect github.com/spf13/cast v1.5.0 // indirect golang.org/x/crypto v0.21.0 // indirect - golang.org/x/mod v0.20.0 // indirect + golang.org/x/mod v0.21.0 // indirect golang.org/x/sys v0.20.0 // indirect golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect gopkg.in/yaml.v2 v2.3.0 // indirect diff --git a/go.sum b/go.sum index 80dad1cf..9f0c5967 100644 --- a/go.sum +++ b/go.sum @@ -70,8 +70,8 @@ github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/C github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/hc-install v0.8.1 h1:gXSB7PP7GF4RqQtW0amN+bjhYQjK2Djb1i3hb9RRK/w= -github.com/hashicorp/hc-install v0.8.1/go.mod h1:UA1NStrLn4o5bIWTZvblOaEExxX1tIEHq01VpG90K0I= +github.com/hashicorp/hc-install v0.9.0 h1:2dIk8LcvANwtv3QZLckxcjyF5w8KVtiMxu6G6eLhghE= +github.com/hashicorp/hc-install v0.9.0/go.mod h1:+6vOP+mf3tuGgMApVYtmsnDoKWMDcFXeTxCACYZ8SFg= github.com/hashicorp/terraform-exec v0.21.0 h1:uNkLAe95ey5Uux6KJdua6+cv8asgILFVWkd/RG0D2XQ= github.com/hashicorp/terraform-exec v0.21.0/go.mod h1:1PPeMYou+KDUSSeRE9szMZ/oHf4fYUmB923Wzbq1ICg= github.com/hashicorp/terraform-json v0.22.1 h1:xft84GZR0QzjPVWs4lRUwvTcPnegqlyS7orfb5Ltvec= @@ -145,8 +145,8 @@ golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOM golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df h1:UA2aFVmmsIlefxMk29Dp2juaUSth8Pyn3Tq5Y5mJGME= golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= -golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= +golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= From bc9575d3922ffa09eababd976cdaf77246a2d9dd Mon Sep 17 00:00:00 2001 From: Service Account - Terraform Provider DevEx <100357958+hc-github-team-tf-provider-devex@users.noreply.github.com> Date: Mon, 16 Sep 2024 09:32:18 -0400 Subject: [PATCH 24/71] [CI] Update lock workflow file From 96e2d7e62fdfa924eff27ce2f2fce23f2db68a1e Mon Sep 17 00:00:00 2001 From: Service Account - Terraform Provider DevEx <100357958+hc-github-team-tf-provider-devex@users.noreply.github.com> Date: Mon, 16 Sep 2024 09:33:31 -0400 Subject: [PATCH 25/71] [CI] Update issue comment triage workflow file From 53fa96841f4de2129b2dcfe90b026cc3cdd73c7e Mon Sep 17 00:00:00 2001 From: Service Account - Terraform Provider DevEx <100357958+hc-github-team-tf-provider-devex@users.noreply.github.com> Date: Mon, 16 Sep 2024 09:33:57 -0400 Subject: [PATCH 26/71] [CI] terraform-devex-repos automation From 5681cb702ba9668b97cb46880f551bccbf3ef8e1 Mon Sep 17 00:00:00 2001 From: Service Account - Terraform Provider DevEx <100357958+hc-github-team-tf-provider-devex@users.noreply.github.com> Date: Mon, 16 Sep 2024 09:34:48 -0400 Subject: [PATCH 27/71] [CI] terraform-devex-repos automation From 3f4d5332d8aaa600492f0086b0944c380f024c7b Mon Sep 17 00:00:00 2001 From: Service Account - Terraform Provider DevEx <100357958+hc-github-team-tf-provider-devex@users.noreply.github.com> Date: Mon, 16 Sep 2024 09:35:39 -0400 Subject: [PATCH 28/71] [CI] terraform-devex-repos automation From 1616d188b09cc79137b142ac17712727b1fc8e9b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 25 Sep 2024 11:01:36 -0400 Subject: [PATCH 29/71] Bump github.com/rogpeppe/go-internal from 1.12.0 to 1.13.1 (#403) Bumps [github.com/rogpeppe/go-internal](https://github.com/rogpeppe/go-internal) from 1.12.0 to 1.13.1. - [Release notes](https://github.com/rogpeppe/go-internal/releases) - [Commits](https://github.com/rogpeppe/go-internal/compare/v1.12.0...v1.13.1) --- updated-dependencies: - dependency-name: github.com/rogpeppe/go-internal dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 6 +++--- go.sum | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index aaaf63b4..fdd8661f 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/hashicorp/terraform-exec v0.21.0 github.com/hashicorp/terraform-json v0.22.1 github.com/mattn/go-colorable v0.1.13 - github.com/rogpeppe/go-internal v1.12.0 + github.com/rogpeppe/go-internal v1.13.1 github.com/yuin/goldmark v1.7.4 github.com/yuin/goldmark-meta v1.1.0 github.com/zclconf/go-cty v1.15.0 @@ -50,8 +50,8 @@ require ( github.com/spf13/cast v1.5.0 // indirect golang.org/x/crypto v0.21.0 // indirect golang.org/x/mod v0.21.0 // indirect - golang.org/x/sys v0.20.0 // indirect - golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect + golang.org/x/sys v0.21.0 // indirect + golang.org/x/tools v0.22.0 // indirect gopkg.in/yaml.v2 v2.3.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 9f0c5967..b9abdb5a 100644 --- a/go.sum +++ b/go.sum @@ -108,8 +108,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.2.3 h1:NP0eAhjcjImqslEwo/1hq7gpajME0fTLTezBKDqfXqo= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= -github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= -github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= +github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= +github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= @@ -151,8 +151,8 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= -golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= +golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= @@ -165,8 +165,8 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= @@ -179,8 +179,8 @@ golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= +golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From 405268d4a424c055c350df55a0f1ca87f3f22071 Mon Sep 17 00:00:00 2001 From: "hashicorp-tsccr[bot]" <129506189+hashicorp-tsccr[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 10:43:12 -0400 Subject: [PATCH 30/71] Result of tsccr-helper -log-level=info gha update -latest . (#406) Co-authored-by: hashicorp-tsccr[bot] --- .github/workflows/ci-changie.yml | 2 +- .github/workflows/compliance.yml | 2 +- .github/workflows/release.yml | 6 +++--- .github/workflows/test.yml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-changie.yml b/.github/workflows/ci-changie.yml index de5554dd..60a514c0 100644 --- a/.github/workflows/ci-changie.yml +++ b/.github/workflows/ci-changie.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest steps: # Ensure terraform-devex-repos is updated on version changes. - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 # Ensure terraform-devex-repos is updated on version changes. - uses: miniscruff/changie-action@6dcc2533cac0495148ed4046c438487e4dceaa23 # v2.0.0 with: diff --git a/.github/workflows/compliance.yml b/.github/workflows/compliance.yml index 51d71992..ddd4d72a 100644 --- a/.github/workflows/compliance.yml +++ b/.github/workflows/compliance.yml @@ -11,7 +11,7 @@ jobs: copywrite: runs-on: ubuntu-latest steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - uses: hashicorp/setup-copywrite@32638da2d4e81d56a0764aa1547882fc4d209636 # v1.1.3 - run: copywrite headers --plan - run: copywrite license --plan diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 05421746..e253c38d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,7 +25,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 with: fetch-depth: 0 # Avoid persisting GITHUB_TOKEN credentials as they take priority over our service account PAT for `git push` operations @@ -54,7 +54,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 with: fetch-depth: 0 # Default input is the SHA that initially triggered the workflow. As we created a new commit in the previous job, @@ -79,7 +79,7 @@ jobs: contents: write # Needed for goreleaser to create GitHub release issues: write # Needed for goreleaser to close associated milestone steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 with: ref: ${{ inputs.versionNumber }} fetch-depth: 0 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3143ea1c..024f0c7c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,7 +21,7 @@ jobs: git config --global core.eol lf - name: Check out code - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - name: Setup Go uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: From c78cc2edb3cae10f8227528bd53bbca233ca9df6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 10:51:09 -0400 Subject: [PATCH 31/71] Bump golang.org/x/text from 0.18.0 to 0.19.0 (#405) Bumps [golang.org/x/text](https://github.com/golang/text) from 0.18.0 to 0.19.0. - [Release notes](https://github.com/golang/text/releases) - [Commits](https://github.com/golang/text/compare/v0.18.0...v0.19.0) --- updated-dependencies: - dependency-name: golang.org/x/text dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Austin Valle --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index fdd8661f..44b3fbb5 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/zclconf/go-cty v1.15.0 go.abhg.dev/goldmark/frontmatter v0.2.0 golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df - golang.org/x/text v0.18.0 + golang.org/x/text v0.19.0 ) require ( diff --git a/go.sum b/go.sum index b9abdb5a..fdf1c081 100644 --- a/go.sum +++ b/go.sum @@ -174,8 +174,8 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= -golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= +golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= From 377bb21a949dde4b860121e49cc76edfb39bcec0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 09:59:03 -0400 Subject: [PATCH 32/71] Bump github.com/bmatcuk/doublestar/v4 from 4.6.1 to 4.7.1 (#407) Bumps [github.com/bmatcuk/doublestar/v4](https://github.com/bmatcuk/doublestar) from 4.6.1 to 4.7.1. - [Release notes](https://github.com/bmatcuk/doublestar/releases) - [Commits](https://github.com/bmatcuk/doublestar/compare/v4.6.1...v4.7.1) --- updated-dependencies: - dependency-name: github.com/bmatcuk/doublestar/v4 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 44b3fbb5..9385b202 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.22.7 require ( github.com/Kunde21/markdownfmt/v3 v3.1.0 - github.com/bmatcuk/doublestar/v4 v4.6.1 + github.com/bmatcuk/doublestar/v4 v4.7.1 github.com/google/go-cmp v0.6.0 github.com/hashicorp/cli v1.1.6 github.com/hashicorp/go-version v1.7.0 diff --git a/go.sum b/go.sum index fdf1c081..e1df38d5 100644 --- a/go.sum +++ b/go.sum @@ -20,8 +20,8 @@ github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bmatcuk/doublestar/v4 v4.6.1 h1:FH9SifrbvJhnlQpztAx++wlkk70QBf0iBWDwNy7PA4I= -github.com/bmatcuk/doublestar/v4 v4.6.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= +github.com/bmatcuk/doublestar/v4 v4.7.1 h1:fdDeAqgT47acgwd9bd9HxJRDmc9UAmPpc+2m0CXv75Q= +github.com/bmatcuk/doublestar/v4 v4.7.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= From 6e81fd4566ac58992e238f536af39a214ba728a6 Mon Sep 17 00:00:00 2001 From: "hashicorp-tsccr[bot]" <129506189+hashicorp-tsccr[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 10:01:46 -0400 Subject: [PATCH 33/71] Result of tsccr-helper -log-level=info gha update -latest . (#408) Co-authored-by: hashicorp-tsccr[bot] --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 024f0c7c..4c4426c3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,7 +27,7 @@ jobs: with: go-version-file: 'go.mod' - name: Run linters - uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86 # v6.1.0 + uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1 with: version: latest args: --timeout=3m From 75372b2179b671c4b8263ee2d3172236b98c9f24 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 13:51:22 -0400 Subject: [PATCH 34/71] Bump github.com/yuin/goldmark from 1.7.4 to 1.7.7 (#410) Bumps [github.com/yuin/goldmark](https://github.com/yuin/goldmark) from 1.7.4 to 1.7.7. - [Release notes](https://github.com/yuin/goldmark/releases) - [Commits](https://github.com/yuin/goldmark/compare/v1.7.4...v1.7.7) --- updated-dependencies: - dependency-name: github.com/yuin/goldmark dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 9385b202..8522b9dd 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/hashicorp/terraform-json v0.22.1 github.com/mattn/go-colorable v0.1.13 github.com/rogpeppe/go-internal v1.13.1 - github.com/yuin/goldmark v1.7.4 + github.com/yuin/goldmark v1.7.7 github.com/yuin/goldmark-meta v1.1.0 github.com/zclconf/go-cty v1.15.0 go.abhg.dev/goldmark/frontmatter v0.2.0 diff --git a/go.sum b/go.sum index e1df38d5..cb8cce06 100644 --- a/go.sum +++ b/go.sum @@ -129,8 +129,8 @@ github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/yuin/goldmark v1.7.4 h1:BDXOHExt+A7gwPCJgPIIq7ENvceR7we7rOS9TNoLZeg= -github.com/yuin/goldmark v1.7.4/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= +github.com/yuin/goldmark v1.7.7 h1:5m9rrB1sW3JUMToKFQfb+FGt1U7r57IHu5GrYrG2nqU= +github.com/yuin/goldmark v1.7.7/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= github.com/yuin/goldmark-meta v1.1.0 h1:pWw+JLHGZe8Rk0EGsMVssiNb/AaPMHfSRszZeUeiOUc= github.com/yuin/goldmark-meta v1.1.0/go.mod h1:U4spWENafuA7Zyg+Lj5RqK/MF+ovMYtBvXi1lBb2VP0= github.com/zclconf/go-cty v1.15.0 h1:tTCRWxsexYUmtt/wVxgDClUe+uQusuI443uL6e+5sXQ= From 78dfe49ae193a236f73d27433bf0dc1faed9c2b6 Mon Sep 17 00:00:00 2001 From: "hashicorp-tsccr[bot]" <129506189+hashicorp-tsccr[bot]@users.noreply.github.com> Date: Tue, 22 Oct 2024 09:45:46 -0400 Subject: [PATCH 35/71] Result of tsccr-helper -log-level=info gha update -latest . (#412) Co-authored-by: hashicorp-tsccr[bot] --- .github/workflows/ci-changie.yml | 2 +- .github/workflows/compliance.yml | 2 +- .github/workflows/release.yml | 6 +++--- .github/workflows/test.yml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-changie.yml b/.github/workflows/ci-changie.yml index 60a514c0..33ba8ee8 100644 --- a/.github/workflows/ci-changie.yml +++ b/.github/workflows/ci-changie.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest steps: # Ensure terraform-devex-repos is updated on version changes. - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 # Ensure terraform-devex-repos is updated on version changes. - uses: miniscruff/changie-action@6dcc2533cac0495148ed4046c438487e4dceaa23 # v2.0.0 with: diff --git a/.github/workflows/compliance.yml b/.github/workflows/compliance.yml index ddd4d72a..9511923d 100644 --- a/.github/workflows/compliance.yml +++ b/.github/workflows/compliance.yml @@ -11,7 +11,7 @@ jobs: copywrite: runs-on: ubuntu-latest steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - uses: hashicorp/setup-copywrite@32638da2d4e81d56a0764aa1547882fc4d209636 # v1.1.3 - run: copywrite headers --plan - run: copywrite license --plan diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e253c38d..4b3613dc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,7 +25,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: fetch-depth: 0 # Avoid persisting GITHUB_TOKEN credentials as they take priority over our service account PAT for `git push` operations @@ -54,7 +54,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: fetch-depth: 0 # Default input is the SHA that initially triggered the workflow. As we created a new commit in the previous job, @@ -79,7 +79,7 @@ jobs: contents: write # Needed for goreleaser to create GitHub release issues: write # Needed for goreleaser to close associated milestone steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: ref: ${{ inputs.versionNumber }} fetch-depth: 0 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4c4426c3..ae285a4f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,7 +21,7 @@ jobs: git config --global core.eol lf - name: Check out code - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Setup Go uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: From d70acedf38629b976c2a042e17475aa771aa3800 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 30 Oct 2024 15:20:08 -0400 Subject: [PATCH 36/71] Bump github.com/hashicorp/terraform-json from 0.22.1 to 0.23.0 (#414) Bumps [github.com/hashicorp/terraform-json](https://github.com/hashicorp/terraform-json) from 0.22.1 to 0.23.0. - [Release notes](https://github.com/hashicorp/terraform-json/releases) - [Commits](https://github.com/hashicorp/terraform-json/compare/v0.22.1...v0.23.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-json dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 8522b9dd..b5bb2240 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/hashicorp/go-version v1.7.0 github.com/hashicorp/hc-install v0.9.0 github.com/hashicorp/terraform-exec v0.21.0 - github.com/hashicorp/terraform-json v0.22.1 + github.com/hashicorp/terraform-json v0.23.0 github.com/mattn/go-colorable v0.1.13 github.com/rogpeppe/go-internal v1.13.1 github.com/yuin/goldmark v1.7.7 diff --git a/go.sum b/go.sum index cb8cce06..2b362738 100644 --- a/go.sum +++ b/go.sum @@ -74,8 +74,8 @@ github.com/hashicorp/hc-install v0.9.0 h1:2dIk8LcvANwtv3QZLckxcjyF5w8KVtiMxu6G6e github.com/hashicorp/hc-install v0.9.0/go.mod h1:+6vOP+mf3tuGgMApVYtmsnDoKWMDcFXeTxCACYZ8SFg= github.com/hashicorp/terraform-exec v0.21.0 h1:uNkLAe95ey5Uux6KJdua6+cv8asgILFVWkd/RG0D2XQ= github.com/hashicorp/terraform-exec v0.21.0/go.mod h1:1PPeMYou+KDUSSeRE9szMZ/oHf4fYUmB923Wzbq1ICg= -github.com/hashicorp/terraform-json v0.22.1 h1:xft84GZR0QzjPVWs4lRUwvTcPnegqlyS7orfb5Ltvec= -github.com/hashicorp/terraform-json v0.22.1/go.mod h1:JbWSQCLFSXFFhg42T7l9iJwdGXBYV8fmmD6o/ML4p3A= +github.com/hashicorp/terraform-json v0.23.0 h1:sniCkExU4iKtTADReHzACkk8fnpQXrdD2xoR+lppBkI= +github.com/hashicorp/terraform-json v0.23.0/go.mod h1:MHdXbBAbSg0GvzuWazEGKAn/cyNfIB7mN6y7KJN6y2c= github.com/huandu/xstrings v1.3.3 h1:/Gcsuc1x8JVbJ9/rlye4xZnVAbEkGauT8lbebqcQws4= github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= From 6c67ef29146e354c4134b99f1d603cbeca90d87c Mon Sep 17 00:00:00 2001 From: Selena Goods Date: Thu, 31 Oct 2024 09:41:14 -0400 Subject: [PATCH 37/71] Validate: refactor internal methods to use `fs.FS` interface for file handling (#413) * Refactor `validateStaticDocs()` and `validateLegacyWebsite()` to use a `fs.FS` interface for walking. * Refactor `validate_test.go` to use `fstest.MapFS` * Refactor `directory_test.go` to use `fstest.MapFS` * Add tests for file mismatch check * Fix `unparam` lints * Add changelog entries * Use `filepath.Join` instead of `website/docs` for windows compatability. * Revert "Use `filepath.Join` instead of `website/docs` for windows compatability." This reverts commit 9c92c3e08a665e7e43322902c4876a9c84277d7d. * Remove `filepath.Join()` usages and `/` separator conversions. * Remove `filepath.fromSlash()` usages * Use `path.Dir()` instead of `filepath.Dir()` * Use `doublestar.Match()` instead of `doublestar.PathMatch()` * Convert path slashes to os separators in error messages * Convert path slashes to os separators in invalid directory check error messages --- .../unreleased/BUG FIXES-20241022-163805.yaml | 5 + .../unreleased/BUG FIXES-20241022-164013.yaml | 5 + .../unreleased/BUG FIXES-20241022-164107.yaml | 5 + internal/check/directory.go | 21 +- internal/check/directory_test.go | 86 +- internal/check/file.go | 8 +- internal/check/file_extension.go | 2 +- internal/check/file_test.go | 32 +- internal/check/provider_file.go | 23 +- .../docs/resources/thing.md | 27 - .../website/docs/r/thing.html.markdown | 0 .../docs/CONTRIBUTING.md | 3 - .../docs/nonregistrydocs/valid.md | 3 - .../website/docs/r/thing.html.markdown | 27 - .../docs/r/invalid/thing.html.markdown | 27 - .../data_source_invalid_extension.txt | 27 - ...a_source_invalid_frontmatter.html.markdown | 27 - ..._source_with_sidebar_current.html.markdown | 28 - .../data_source_without_layout.html.markdown | 26 - .../guide_invalid_extension.txt | 11 - .../guide_invalid_frontmatter.html.markdown | 11 - .../guide_with_sidebar_current.html.markdown | 12 - .../guide_without_layout.html.markdown | 10 - .../index_invalid_extension.txt | 10 - .../index_invalid_frontmatter.html.markdown | 10 - .../index_with_sidebar_current.html.markdown | 11 - .../index_with_subcategory.html.markdown | 10 - .../index_without_layout.html.markdown | 9 - .../resource_invalid_extension.txt | 27 - ...resource_invalid_frontmatter.html.markdown | 27 - ...esource_with_sidebar_current.html.markdown | 28 - .../resource_without_layout.html.markdown | 26 - .../docs/resources/invalid/thing.md | 26 - .../data_source_invalid_extension.markdown | 26 - .../data_source_invalid_frontmatter.md | 26 - .../data_source_with_layout.md | 27 - .../data_source_with_sidebar_current.md | 27 - .../guide_invalid_extension.markdown | 10 - .../guide_invalid_frontmatter.md | 10 - .../guide_with_layout.md | 11 - .../guide_with_sidebar_current.md | 11 - .../index_invalid_extension.markdown | 9 - .../index_invalid_frontmatter.md | 9 - .../index_with_layout.md | 10 - .../index_with_sidebar_current.md | 10 - .../index_with_subcategory.md | 10 - .../resource_invalid_extension.markdown | 26 - .../resource_invalid_frontmatter.md | 26 - .../resource_with_layout.md | 27 - .../resource_with_sidebar_current.md | 27 - .../cdktf/typescript/d/thing.html.markdown | 37 - .../cdktf/typescript/r/thing.html.markdown | 37 - .../website/docs/d/thing.html.markdown | 27 - .../website/docs/r/thing.html.markdown | 27 - .../website/docs/d/thing.html.markdown | 27 - .../website/docs/r/thing.html.markdown | 27 - .../2.0-guide.html.markdown | 11 - .../data_source.html.markdown | 27 - .../valid-legacy-files/guide.html.markdown | 11 - .../valid-legacy-files/index.html.markdown | 10 - .../valid-legacy-files/resource.html.markdown | 27 - .../docs/CONTRIBUTING.md | 3 - .../docs/cdktf/typescript/CONTRIBUTING.md | 3 - .../cdktf/typescript/data-sources/thing.md | 36 - .../docs/cdktf/typescript/index.md | 9 - .../cdktf/typescript/nonregistrydocs/valid.md | 3 - .../docs/cdktf/typescript/resources/thing.md | 36 - .../docs/data-sources/thing.md | 26 - .../docs/index.md | 9 - .../docs/nonregistrydocs/valid.md | 3 - .../docs/resources/thing.md | 26 - .../docs/CONTRIBUTING.md | 3 - .../docs/data-sources/thing.md | 26 - .../valid-registry-directories/docs/index.md | 9 - .../docs/nonregistrydocs/valid.md | 3 - .../docs/resources/thing.md | 26 - .../valid-registry-files/2.0-guide.md | 10 - .../valid-registry-files/data_source.md | 26 - .../testdata/valid-registry-files/guide.md | 10 - .../testdata/valid-registry-files/index.md | 9 - .../testdata/valid-registry-files/resource.md | 26 - internal/provider/validate.go | 110 +-- internal/provider/validate_test.go | 908 +++++++++++++++++- 83 files changed, 1064 insertions(+), 1436 deletions(-) create mode 100644 .changes/unreleased/BUG FIXES-20241022-163805.yaml create mode 100644 .changes/unreleased/BUG FIXES-20241022-164013.yaml create mode 100644 .changes/unreleased/BUG FIXES-20241022-164107.yaml delete mode 100644 internal/check/testdata/invalid-mixed-directories/docs/resources/thing.md delete mode 100644 internal/check/testdata/invalid-mixed-directories/website/docs/r/thing.html.markdown delete mode 100644 internal/check/testdata/valid-mixed-directories/docs/CONTRIBUTING.md delete mode 100644 internal/check/testdata/valid-mixed-directories/docs/nonregistrydocs/valid.md delete mode 100644 internal/check/testdata/valid-mixed-directories/website/docs/r/thing.html.markdown delete mode 100644 internal/provider/testdata/invalid-legacy-directories/website/docs/r/invalid/thing.html.markdown delete mode 100644 internal/provider/testdata/invalid-legacy-files/data_source_invalid_extension.txt delete mode 100644 internal/provider/testdata/invalid-legacy-files/data_source_invalid_frontmatter.html.markdown delete mode 100644 internal/provider/testdata/invalid-legacy-files/data_source_with_sidebar_current.html.markdown delete mode 100644 internal/provider/testdata/invalid-legacy-files/data_source_without_layout.html.markdown delete mode 100644 internal/provider/testdata/invalid-legacy-files/guide_invalid_extension.txt delete mode 100644 internal/provider/testdata/invalid-legacy-files/guide_invalid_frontmatter.html.markdown delete mode 100644 internal/provider/testdata/invalid-legacy-files/guide_with_sidebar_current.html.markdown delete mode 100644 internal/provider/testdata/invalid-legacy-files/guide_without_layout.html.markdown delete mode 100644 internal/provider/testdata/invalid-legacy-files/index_invalid_extension.txt delete mode 100644 internal/provider/testdata/invalid-legacy-files/index_invalid_frontmatter.html.markdown delete mode 100644 internal/provider/testdata/invalid-legacy-files/index_with_sidebar_current.html.markdown delete mode 100644 internal/provider/testdata/invalid-legacy-files/index_with_subcategory.html.markdown delete mode 100644 internal/provider/testdata/invalid-legacy-files/index_without_layout.html.markdown delete mode 100644 internal/provider/testdata/invalid-legacy-files/resource_invalid_extension.txt delete mode 100644 internal/provider/testdata/invalid-legacy-files/resource_invalid_frontmatter.html.markdown delete mode 100644 internal/provider/testdata/invalid-legacy-files/resource_with_sidebar_current.html.markdown delete mode 100644 internal/provider/testdata/invalid-legacy-files/resource_without_layout.html.markdown delete mode 100644 internal/provider/testdata/invalid-registry-directories/docs/resources/invalid/thing.md delete mode 100644 internal/provider/testdata/invalid-registry-files/data_source_invalid_extension.markdown delete mode 100644 internal/provider/testdata/invalid-registry-files/data_source_invalid_frontmatter.md delete mode 100644 internal/provider/testdata/invalid-registry-files/data_source_with_layout.md delete mode 100644 internal/provider/testdata/invalid-registry-files/data_source_with_sidebar_current.md delete mode 100644 internal/provider/testdata/invalid-registry-files/guide_invalid_extension.markdown delete mode 100644 internal/provider/testdata/invalid-registry-files/guide_invalid_frontmatter.md delete mode 100644 internal/provider/testdata/invalid-registry-files/guide_with_layout.md delete mode 100644 internal/provider/testdata/invalid-registry-files/guide_with_sidebar_current.md delete mode 100644 internal/provider/testdata/invalid-registry-files/index_invalid_extension.markdown delete mode 100644 internal/provider/testdata/invalid-registry-files/index_invalid_frontmatter.md delete mode 100644 internal/provider/testdata/invalid-registry-files/index_with_layout.md delete mode 100644 internal/provider/testdata/invalid-registry-files/index_with_sidebar_current.md delete mode 100644 internal/provider/testdata/invalid-registry-files/index_with_subcategory.md delete mode 100644 internal/provider/testdata/invalid-registry-files/resource_invalid_extension.markdown delete mode 100644 internal/provider/testdata/invalid-registry-files/resource_invalid_frontmatter.md delete mode 100644 internal/provider/testdata/invalid-registry-files/resource_with_layout.md delete mode 100644 internal/provider/testdata/invalid-registry-files/resource_with_sidebar_current.md delete mode 100644 internal/provider/testdata/valid-legacy-directories-with-cdktf/website/docs/cdktf/typescript/d/thing.html.markdown delete mode 100644 internal/provider/testdata/valid-legacy-directories-with-cdktf/website/docs/cdktf/typescript/r/thing.html.markdown delete mode 100644 internal/provider/testdata/valid-legacy-directories-with-cdktf/website/docs/d/thing.html.markdown delete mode 100644 internal/provider/testdata/valid-legacy-directories-with-cdktf/website/docs/r/thing.html.markdown delete mode 100644 internal/provider/testdata/valid-legacy-directories/website/docs/d/thing.html.markdown delete mode 100644 internal/provider/testdata/valid-legacy-directories/website/docs/r/thing.html.markdown delete mode 100644 internal/provider/testdata/valid-legacy-files/2.0-guide.html.markdown delete mode 100644 internal/provider/testdata/valid-legacy-files/data_source.html.markdown delete mode 100644 internal/provider/testdata/valid-legacy-files/guide.html.markdown delete mode 100644 internal/provider/testdata/valid-legacy-files/index.html.markdown delete mode 100644 internal/provider/testdata/valid-legacy-files/resource.html.markdown delete mode 100644 internal/provider/testdata/valid-registry-directories-with-cdktf/docs/CONTRIBUTING.md delete mode 100644 internal/provider/testdata/valid-registry-directories-with-cdktf/docs/cdktf/typescript/CONTRIBUTING.md delete mode 100644 internal/provider/testdata/valid-registry-directories-with-cdktf/docs/cdktf/typescript/data-sources/thing.md delete mode 100644 internal/provider/testdata/valid-registry-directories-with-cdktf/docs/cdktf/typescript/index.md delete mode 100644 internal/provider/testdata/valid-registry-directories-with-cdktf/docs/cdktf/typescript/nonregistrydocs/valid.md delete mode 100644 internal/provider/testdata/valid-registry-directories-with-cdktf/docs/cdktf/typescript/resources/thing.md delete mode 100644 internal/provider/testdata/valid-registry-directories-with-cdktf/docs/data-sources/thing.md delete mode 100644 internal/provider/testdata/valid-registry-directories-with-cdktf/docs/index.md delete mode 100644 internal/provider/testdata/valid-registry-directories-with-cdktf/docs/nonregistrydocs/valid.md delete mode 100644 internal/provider/testdata/valid-registry-directories-with-cdktf/docs/resources/thing.md delete mode 100644 internal/provider/testdata/valid-registry-directories/docs/CONTRIBUTING.md delete mode 100644 internal/provider/testdata/valid-registry-directories/docs/data-sources/thing.md delete mode 100644 internal/provider/testdata/valid-registry-directories/docs/index.md delete mode 100644 internal/provider/testdata/valid-registry-directories/docs/nonregistrydocs/valid.md delete mode 100644 internal/provider/testdata/valid-registry-directories/docs/resources/thing.md delete mode 100644 internal/provider/testdata/valid-registry-files/2.0-guide.md delete mode 100644 internal/provider/testdata/valid-registry-files/data_source.md delete mode 100644 internal/provider/testdata/valid-registry-files/guide.md delete mode 100644 internal/provider/testdata/valid-registry-files/index.md delete mode 100644 internal/provider/testdata/valid-registry-files/resource.md diff --git a/.changes/unreleased/BUG FIXES-20241022-163805.yaml b/.changes/unreleased/BUG FIXES-20241022-163805.yaml new file mode 100644 index 00000000..a35ff8bb --- /dev/null +++ b/.changes/unreleased/BUG FIXES-20241022-163805.yaml @@ -0,0 +1,5 @@ +kind: BUG FIXES +body: 'validate: File extension check now runs on `index.*` files instead of just `index.md` files.' +time: 2024-10-22T16:38:05.530944-04:00 +custom: + Issue: "413" diff --git a/.changes/unreleased/BUG FIXES-20241022-164013.yaml b/.changes/unreleased/BUG FIXES-20241022-164013.yaml new file mode 100644 index 00000000..193336c8 --- /dev/null +++ b/.changes/unreleased/BUG FIXES-20241022-164013.yaml @@ -0,0 +1,5 @@ +kind: BUG FIXES +body: 'validate: File extension check now specifies the correct valid extensions in the error message.' +time: 2024-10-22T16:40:13.832638-04:00 +custom: + Issue: "413" diff --git a/.changes/unreleased/BUG FIXES-20241022-164107.yaml b/.changes/unreleased/BUG FIXES-20241022-164107.yaml new file mode 100644 index 00000000..584931b1 --- /dev/null +++ b/.changes/unreleased/BUG FIXES-20241022-164107.yaml @@ -0,0 +1,5 @@ +kind: BUG FIXES +body: 'validate: Front matter check now runs with the correct options on legacy index files.' +time: 2024-10-22T16:41:07.726856-04:00 +custom: + Issue: "413" diff --git a/internal/check/directory.go b/internal/check/directory.go index 3c3183b7..17c16d42 100644 --- a/internal/check/directory.go +++ b/internal/check/directory.go @@ -6,6 +6,7 @@ package check import ( "fmt" "log" + "path" "path/filepath" ) @@ -82,7 +83,7 @@ func InvalidDirectoriesCheck(dirPath string) error { return nil } - return fmt.Errorf("invalid Terraform Provider documentation directory found: %s", dirPath) + return fmt.Errorf("invalid Terraform Provider documentation directory found: %s", filepath.FromSlash(dirPath)) } @@ -92,7 +93,7 @@ func MixedDirectoriesCheck(docFiles []string) error { err := fmt.Errorf("mixed Terraform Provider documentation directory layouts found, must use only legacy or registry layout") for _, file := range docFiles { - directory := filepath.Dir(file) + directory := path.Dir(file) log.Printf("[DEBUG] Found directory: %s", directory) // Allow docs/ with other files @@ -120,7 +121,7 @@ func MixedDirectoriesCheck(docFiles []string) error { func IsValidLegacyDirectory(directory string) bool { for _, validLegacyDirectory := range ValidLegacyDirectories { - if directory == filepath.FromSlash(validLegacyDirectory) { + if directory == validLegacyDirectory { return true } } @@ -130,7 +131,7 @@ func IsValidLegacyDirectory(directory string) bool { func IsValidRegistryDirectory(directory string) bool { for _, validRegistryDirectory := range ValidRegistryDirectories { - if directory == filepath.FromSlash(validRegistryDirectory) { + if directory == validRegistryDirectory { return true } } @@ -139,32 +140,32 @@ func IsValidRegistryDirectory(directory string) bool { } func IsValidCdktfDirectory(directory string) bool { - if directory == filepath.FromSlash(fmt.Sprintf("%s/%s", LegacyIndexDirectory, CdktfIndexDirectory)) { + if directory == fmt.Sprintf("%s/%s", LegacyIndexDirectory, CdktfIndexDirectory) { return true } - if directory == filepath.FromSlash(fmt.Sprintf("%s/%s", RegistryIndexDirectory, CdktfIndexDirectory)) { + if directory == fmt.Sprintf("%s/%s", RegistryIndexDirectory, CdktfIndexDirectory) { return true } for _, validCdktfLanguage := range ValidCdktfLanguages { - if directory == filepath.FromSlash(fmt.Sprintf("%s/%s/%s", LegacyIndexDirectory, CdktfIndexDirectory, validCdktfLanguage)) { + if directory == fmt.Sprintf("%s/%s/%s", LegacyIndexDirectory, CdktfIndexDirectory, validCdktfLanguage) { return true } - if directory == filepath.FromSlash(fmt.Sprintf("%s/%s/%s", RegistryIndexDirectory, CdktfIndexDirectory, validCdktfLanguage)) { + if directory == fmt.Sprintf("%s/%s/%s", RegistryIndexDirectory, CdktfIndexDirectory, validCdktfLanguage) { return true } for _, validLegacySubdirectory := range ValidLegacySubdirectories { - if directory == filepath.FromSlash(fmt.Sprintf("%s/%s/%s/%s", LegacyIndexDirectory, CdktfIndexDirectory, validCdktfLanguage, validLegacySubdirectory)) { + if directory == fmt.Sprintf("%s/%s/%s/%s", LegacyIndexDirectory, CdktfIndexDirectory, validCdktfLanguage, validLegacySubdirectory) { return true } } for _, validRegistrySubdirectory := range ValidRegistrySubdirectories { - if directory == filepath.FromSlash(fmt.Sprintf("%s/%s/%s/%s", RegistryIndexDirectory, CdktfIndexDirectory, validCdktfLanguage, validRegistrySubdirectory)) { + if directory == fmt.Sprintf("%s/%s/%s/%s", RegistryIndexDirectory, CdktfIndexDirectory, validCdktfLanguage, validRegistrySubdirectory) { return true } } diff --git a/internal/check/directory_test.go b/internal/check/directory_test.go index 29660713..95c6f8a7 100644 --- a/internal/check/directory_test.go +++ b/internal/check/directory_test.go @@ -4,26 +4,94 @@ package check import ( - "os" - "path/filepath" + "io/fs" "testing" + "testing/fstest" "github.com/bmatcuk/doublestar/v4" ) -var DocumentationGlobPattern = `{docs/index.md,docs/{,cdktf/}{data-sources,guides,resources,functions}/**/*,website/docs/**/*}` +var DocumentationGlobPattern = `{docs/index.*,docs/{,cdktf/}{data-sources,guides,resources,functions}/**/*,website/docs/**/*}` func TestMixedDirectoriesCheck(t *testing.T) { t.Parallel() testCases := map[string]struct { - BasePath string + ProviderFS fs.FS ExpectError bool }{ "valid mixed directories": { - BasePath: filepath.Join("testdata", "valid-mixed-directories"), + ProviderFS: fstest.MapFS{ + "docs/nonregistrydocs/thing.md": {}, + "website/docs/index.md": {}, + }, }, - "invalid mixed directories": { - BasePath: filepath.Join("testdata", "invalid-mixed-directories"), + "valid mixed directories - cdktf": { + ProviderFS: fstest.MapFS{ + "docs/cdktf/typescript/index.md": {}, + "website/docs/index.md": {}, + }, + }, + "invalid mixed directories - registry data source": { + ProviderFS: fstest.MapFS{ + "docs/data-sources/invalid.md": {}, + "website/docs/index.md": {}, + }, + ExpectError: true, + }, + "invalid mixed directories - registry resource": { + ProviderFS: fstest.MapFS{ + "docs/resources/invalid.md": {}, + "website/docs/index.md": {}, + }, + ExpectError: true, + }, + "invalid mixed directories - registry guide": { + ProviderFS: fstest.MapFS{ + "docs/guides/invalid.md": {}, + "website/docs/index.md": {}, + }, + ExpectError: true, + }, + "invalid mixed directories - registry function": { + ProviderFS: fstest.MapFS{ + "docs/functions/invalid.md": {}, + "website/docs/index.md": {}, + }, + ExpectError: true, + }, + "invalid mixed directories - legacy data source": { + ProviderFS: fstest.MapFS{ + "website/docs/d/invalid.html.markdown": {}, + "docs/resources/thing.md": {}, + }, + ExpectError: true, + }, + "invalid mixed directories - legacy resource": { + ProviderFS: fstest.MapFS{ + "website/docs/r/invalid.html.markdown": {}, + "docs/resources/thing.md": {}, + }, + ExpectError: true, + }, + "invalid mixed directories - legacy guide": { + ProviderFS: fstest.MapFS{ + "website/docs/guides/invalid.html.markdown": {}, + "docs/resources/thing.md": {}, + }, + ExpectError: true, + }, + "invalid mixed directories - legacy function": { + ProviderFS: fstest.MapFS{ + "website/docs/functions/invalid.html.markdown": {}, + "docs/resources/thing.md": {}, + }, + ExpectError: true, + }, + "invalid mixed directories - legacy index": { + ProviderFS: fstest.MapFS{ + "website/docs/index.html.markdown": {}, + "docs/resources/thing.md": {}, + }, ExpectError: true, }, } @@ -34,9 +102,7 @@ func TestMixedDirectoriesCheck(t *testing.T) { t.Run(name, func(t *testing.T) { t.Parallel() - providerFs := os.DirFS(testCase.BasePath) - - files, err := doublestar.Glob(providerFs, DocumentationGlobPattern) + files, err := doublestar.Glob(testCase.ProviderFS, DocumentationGlobPattern) if err != nil { t.Fatalf("error finding documentation files: %s", err) } diff --git a/internal/check/file.go b/internal/check/file.go index cb079b3a..5cf94b11 100644 --- a/internal/check/file.go +++ b/internal/check/file.go @@ -5,8 +5,8 @@ package check import ( "fmt" + "io/fs" "log" - "os" "path/filepath" ) @@ -23,14 +23,14 @@ func (opts *FileOptions) FullPath(path string) string { } // FileSizeCheck verifies that documentation file is below the Terraform Registry storage limit. -func FileSizeCheck(fullpath string) error { - fi, err := os.Stat(fullpath) +func FileSizeCheck(providerFs fs.FS, path string) error { + fi, err := fs.Stat(providerFs, path) if err != nil { return err } - log.Printf("[DEBUG] File %s size: %d (limit: %d)", fullpath, fi.Size(), RegistryMaximumSizeOfFile) + log.Printf("[DEBUG] File %s size: %d (limit: %d)", path, fi.Size(), RegistryMaximumSizeOfFile) if fi.Size() >= int64(RegistryMaximumSizeOfFile) { return fmt.Errorf("exceeded maximum (%d) size of documentation file for Terraform Registry: %d", RegistryMaximumSizeOfFile, fi.Size()) } diff --git a/internal/check/file_extension.go b/internal/check/file_extension.go index dd5f37b6..7ca7b20f 100644 --- a/internal/check/file_extension.go +++ b/internal/check/file_extension.go @@ -30,7 +30,7 @@ var ValidRegistryFileExtensions = []string{ // FileExtensionCheck checks if the file extension of the given path is valid. func FileExtensionCheck(path string, validExtensions []string) error { if !FilePathEndsWithExtensionFrom(path, validExtensions) { - return fmt.Errorf("file does not end with a valid extension, valid extensions: %v", ValidLegacyFileExtensions) + return fmt.Errorf("file does not end with a valid extension, valid extensions: %v", validExtensions) } return nil diff --git a/internal/check/file_test.go b/internal/check/file_test.go index c8ec7b8b..d29a7e7f 100644 --- a/internal/check/file_test.go +++ b/internal/check/file_test.go @@ -4,26 +4,40 @@ package check import ( - "os" + "io/fs" "path/filepath" "testing" + "testing/fstest" ) func TestFileSizeCheck(t *testing.T) { t.Parallel() testCases := map[string]struct { + FileSystem fs.FS Size int64 ExpectError bool }{ "under limit": { - Size: RegistryMaximumSizeOfFile - 1, + FileSystem: fstest.MapFS{ + "file.md": { + Data: make([]byte, RegistryMaximumSizeOfFile-1), + }, + }, }, "on limit": { - Size: RegistryMaximumSizeOfFile, + FileSystem: fstest.MapFS{ + "file.md": { + Data: make([]byte, RegistryMaximumSizeOfFile), + }, + }, ExpectError: true, }, "over limit": { - Size: RegistryMaximumSizeOfFile + 1, + FileSystem: fstest.MapFS{ + "file.md": { + Data: make([]byte, RegistryMaximumSizeOfFile+1), + }, + }, ExpectError: true, }, } @@ -34,15 +48,7 @@ func TestFileSizeCheck(t *testing.T) { t.Run(name, func(t *testing.T) { t.Parallel() - file, _ := os.CreateTemp(t.TempDir(), "TestFileSizeCheck") - - defer file.Close() - - if err := file.Truncate(testCase.Size); err != nil { - t.Fatalf("error writing temporary file: %s", err) - } - - got := FileSizeCheck(file.Name()) + got := FileSizeCheck(testCase.FileSystem, "file.md") if got == nil && testCase.ExpectError { t.Errorf("expected error, got no error") diff --git a/internal/check/provider_file.go b/internal/check/provider_file.go index 5358b669..cae52a9b 100644 --- a/internal/check/provider_file.go +++ b/internal/check/provider_file.go @@ -5,8 +5,9 @@ package check import ( "fmt" + "io/fs" "log" - "os" + "path/filepath" ) type ProviderFileOptions struct { @@ -17,12 +18,14 @@ type ProviderFileOptions struct { } type ProviderFileCheck struct { - Options *ProviderFileOptions + Options *ProviderFileOptions + ProviderFs fs.FS } -func NewProviderFileCheck(opts *ProviderFileOptions) *ProviderFileCheck { +func NewProviderFileCheck(providerFs fs.FS, opts *ProviderFileOptions) *ProviderFileCheck { check := &ProviderFileCheck{ - Options: opts, + Options: opts, + ProviderFs: providerFs, } if check.Options == nil { @@ -46,21 +49,21 @@ func (check *ProviderFileCheck) Run(path string) error { log.Printf("[DEBUG] Checking file: %s", fullpath) if err := FileExtensionCheck(path, check.Options.ValidExtensions); err != nil { - return fmt.Errorf("%s: error checking file extension: %w", path, err) + return fmt.Errorf("%s: error checking file extension: %w", filepath.FromSlash(path), err) } - if err := FileSizeCheck(fullpath); err != nil { - return fmt.Errorf("%s: error checking file size: %w", path, err) + if err := FileSizeCheck(check.ProviderFs, path); err != nil { + return fmt.Errorf("%s: error checking file size: %w", filepath.FromSlash(path), err) } - content, err := os.ReadFile(fullpath) + content, err := fs.ReadFile(check.ProviderFs, path) if err != nil { - return fmt.Errorf("%s: error reading file: %w", path, err) + return fmt.Errorf("%s: error reading file: %w", filepath.FromSlash(path), err) } if err := NewFrontMatterCheck(check.Options.FrontMatter).Run(content); err != nil { - return fmt.Errorf("%s: error checking file frontmatter: %w", path, err) + return fmt.Errorf("%s: error checking file frontmatter: %w", filepath.FromSlash(path), err) } return nil diff --git a/internal/check/testdata/invalid-mixed-directories/docs/resources/thing.md b/internal/check/testdata/invalid-mixed-directories/docs/resources/thing.md deleted file mode 100644 index 59bb04cc..00000000 --- a/internal/check/testdata/invalid-mixed-directories/docs/resources/thing.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -subcategory: "Example" -layout: "example" -page_title: "Example: example_thing" -description: |- - Example description. ---- - -# Resource: example_thing - -Byline. - -## Example Usage - -```terraform -resource "example_thing" "example" { - name = "example" -} -``` - -## Argument Reference - -* `name` - (Required) Name of thing. - -## Attribute Reference - -* `id` - Name of thing. diff --git a/internal/check/testdata/invalid-mixed-directories/website/docs/r/thing.html.markdown b/internal/check/testdata/invalid-mixed-directories/website/docs/r/thing.html.markdown deleted file mode 100644 index e69de29b..00000000 diff --git a/internal/check/testdata/valid-mixed-directories/docs/CONTRIBUTING.md b/internal/check/testdata/valid-mixed-directories/docs/CONTRIBUTING.md deleted file mode 100644 index 423305c4..00000000 --- a/internal/check/testdata/valid-mixed-directories/docs/CONTRIBUTING.md +++ /dev/null @@ -1,3 +0,0 @@ -# Contributing Guide - -This file has contents and no YAML frontmatter, because it is not a Terraform Provider documentation file and that is okay. diff --git a/internal/check/testdata/valid-mixed-directories/docs/nonregistrydocs/valid.md b/internal/check/testdata/valid-mixed-directories/docs/nonregistrydocs/valid.md deleted file mode 100644 index a7f1fce5..00000000 --- a/internal/check/testdata/valid-mixed-directories/docs/nonregistrydocs/valid.md +++ /dev/null @@ -1,3 +0,0 @@ -# Valid - -Files in `/docs`, but outside Registry documentation directories, should be ignored. diff --git a/internal/check/testdata/valid-mixed-directories/website/docs/r/thing.html.markdown b/internal/check/testdata/valid-mixed-directories/website/docs/r/thing.html.markdown deleted file mode 100644 index 59bb04cc..00000000 --- a/internal/check/testdata/valid-mixed-directories/website/docs/r/thing.html.markdown +++ /dev/null @@ -1,27 +0,0 @@ ---- -subcategory: "Example" -layout: "example" -page_title: "Example: example_thing" -description: |- - Example description. ---- - -# Resource: example_thing - -Byline. - -## Example Usage - -```terraform -resource "example_thing" "example" { - name = "example" -} -``` - -## Argument Reference - -* `name` - (Required) Name of thing. - -## Attribute Reference - -* `id` - Name of thing. diff --git a/internal/provider/testdata/invalid-legacy-directories/website/docs/r/invalid/thing.html.markdown b/internal/provider/testdata/invalid-legacy-directories/website/docs/r/invalid/thing.html.markdown deleted file mode 100644 index 59bb04cc..00000000 --- a/internal/provider/testdata/invalid-legacy-directories/website/docs/r/invalid/thing.html.markdown +++ /dev/null @@ -1,27 +0,0 @@ ---- -subcategory: "Example" -layout: "example" -page_title: "Example: example_thing" -description: |- - Example description. ---- - -# Resource: example_thing - -Byline. - -## Example Usage - -```terraform -resource "example_thing" "example" { - name = "example" -} -``` - -## Argument Reference - -* `name` - (Required) Name of thing. - -## Attribute Reference - -* `id` - Name of thing. diff --git a/internal/provider/testdata/invalid-legacy-files/data_source_invalid_extension.txt b/internal/provider/testdata/invalid-legacy-files/data_source_invalid_extension.txt deleted file mode 100644 index caee79a4..00000000 --- a/internal/provider/testdata/invalid-legacy-files/data_source_invalid_extension.txt +++ /dev/null @@ -1,27 +0,0 @@ ---- -subcategory: "Example" -layout: "example" -page_title: "Example: example_thing" -description: |- - Example description. ---- - -# Data Source: example_thing - -Byline. - -## Example Usage - -```terraform -data "example_thing" "example" { - name = "example" -} -``` - -## Argument Reference - -* `name` - (Required) Name of thing. - -## Attribute Reference - -* `id` - Name of thing. diff --git a/internal/provider/testdata/invalid-legacy-files/data_source_invalid_frontmatter.html.markdown b/internal/provider/testdata/invalid-legacy-files/data_source_invalid_frontmatter.html.markdown deleted file mode 100644 index 1cb8750a..00000000 --- a/internal/provider/testdata/invalid-legacy-files/data_source_invalid_frontmatter.html.markdown +++ /dev/null @@ -1,27 +0,0 @@ ---- -subcategory: "Example" -layout: "example" -page_title: "Example: example_thing" -description: |- -Missing indentation. ---- - -# Data Source: example_thing - -Byline. - -## Example Usage - -```terraform -data "example_thing" "example" { - name = "example" -} -``` - -## Argument Reference - -* `name` - (Required) Name of thing. - -## Attribute Reference - -* `id` - Name of thing. diff --git a/internal/provider/testdata/invalid-legacy-files/data_source_with_sidebar_current.html.markdown b/internal/provider/testdata/invalid-legacy-files/data_source_with_sidebar_current.html.markdown deleted file mode 100644 index 510d48ae..00000000 --- a/internal/provider/testdata/invalid-legacy-files/data_source_with_sidebar_current.html.markdown +++ /dev/null @@ -1,28 +0,0 @@ ---- -subcategory: "Example" -sidebar_current: "example_thing" -layout: "example" -page_title: "Example: example_thing" -description: |- - Example description. ---- - -# Data Source: example_thing - -Byline. - -## Example Usage - -```terraform -data "example_thing" "example" { - name = "example" -} -``` - -## Argument Reference - -* `name` - (Required) Name of thing. - -## Attribute Reference - -* `id` - Name of thing. diff --git a/internal/provider/testdata/invalid-legacy-files/data_source_without_layout.html.markdown b/internal/provider/testdata/invalid-legacy-files/data_source_without_layout.html.markdown deleted file mode 100644 index 688fa598..00000000 --- a/internal/provider/testdata/invalid-legacy-files/data_source_without_layout.html.markdown +++ /dev/null @@ -1,26 +0,0 @@ ---- -subcategory: "Example" -page_title: "Example: example_thing" -description: |- - Example description. ---- - -# Data Source: example_thing - -Byline. - -## Example Usage - -```terraform -data "example_thing" "example" { - name = "example" -} -``` - -## Argument Reference - -* `name` - (Required) Name of thing. - -## Attribute Reference - -* `id` - Name of thing. diff --git a/internal/provider/testdata/invalid-legacy-files/guide_invalid_extension.txt b/internal/provider/testdata/invalid-legacy-files/guide_invalid_extension.txt deleted file mode 100644 index b02bcc8e..00000000 --- a/internal/provider/testdata/invalid-legacy-files/guide_invalid_extension.txt +++ /dev/null @@ -1,11 +0,0 @@ ---- -subcategory: "Example" -layout: "example" -page_title: "Example Guide" -description: |- - Example description. ---- - -# Example Guide - -Example contents. diff --git a/internal/provider/testdata/invalid-legacy-files/guide_invalid_frontmatter.html.markdown b/internal/provider/testdata/invalid-legacy-files/guide_invalid_frontmatter.html.markdown deleted file mode 100644 index 33997fc6..00000000 --- a/internal/provider/testdata/invalid-legacy-files/guide_invalid_frontmatter.html.markdown +++ /dev/null @@ -1,11 +0,0 @@ ---- -subcategory: "Example" -layout: "example" -page_title: "Example Guide" -description: |- -Missing indentation. ---- - -# Example Guide - -Example contents. diff --git a/internal/provider/testdata/invalid-legacy-files/guide_with_sidebar_current.html.markdown b/internal/provider/testdata/invalid-legacy-files/guide_with_sidebar_current.html.markdown deleted file mode 100644 index 5a101a3c..00000000 --- a/internal/provider/testdata/invalid-legacy-files/guide_with_sidebar_current.html.markdown +++ /dev/null @@ -1,12 +0,0 @@ ---- -subcategory: "Example" -sidebar_current: "example" -layout: "example" -page_title: "Example Guide" -description: |- - Example description. ---- - -# Example Guide - -Example contents. diff --git a/internal/provider/testdata/invalid-legacy-files/guide_without_layout.html.markdown b/internal/provider/testdata/invalid-legacy-files/guide_without_layout.html.markdown deleted file mode 100644 index 61331ef0..00000000 --- a/internal/provider/testdata/invalid-legacy-files/guide_without_layout.html.markdown +++ /dev/null @@ -1,10 +0,0 @@ ---- -subcategory: "Example" -page_title: "Example Guide" -description: |- - Example description. ---- - -# Example Guide - -Example contents. diff --git a/internal/provider/testdata/invalid-legacy-files/index_invalid_extension.txt b/internal/provider/testdata/invalid-legacy-files/index_invalid_extension.txt deleted file mode 100644 index c4ab1478..00000000 --- a/internal/provider/testdata/invalid-legacy-files/index_invalid_extension.txt +++ /dev/null @@ -1,10 +0,0 @@ ---- -layout: "example" -page_title: "Example Provider" -description: |- - Example description. ---- - -# Example Provider - -Example contents. diff --git a/internal/provider/testdata/invalid-legacy-files/index_invalid_frontmatter.html.markdown b/internal/provider/testdata/invalid-legacy-files/index_invalid_frontmatter.html.markdown deleted file mode 100644 index c4903d5a..00000000 --- a/internal/provider/testdata/invalid-legacy-files/index_invalid_frontmatter.html.markdown +++ /dev/null @@ -1,10 +0,0 @@ ---- -layout: "example" -page_title: "Example Provider" -description: |- -Missing indentation. ---- - -# Example Provider - -Example contents. diff --git a/internal/provider/testdata/invalid-legacy-files/index_with_sidebar_current.html.markdown b/internal/provider/testdata/invalid-legacy-files/index_with_sidebar_current.html.markdown deleted file mode 100644 index fe33d3f2..00000000 --- a/internal/provider/testdata/invalid-legacy-files/index_with_sidebar_current.html.markdown +++ /dev/null @@ -1,11 +0,0 @@ ---- -sidebar_current: "example" -layout: "example" -page_title: "Example Provider" -description: |- - Example description. ---- - -# Example Provider - -Example contents. diff --git a/internal/provider/testdata/invalid-legacy-files/index_with_subcategory.html.markdown b/internal/provider/testdata/invalid-legacy-files/index_with_subcategory.html.markdown deleted file mode 100644 index 9766b6df..00000000 --- a/internal/provider/testdata/invalid-legacy-files/index_with_subcategory.html.markdown +++ /dev/null @@ -1,10 +0,0 @@ ---- -subcategory: "Example" -page_title: "Example Provider" -description: |- - Example description. ---- - -# Example Provider - -Example contents. diff --git a/internal/provider/testdata/invalid-legacy-files/index_without_layout.html.markdown b/internal/provider/testdata/invalid-legacy-files/index_without_layout.html.markdown deleted file mode 100644 index 9daab155..00000000 --- a/internal/provider/testdata/invalid-legacy-files/index_without_layout.html.markdown +++ /dev/null @@ -1,9 +0,0 @@ ---- -page_title: "Example Provider" -description: |- - Example description. ---- - -# Example Provider - -Example contents. diff --git a/internal/provider/testdata/invalid-legacy-files/resource_invalid_extension.txt b/internal/provider/testdata/invalid-legacy-files/resource_invalid_extension.txt deleted file mode 100644 index 59bb04cc..00000000 --- a/internal/provider/testdata/invalid-legacy-files/resource_invalid_extension.txt +++ /dev/null @@ -1,27 +0,0 @@ ---- -subcategory: "Example" -layout: "example" -page_title: "Example: example_thing" -description: |- - Example description. ---- - -# Resource: example_thing - -Byline. - -## Example Usage - -```terraform -resource "example_thing" "example" { - name = "example" -} -``` - -## Argument Reference - -* `name` - (Required) Name of thing. - -## Attribute Reference - -* `id` - Name of thing. diff --git a/internal/provider/testdata/invalid-legacy-files/resource_invalid_frontmatter.html.markdown b/internal/provider/testdata/invalid-legacy-files/resource_invalid_frontmatter.html.markdown deleted file mode 100644 index 0cd796a3..00000000 --- a/internal/provider/testdata/invalid-legacy-files/resource_invalid_frontmatter.html.markdown +++ /dev/null @@ -1,27 +0,0 @@ ---- -subcategory: "Example" -layout: "example" -page_title: "Example: example_thing" -description: |- -Missing indentation. ---- - -# Resource: example_thing - -Byline. - -## Example Usage - -```terraform -resource "example_thing" "example" { - name = "example" -} -``` - -## Argument Reference - -* `name` - (Required) Name of thing. - -## Attribute Reference - -* `id` - Name of thing. diff --git a/internal/provider/testdata/invalid-legacy-files/resource_with_sidebar_current.html.markdown b/internal/provider/testdata/invalid-legacy-files/resource_with_sidebar_current.html.markdown deleted file mode 100644 index 32ec4684..00000000 --- a/internal/provider/testdata/invalid-legacy-files/resource_with_sidebar_current.html.markdown +++ /dev/null @@ -1,28 +0,0 @@ ---- -subcategory: "Example" -sidebar_current: "example_thing" -layout: "example" -page_title: "Example: example_thing" -description: |- - Example description. ---- - -# Resource: example_thing - -Byline. - -## Example Usage - -```terraform -resource "example_thing" "example" { - name = "example" -} -``` - -## Argument Reference - -* `name` - (Required) Name of thing. - -## Attribute Reference - -* `id` - Name of thing. diff --git a/internal/provider/testdata/invalid-legacy-files/resource_without_layout.html.markdown b/internal/provider/testdata/invalid-legacy-files/resource_without_layout.html.markdown deleted file mode 100644 index aa156f35..00000000 --- a/internal/provider/testdata/invalid-legacy-files/resource_without_layout.html.markdown +++ /dev/null @@ -1,26 +0,0 @@ ---- -subcategory: "Example" -page_title: "Example: example_thing" -description: |- - Example description. ---- - -# Resource: example_thing - -Byline. - -## Example Usage - -```terraform -resource "example_thing" "example" { - name = "example" -} -``` - -## Argument Reference - -* `name` - (Required) Name of thing. - -## Attribute Reference - -* `id` - Name of thing. diff --git a/internal/provider/testdata/invalid-registry-directories/docs/resources/invalid/thing.md b/internal/provider/testdata/invalid-registry-directories/docs/resources/invalid/thing.md deleted file mode 100644 index aa156f35..00000000 --- a/internal/provider/testdata/invalid-registry-directories/docs/resources/invalid/thing.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -subcategory: "Example" -page_title: "Example: example_thing" -description: |- - Example description. ---- - -# Resource: example_thing - -Byline. - -## Example Usage - -```terraform -resource "example_thing" "example" { - name = "example" -} -``` - -## Argument Reference - -* `name` - (Required) Name of thing. - -## Attribute Reference - -* `id` - Name of thing. diff --git a/internal/provider/testdata/invalid-registry-files/data_source_invalid_extension.markdown b/internal/provider/testdata/invalid-registry-files/data_source_invalid_extension.markdown deleted file mode 100644 index 688fa598..00000000 --- a/internal/provider/testdata/invalid-registry-files/data_source_invalid_extension.markdown +++ /dev/null @@ -1,26 +0,0 @@ ---- -subcategory: "Example" -page_title: "Example: example_thing" -description: |- - Example description. ---- - -# Data Source: example_thing - -Byline. - -## Example Usage - -```terraform -data "example_thing" "example" { - name = "example" -} -``` - -## Argument Reference - -* `name` - (Required) Name of thing. - -## Attribute Reference - -* `id` - Name of thing. diff --git a/internal/provider/testdata/invalid-registry-files/data_source_invalid_frontmatter.md b/internal/provider/testdata/invalid-registry-files/data_source_invalid_frontmatter.md deleted file mode 100644 index 224dcf7e..00000000 --- a/internal/provider/testdata/invalid-registry-files/data_source_invalid_frontmatter.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -subcategory: "Example" -page_title: "Example: example_thing" -description: |- -Missing indentation. ---- - -# Data Source: example_thing - -Byline. - -## Example Usage - -```terraform -data "example_thing" "example" { - name = "example" -} -``` - -## Argument Reference - -* `name` - (Required) Name of thing. - -## Attribute Reference - -* `id` - Name of thing. diff --git a/internal/provider/testdata/invalid-registry-files/data_source_with_layout.md b/internal/provider/testdata/invalid-registry-files/data_source_with_layout.md deleted file mode 100644 index caee79a4..00000000 --- a/internal/provider/testdata/invalid-registry-files/data_source_with_layout.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -subcategory: "Example" -layout: "example" -page_title: "Example: example_thing" -description: |- - Example description. ---- - -# Data Source: example_thing - -Byline. - -## Example Usage - -```terraform -data "example_thing" "example" { - name = "example" -} -``` - -## Argument Reference - -* `name` - (Required) Name of thing. - -## Attribute Reference - -* `id` - Name of thing. diff --git a/internal/provider/testdata/invalid-registry-files/data_source_with_sidebar_current.md b/internal/provider/testdata/invalid-registry-files/data_source_with_sidebar_current.md deleted file mode 100644 index afc1af9e..00000000 --- a/internal/provider/testdata/invalid-registry-files/data_source_with_sidebar_current.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -subcategory: "Example" -sidebar_current: "example_thing" -page_title: "Example: example_thing" -description: |- - Example description. ---- - -# Data Source: example_thing - -Byline. - -## Example Usage - -```terraform -data "example_thing" "example" { - name = "example" -} -``` - -## Argument Reference - -* `name` - (Required) Name of thing. - -## Attribute Reference - -* `id` - Name of thing. diff --git a/internal/provider/testdata/invalid-registry-files/guide_invalid_extension.markdown b/internal/provider/testdata/invalid-registry-files/guide_invalid_extension.markdown deleted file mode 100644 index 9acc401d..00000000 --- a/internal/provider/testdata/invalid-registry-files/guide_invalid_extension.markdown +++ /dev/null @@ -1,10 +0,0 @@ ---- -subcategory: "Example" -page_title: "Example: example_thing" -description: |- - Example description. ---- - -# Example Guide - -Example contents. diff --git a/internal/provider/testdata/invalid-registry-files/guide_invalid_frontmatter.md b/internal/provider/testdata/invalid-registry-files/guide_invalid_frontmatter.md deleted file mode 100644 index 1dbe9583..00000000 --- a/internal/provider/testdata/invalid-registry-files/guide_invalid_frontmatter.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -subcategory: "Example" -page_title: "Example: example_thing" -description: |- -Missing indentation. ---- - -# Example Guide - -Example contents. diff --git a/internal/provider/testdata/invalid-registry-files/guide_with_layout.md b/internal/provider/testdata/invalid-registry-files/guide_with_layout.md deleted file mode 100644 index ff7efb92..00000000 --- a/internal/provider/testdata/invalid-registry-files/guide_with_layout.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -subcategory: "Example" -layout: "example" -page_title: "Example: example_thing" -description: |- - Example description. ---- - -# Example Guide - -Example contents. diff --git a/internal/provider/testdata/invalid-registry-files/guide_with_sidebar_current.md b/internal/provider/testdata/invalid-registry-files/guide_with_sidebar_current.md deleted file mode 100644 index 1954289d..00000000 --- a/internal/provider/testdata/invalid-registry-files/guide_with_sidebar_current.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -subcategory: "Example" -sidebar_current: "example" -page_title: "Example: example_thing" -description: |- - Example description. ---- - -# Example Guide - -Example contents. diff --git a/internal/provider/testdata/invalid-registry-files/index_invalid_extension.markdown b/internal/provider/testdata/invalid-registry-files/index_invalid_extension.markdown deleted file mode 100644 index 9daab155..00000000 --- a/internal/provider/testdata/invalid-registry-files/index_invalid_extension.markdown +++ /dev/null @@ -1,9 +0,0 @@ ---- -page_title: "Example Provider" -description: |- - Example description. ---- - -# Example Provider - -Example contents. diff --git a/internal/provider/testdata/invalid-registry-files/index_invalid_frontmatter.md b/internal/provider/testdata/invalid-registry-files/index_invalid_frontmatter.md deleted file mode 100644 index f19cf719..00000000 --- a/internal/provider/testdata/invalid-registry-files/index_invalid_frontmatter.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -page_title: "Example Provider" -description: |- -Missing indentation. ---- - -# Example Provider - -Example contents. diff --git a/internal/provider/testdata/invalid-registry-files/index_with_layout.md b/internal/provider/testdata/invalid-registry-files/index_with_layout.md deleted file mode 100644 index c4ab1478..00000000 --- a/internal/provider/testdata/invalid-registry-files/index_with_layout.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -layout: "example" -page_title: "Example Provider" -description: |- - Example description. ---- - -# Example Provider - -Example contents. diff --git a/internal/provider/testdata/invalid-registry-files/index_with_sidebar_current.md b/internal/provider/testdata/invalid-registry-files/index_with_sidebar_current.md deleted file mode 100644 index cd0a42c5..00000000 --- a/internal/provider/testdata/invalid-registry-files/index_with_sidebar_current.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -sidebar_current: "example" -page_title: "Example Provider" -description: |- - Example description. ---- - -# Example Provider - -Example contents. diff --git a/internal/provider/testdata/invalid-registry-files/index_with_subcategory.md b/internal/provider/testdata/invalid-registry-files/index_with_subcategory.md deleted file mode 100644 index eb4751c9..00000000 --- a/internal/provider/testdata/invalid-registry-files/index_with_subcategory.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -subcategory: "example" -page_title: "Example Provider" -description: |- - Example description. ---- - -# Example Provider - -Example contents. diff --git a/internal/provider/testdata/invalid-registry-files/resource_invalid_extension.markdown b/internal/provider/testdata/invalid-registry-files/resource_invalid_extension.markdown deleted file mode 100644 index aa156f35..00000000 --- a/internal/provider/testdata/invalid-registry-files/resource_invalid_extension.markdown +++ /dev/null @@ -1,26 +0,0 @@ ---- -subcategory: "Example" -page_title: "Example: example_thing" -description: |- - Example description. ---- - -# Resource: example_thing - -Byline. - -## Example Usage - -```terraform -resource "example_thing" "example" { - name = "example" -} -``` - -## Argument Reference - -* `name` - (Required) Name of thing. - -## Attribute Reference - -* `id` - Name of thing. diff --git a/internal/provider/testdata/invalid-registry-files/resource_invalid_frontmatter.md b/internal/provider/testdata/invalid-registry-files/resource_invalid_frontmatter.md deleted file mode 100644 index 39a2823b..00000000 --- a/internal/provider/testdata/invalid-registry-files/resource_invalid_frontmatter.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -subcategory: "Example" -page_title: "Example: example_thing" -description: |- -Missing indentation. ---- - -# Resource: example_thing - -Byline. - -## Example Usage - -```terraform -resource "example_thing" "example" { - name = "example" -} -``` - -## Argument Reference - -* `name` - (Required) Name of thing. - -## Attribute Reference - -* `id` - Name of thing. diff --git a/internal/provider/testdata/invalid-registry-files/resource_with_layout.md b/internal/provider/testdata/invalid-registry-files/resource_with_layout.md deleted file mode 100644 index 59bb04cc..00000000 --- a/internal/provider/testdata/invalid-registry-files/resource_with_layout.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -subcategory: "Example" -layout: "example" -page_title: "Example: example_thing" -description: |- - Example description. ---- - -# Resource: example_thing - -Byline. - -## Example Usage - -```terraform -resource "example_thing" "example" { - name = "example" -} -``` - -## Argument Reference - -* `name` - (Required) Name of thing. - -## Attribute Reference - -* `id` - Name of thing. diff --git a/internal/provider/testdata/invalid-registry-files/resource_with_sidebar_current.md b/internal/provider/testdata/invalid-registry-files/resource_with_sidebar_current.md deleted file mode 100644 index 91e6dcbb..00000000 --- a/internal/provider/testdata/invalid-registry-files/resource_with_sidebar_current.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -subcategory: "Example" -sidebar_current: "example_thing" -page_title: "Example: example_thing" -description: |- - Example description. ---- - -# Resource: example_thing - -Byline. - -## Example Usage - -```terraform -resource "example_thing" "example" { - name = "example" -} -``` - -## Argument Reference - -* `name` - (Required) Name of thing. - -## Attribute Reference - -* `id` - Name of thing. diff --git a/internal/provider/testdata/valid-legacy-directories-with-cdktf/website/docs/cdktf/typescript/d/thing.html.markdown b/internal/provider/testdata/valid-legacy-directories-with-cdktf/website/docs/cdktf/typescript/d/thing.html.markdown deleted file mode 100644 index 32e9de67..00000000 --- a/internal/provider/testdata/valid-legacy-directories-with-cdktf/website/docs/cdktf/typescript/d/thing.html.markdown +++ /dev/null @@ -1,37 +0,0 @@ ---- -subcategory: "Example" -layout: "example" -page_title: "Example: example_thing" -description: |- - Example description. ---- - -# Data Source: example_thing - -Byline. - -## Example Usage - -```ts -import { Construct } from "construct"; -import { TerraformStack } from "cdktf"; -import { DataExample } from "./.gen/providers/example/data_example_thing"; - -class MyStack extends TerraformStack { - constructs(scope: Construct, name: string) { - super(scope, name); - - new DataExampleThing(this, "example", { - name: "example", - }); - } -} -``` - -## Argument Reference - -- `name` - (Required) Name of thing. - -## Attribute Reference - -- `id` - Name of thing. diff --git a/internal/provider/testdata/valid-legacy-directories-with-cdktf/website/docs/cdktf/typescript/r/thing.html.markdown b/internal/provider/testdata/valid-legacy-directories-with-cdktf/website/docs/cdktf/typescript/r/thing.html.markdown deleted file mode 100644 index 962ae86b..00000000 --- a/internal/provider/testdata/valid-legacy-directories-with-cdktf/website/docs/cdktf/typescript/r/thing.html.markdown +++ /dev/null @@ -1,37 +0,0 @@ ---- -subcategory: "Example" -layout: "example" -page_title: "Example: example_thing" -description: |- - Example description. ---- - -# Resource: example_thing - -Byline. - -## Example Usage - -```ts -import { Construct } from "construct"; -import { TerraformStack } from "cdktf"; -import { Thing } from "./.gen/providers/example/thing"; - -class MyStack extends TerraformStack { - constructs(scope: Construct, name: string) { - super(scope, name); - - new Thing(this, "example", { - name: "example", - }); - } -} -``` - -## Argument Reference - -- `name` - (Required) Name of thing. - -## Attribute Reference - -- `id` - Name of thing. diff --git a/internal/provider/testdata/valid-legacy-directories-with-cdktf/website/docs/d/thing.html.markdown b/internal/provider/testdata/valid-legacy-directories-with-cdktf/website/docs/d/thing.html.markdown deleted file mode 100644 index caee79a4..00000000 --- a/internal/provider/testdata/valid-legacy-directories-with-cdktf/website/docs/d/thing.html.markdown +++ /dev/null @@ -1,27 +0,0 @@ ---- -subcategory: "Example" -layout: "example" -page_title: "Example: example_thing" -description: |- - Example description. ---- - -# Data Source: example_thing - -Byline. - -## Example Usage - -```terraform -data "example_thing" "example" { - name = "example" -} -``` - -## Argument Reference - -* `name` - (Required) Name of thing. - -## Attribute Reference - -* `id` - Name of thing. diff --git a/internal/provider/testdata/valid-legacy-directories-with-cdktf/website/docs/r/thing.html.markdown b/internal/provider/testdata/valid-legacy-directories-with-cdktf/website/docs/r/thing.html.markdown deleted file mode 100644 index 59bb04cc..00000000 --- a/internal/provider/testdata/valid-legacy-directories-with-cdktf/website/docs/r/thing.html.markdown +++ /dev/null @@ -1,27 +0,0 @@ ---- -subcategory: "Example" -layout: "example" -page_title: "Example: example_thing" -description: |- - Example description. ---- - -# Resource: example_thing - -Byline. - -## Example Usage - -```terraform -resource "example_thing" "example" { - name = "example" -} -``` - -## Argument Reference - -* `name` - (Required) Name of thing. - -## Attribute Reference - -* `id` - Name of thing. diff --git a/internal/provider/testdata/valid-legacy-directories/website/docs/d/thing.html.markdown b/internal/provider/testdata/valid-legacy-directories/website/docs/d/thing.html.markdown deleted file mode 100644 index caee79a4..00000000 --- a/internal/provider/testdata/valid-legacy-directories/website/docs/d/thing.html.markdown +++ /dev/null @@ -1,27 +0,0 @@ ---- -subcategory: "Example" -layout: "example" -page_title: "Example: example_thing" -description: |- - Example description. ---- - -# Data Source: example_thing - -Byline. - -## Example Usage - -```terraform -data "example_thing" "example" { - name = "example" -} -``` - -## Argument Reference - -* `name` - (Required) Name of thing. - -## Attribute Reference - -* `id` - Name of thing. diff --git a/internal/provider/testdata/valid-legacy-directories/website/docs/r/thing.html.markdown b/internal/provider/testdata/valid-legacy-directories/website/docs/r/thing.html.markdown deleted file mode 100644 index 59bb04cc..00000000 --- a/internal/provider/testdata/valid-legacy-directories/website/docs/r/thing.html.markdown +++ /dev/null @@ -1,27 +0,0 @@ ---- -subcategory: "Example" -layout: "example" -page_title: "Example: example_thing" -description: |- - Example description. ---- - -# Resource: example_thing - -Byline. - -## Example Usage - -```terraform -resource "example_thing" "example" { - name = "example" -} -``` - -## Argument Reference - -* `name` - (Required) Name of thing. - -## Attribute Reference - -* `id` - Name of thing. diff --git a/internal/provider/testdata/valid-legacy-files/2.0-guide.html.markdown b/internal/provider/testdata/valid-legacy-files/2.0-guide.html.markdown deleted file mode 100644 index b02bcc8e..00000000 --- a/internal/provider/testdata/valid-legacy-files/2.0-guide.html.markdown +++ /dev/null @@ -1,11 +0,0 @@ ---- -subcategory: "Example" -layout: "example" -page_title: "Example Guide" -description: |- - Example description. ---- - -# Example Guide - -Example contents. diff --git a/internal/provider/testdata/valid-legacy-files/data_source.html.markdown b/internal/provider/testdata/valid-legacy-files/data_source.html.markdown deleted file mode 100644 index caee79a4..00000000 --- a/internal/provider/testdata/valid-legacy-files/data_source.html.markdown +++ /dev/null @@ -1,27 +0,0 @@ ---- -subcategory: "Example" -layout: "example" -page_title: "Example: example_thing" -description: |- - Example description. ---- - -# Data Source: example_thing - -Byline. - -## Example Usage - -```terraform -data "example_thing" "example" { - name = "example" -} -``` - -## Argument Reference - -* `name` - (Required) Name of thing. - -## Attribute Reference - -* `id` - Name of thing. diff --git a/internal/provider/testdata/valid-legacy-files/guide.html.markdown b/internal/provider/testdata/valid-legacy-files/guide.html.markdown deleted file mode 100644 index b02bcc8e..00000000 --- a/internal/provider/testdata/valid-legacy-files/guide.html.markdown +++ /dev/null @@ -1,11 +0,0 @@ ---- -subcategory: "Example" -layout: "example" -page_title: "Example Guide" -description: |- - Example description. ---- - -# Example Guide - -Example contents. diff --git a/internal/provider/testdata/valid-legacy-files/index.html.markdown b/internal/provider/testdata/valid-legacy-files/index.html.markdown deleted file mode 100644 index c4ab1478..00000000 --- a/internal/provider/testdata/valid-legacy-files/index.html.markdown +++ /dev/null @@ -1,10 +0,0 @@ ---- -layout: "example" -page_title: "Example Provider" -description: |- - Example description. ---- - -# Example Provider - -Example contents. diff --git a/internal/provider/testdata/valid-legacy-files/resource.html.markdown b/internal/provider/testdata/valid-legacy-files/resource.html.markdown deleted file mode 100644 index 59bb04cc..00000000 --- a/internal/provider/testdata/valid-legacy-files/resource.html.markdown +++ /dev/null @@ -1,27 +0,0 @@ ---- -subcategory: "Example" -layout: "example" -page_title: "Example: example_thing" -description: |- - Example description. ---- - -# Resource: example_thing - -Byline. - -## Example Usage - -```terraform -resource "example_thing" "example" { - name = "example" -} -``` - -## Argument Reference - -* `name` - (Required) Name of thing. - -## Attribute Reference - -* `id` - Name of thing. diff --git a/internal/provider/testdata/valid-registry-directories-with-cdktf/docs/CONTRIBUTING.md b/internal/provider/testdata/valid-registry-directories-with-cdktf/docs/CONTRIBUTING.md deleted file mode 100644 index 423305c4..00000000 --- a/internal/provider/testdata/valid-registry-directories-with-cdktf/docs/CONTRIBUTING.md +++ /dev/null @@ -1,3 +0,0 @@ -# Contributing Guide - -This file has contents and no YAML frontmatter, because it is not a Terraform Provider documentation file and that is okay. diff --git a/internal/provider/testdata/valid-registry-directories-with-cdktf/docs/cdktf/typescript/CONTRIBUTING.md b/internal/provider/testdata/valid-registry-directories-with-cdktf/docs/cdktf/typescript/CONTRIBUTING.md deleted file mode 100644 index 423305c4..00000000 --- a/internal/provider/testdata/valid-registry-directories-with-cdktf/docs/cdktf/typescript/CONTRIBUTING.md +++ /dev/null @@ -1,3 +0,0 @@ -# Contributing Guide - -This file has contents and no YAML frontmatter, because it is not a Terraform Provider documentation file and that is okay. diff --git a/internal/provider/testdata/valid-registry-directories-with-cdktf/docs/cdktf/typescript/data-sources/thing.md b/internal/provider/testdata/valid-registry-directories-with-cdktf/docs/cdktf/typescript/data-sources/thing.md deleted file mode 100644 index 5c415dba..00000000 --- a/internal/provider/testdata/valid-registry-directories-with-cdktf/docs/cdktf/typescript/data-sources/thing.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -subcategory: "Example" -page_title: "Example: example_thing" -description: |- - Example description. ---- - -# Data Source: example_thing - -Byline. - -## Example Usage - -```ts -import { Construct } from "construct"; -import { TerraformStack } from "cdktf"; -import { DataExample } from "./.gen/providers/example/data_example_thing"; - -class MyStack extends TerraformStack { - constructs(scope: Construct, name: string) { - super(scope, name); - - new DataExampleThing(this, "example", { - name: "example", - }); - } -} -``` - -## Argument Reference - -- `name` - (Required) Name of thing. - -## Attribute Reference - -- `id` - Name of thing. diff --git a/internal/provider/testdata/valid-registry-directories-with-cdktf/docs/cdktf/typescript/index.md b/internal/provider/testdata/valid-registry-directories-with-cdktf/docs/cdktf/typescript/index.md deleted file mode 100644 index 9daab155..00000000 --- a/internal/provider/testdata/valid-registry-directories-with-cdktf/docs/cdktf/typescript/index.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -page_title: "Example Provider" -description: |- - Example description. ---- - -# Example Provider - -Example contents. diff --git a/internal/provider/testdata/valid-registry-directories-with-cdktf/docs/cdktf/typescript/nonregistrydocs/valid.md b/internal/provider/testdata/valid-registry-directories-with-cdktf/docs/cdktf/typescript/nonregistrydocs/valid.md deleted file mode 100644 index a7f1fce5..00000000 --- a/internal/provider/testdata/valid-registry-directories-with-cdktf/docs/cdktf/typescript/nonregistrydocs/valid.md +++ /dev/null @@ -1,3 +0,0 @@ -# Valid - -Files in `/docs`, but outside Registry documentation directories, should be ignored. diff --git a/internal/provider/testdata/valid-registry-directories-with-cdktf/docs/cdktf/typescript/resources/thing.md b/internal/provider/testdata/valid-registry-directories-with-cdktf/docs/cdktf/typescript/resources/thing.md deleted file mode 100644 index 1f46f48b..00000000 --- a/internal/provider/testdata/valid-registry-directories-with-cdktf/docs/cdktf/typescript/resources/thing.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -subcategory: "Example" -page_title: "Example: example_thing" -description: |- - Example description. ---- - -# Resource: example_thing - -Byline. - -## Example Usage - -```ts -import { Construct } from "construct"; -import { TerraformStack } from "cdktf"; -import { Thing } from "./.gen/providers/example/thing"; - -class MyStack extends TerraformStack { - constructs(scope: Construct, name: string) { - super(scope, name); - - new Thing(this, "example", { - name: "example", - }); - } -} -``` - -## Argument Reference - -- `name` - (Required) Name of thing. - -## Attribute Reference - -- `id` - Name of thing. diff --git a/internal/provider/testdata/valid-registry-directories-with-cdktf/docs/data-sources/thing.md b/internal/provider/testdata/valid-registry-directories-with-cdktf/docs/data-sources/thing.md deleted file mode 100644 index 688fa598..00000000 --- a/internal/provider/testdata/valid-registry-directories-with-cdktf/docs/data-sources/thing.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -subcategory: "Example" -page_title: "Example: example_thing" -description: |- - Example description. ---- - -# Data Source: example_thing - -Byline. - -## Example Usage - -```terraform -data "example_thing" "example" { - name = "example" -} -``` - -## Argument Reference - -* `name` - (Required) Name of thing. - -## Attribute Reference - -* `id` - Name of thing. diff --git a/internal/provider/testdata/valid-registry-directories-with-cdktf/docs/index.md b/internal/provider/testdata/valid-registry-directories-with-cdktf/docs/index.md deleted file mode 100644 index 9daab155..00000000 --- a/internal/provider/testdata/valid-registry-directories-with-cdktf/docs/index.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -page_title: "Example Provider" -description: |- - Example description. ---- - -# Example Provider - -Example contents. diff --git a/internal/provider/testdata/valid-registry-directories-with-cdktf/docs/nonregistrydocs/valid.md b/internal/provider/testdata/valid-registry-directories-with-cdktf/docs/nonregistrydocs/valid.md deleted file mode 100644 index a7f1fce5..00000000 --- a/internal/provider/testdata/valid-registry-directories-with-cdktf/docs/nonregistrydocs/valid.md +++ /dev/null @@ -1,3 +0,0 @@ -# Valid - -Files in `/docs`, but outside Registry documentation directories, should be ignored. diff --git a/internal/provider/testdata/valid-registry-directories-with-cdktf/docs/resources/thing.md b/internal/provider/testdata/valid-registry-directories-with-cdktf/docs/resources/thing.md deleted file mode 100644 index aa156f35..00000000 --- a/internal/provider/testdata/valid-registry-directories-with-cdktf/docs/resources/thing.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -subcategory: "Example" -page_title: "Example: example_thing" -description: |- - Example description. ---- - -# Resource: example_thing - -Byline. - -## Example Usage - -```terraform -resource "example_thing" "example" { - name = "example" -} -``` - -## Argument Reference - -* `name` - (Required) Name of thing. - -## Attribute Reference - -* `id` - Name of thing. diff --git a/internal/provider/testdata/valid-registry-directories/docs/CONTRIBUTING.md b/internal/provider/testdata/valid-registry-directories/docs/CONTRIBUTING.md deleted file mode 100644 index 423305c4..00000000 --- a/internal/provider/testdata/valid-registry-directories/docs/CONTRIBUTING.md +++ /dev/null @@ -1,3 +0,0 @@ -# Contributing Guide - -This file has contents and no YAML frontmatter, because it is not a Terraform Provider documentation file and that is okay. diff --git a/internal/provider/testdata/valid-registry-directories/docs/data-sources/thing.md b/internal/provider/testdata/valid-registry-directories/docs/data-sources/thing.md deleted file mode 100644 index 688fa598..00000000 --- a/internal/provider/testdata/valid-registry-directories/docs/data-sources/thing.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -subcategory: "Example" -page_title: "Example: example_thing" -description: |- - Example description. ---- - -# Data Source: example_thing - -Byline. - -## Example Usage - -```terraform -data "example_thing" "example" { - name = "example" -} -``` - -## Argument Reference - -* `name` - (Required) Name of thing. - -## Attribute Reference - -* `id` - Name of thing. diff --git a/internal/provider/testdata/valid-registry-directories/docs/index.md b/internal/provider/testdata/valid-registry-directories/docs/index.md deleted file mode 100644 index 9daab155..00000000 --- a/internal/provider/testdata/valid-registry-directories/docs/index.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -page_title: "Example Provider" -description: |- - Example description. ---- - -# Example Provider - -Example contents. diff --git a/internal/provider/testdata/valid-registry-directories/docs/nonregistrydocs/valid.md b/internal/provider/testdata/valid-registry-directories/docs/nonregistrydocs/valid.md deleted file mode 100644 index a7f1fce5..00000000 --- a/internal/provider/testdata/valid-registry-directories/docs/nonregistrydocs/valid.md +++ /dev/null @@ -1,3 +0,0 @@ -# Valid - -Files in `/docs`, but outside Registry documentation directories, should be ignored. diff --git a/internal/provider/testdata/valid-registry-directories/docs/resources/thing.md b/internal/provider/testdata/valid-registry-directories/docs/resources/thing.md deleted file mode 100644 index aa156f35..00000000 --- a/internal/provider/testdata/valid-registry-directories/docs/resources/thing.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -subcategory: "Example" -page_title: "Example: example_thing" -description: |- - Example description. ---- - -# Resource: example_thing - -Byline. - -## Example Usage - -```terraform -resource "example_thing" "example" { - name = "example" -} -``` - -## Argument Reference - -* `name` - (Required) Name of thing. - -## Attribute Reference - -* `id` - Name of thing. diff --git a/internal/provider/testdata/valid-registry-files/2.0-guide.md b/internal/provider/testdata/valid-registry-files/2.0-guide.md deleted file mode 100644 index 9acc401d..00000000 --- a/internal/provider/testdata/valid-registry-files/2.0-guide.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -subcategory: "Example" -page_title: "Example: example_thing" -description: |- - Example description. ---- - -# Example Guide - -Example contents. diff --git a/internal/provider/testdata/valid-registry-files/data_source.md b/internal/provider/testdata/valid-registry-files/data_source.md deleted file mode 100644 index 688fa598..00000000 --- a/internal/provider/testdata/valid-registry-files/data_source.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -subcategory: "Example" -page_title: "Example: example_thing" -description: |- - Example description. ---- - -# Data Source: example_thing - -Byline. - -## Example Usage - -```terraform -data "example_thing" "example" { - name = "example" -} -``` - -## Argument Reference - -* `name` - (Required) Name of thing. - -## Attribute Reference - -* `id` - Name of thing. diff --git a/internal/provider/testdata/valid-registry-files/guide.md b/internal/provider/testdata/valid-registry-files/guide.md deleted file mode 100644 index 9acc401d..00000000 --- a/internal/provider/testdata/valid-registry-files/guide.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -subcategory: "Example" -page_title: "Example: example_thing" -description: |- - Example description. ---- - -# Example Guide - -Example contents. diff --git a/internal/provider/testdata/valid-registry-files/index.md b/internal/provider/testdata/valid-registry-files/index.md deleted file mode 100644 index 9daab155..00000000 --- a/internal/provider/testdata/valid-registry-files/index.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -page_title: "Example Provider" -description: |- - Example description. ---- - -# Example Provider - -Example contents. diff --git a/internal/provider/testdata/valid-registry-files/resource.md b/internal/provider/testdata/valid-registry-files/resource.md deleted file mode 100644 index aa156f35..00000000 --- a/internal/provider/testdata/valid-registry-files/resource.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -subcategory: "Example" -page_title: "Example: example_thing" -description: |- - Example description. ---- - -# Resource: example_thing - -Byline. - -## Example Usage - -```terraform -resource "example_thing" "example" { - name = "example" -} -``` - -## Argument Reference - -* `name` - (Required) Name of thing. - -## Attribute Reference - -* `id` - Name of thing. diff --git a/internal/provider/validate.go b/internal/provider/validate.go index a72be373..f7751a0b 100644 --- a/internal/provider/validate.go +++ b/internal/provider/validate.go @@ -7,6 +7,7 @@ import ( "context" "errors" "fmt" + "io/fs" "log" "os" "path/filepath" @@ -24,7 +25,7 @@ const ( FileExtensionMarkdown = `.markdown` FileExtensionMd = `.md` - DocumentationGlobPattern = `{docs/index.md,docs/{,cdktf/}{data-sources,guides,resources,functions}/**/*,website/docs/**/*}` + DocumentationGlobPattern = `{docs/index.*,docs/{,cdktf/}{data-sources,guides,resources,functions}/**/*,website/docs/**/*}` DocumentationDirGlobPattern = `{docs/{,cdktf/}{data-sources,guides,resources,functions}{,/*},website/docs/**/*}` ) @@ -54,13 +55,6 @@ var LegacyIndexFrontMatterOptions = &check.FrontMatterOptions{ RequirePageTitle: true, } -var LegacyGuideFrontMatterOptions = &check.FrontMatterOptions{ - NoSidebarCurrent: true, - RequireDescription: true, - RequireLayout: true, - RequirePageTitle: true, -} - var RegistryFrontMatterOptions = &check.FrontMatterOptions{ NoLayout: true, NoSidebarCurrent: true, @@ -81,6 +75,7 @@ var RegistryGuideFrontMatterOptions = &check.FrontMatterOptions{ type validator struct { providerName string providerDir string + providerFS fs.FS providersSchemaPath string tfVersion string @@ -120,9 +115,12 @@ func Validate(ui cli.Ui, providerDir, providerName, providersSchemaPath, tfversi return fmt.Errorf("expected %q to be a directory", providerDir) } + providerFs := os.DirFS(providerDir) + v := &validator{ providerName: providerName, providerDir: providerDir, + providerFS: providerFs, providersSchemaPath: providersSchemaPath, tfVersion: tfversion, @@ -157,9 +155,7 @@ func (v *validator) validate(ctx context.Context) error { } } - providerFs := os.DirFS(v.providerDir) - - files, globErr := doublestar.Glob(providerFs, DocumentationGlobPattern) + files, globErr := doublestar.Glob(v.providerFS, DocumentationGlobPattern) if globErr != nil { return fmt.Errorf("error finding documentation files: %w", err) } @@ -170,43 +166,39 @@ func (v *validator) validate(ctx context.Context) error { err = check.MixedDirectoriesCheck(files) result = errors.Join(result, err) - if dirExists(filepath.Join(v.providerDir, "docs")) { + if dirExists(v.providerFS, "docs") { v.logger.infof("detected static docs directory, running checks") - err = v.validateStaticDocs(filepath.Join(v.providerDir, "docs")) + err = v.validateStaticDocs() result = errors.Join(result, err) } - if dirExists(filepath.Join(v.providerDir, filepath.Join("website", "docs"))) { + if dirExists(v.providerFS, "website/docs") { v.logger.infof("detected legacy website directory, running checks") - err = v.validateLegacyWebsite(filepath.Join(v.providerDir, "website/docs")) + err = v.validateLegacyWebsite() result = errors.Join(result, err) } return result } -func (v *validator) validateStaticDocs(dir string) error { - +func (v *validator) validateStaticDocs() error { + dir := "docs" var result error options := &check.ProviderFileOptions{ + FileOptions: &check.FileOptions{BasePath: v.providerDir}, FrontMatter: RegistryFrontMatterOptions, ValidExtensions: ValidRegistryFileExtensions, } var files []string - err := filepath.WalkDir(dir, func(path string, d os.DirEntry, err error) error { + err := fs.WalkDir(v.providerFS, dir, func(path string, d fs.DirEntry, err error) error { if err != nil { return fmt.Errorf("error walking directory %q: %w", dir, err) } - - rel, err := filepath.Rel(v.providerDir, path) - if err != nil { - return err - } if d.IsDir() { - match, err := doublestar.PathMatch(filepath.FromSlash(DocumentationDirGlobPattern), rel) + match, err := doublestar.Match(DocumentationDirGlobPattern, path) if err != nil { return err } @@ -214,11 +206,11 @@ func (v *validator) validateStaticDocs(dir string) error { return nil // skip valid non-documentation directories } - v.logger.infof("running invalid directories check on %s", rel) - result = errors.Join(result, check.InvalidDirectoriesCheck(rel)) + v.logger.infof("running invalid directories check on %s", path) + result = errors.Join(result, check.InvalidDirectoriesCheck(path)) return nil } - match, err := doublestar.PathMatch(filepath.FromSlash(DocumentationGlobPattern), rel) + match, err := doublestar.Match(DocumentationGlobPattern, path) if err != nil { return err } @@ -227,15 +219,15 @@ func (v *validator) validateStaticDocs(dir string) error { } // Configure FrontMatterOptions based on file type - if d.Name() == "index.md" { + if removeAllExt(d.Name()) == "index" { options.FrontMatter = RegistryIndexFrontMatterOptions - } else if _, relErr := filepath.Rel(rel, "guides"); relErr != nil { + } else if _, relErr := filepath.Rel(dir+"/guides", path); relErr == nil { options.FrontMatter = RegistryGuideFrontMatterOptions } else { options.FrontMatter = RegistryFrontMatterOptions } - v.logger.infof("running file checks on %s", rel) - result = errors.Join(result, check.NewProviderFileCheck(options).Run(path)) + v.logger.infof("running file checks on %s", path) + result = errors.Join(result, check.NewProviderFileCheck(v.providerFS, options).Run(path)) files = append(files, path) return nil @@ -249,16 +241,16 @@ func (v *validator) validateStaticDocs(dir string) error { Schema: v.providerSchema, } - if dirExists(filepath.Join(dir, "data-sources")) { - dataSourceFiles, _ := os.ReadDir(filepath.Join(dir, "data-sources")) + if dirExists(v.providerFS, dir+"/data-sources") { + dataSourceFiles, _ := fs.ReadDir(v.providerFS, dir+"/data-sources") mismatchOpt.DatasourceEntries = dataSourceFiles } - if dirExists(filepath.Join(dir, "resources")) { - resourceFiles, _ := os.ReadDir(filepath.Join(dir, "resources")) + if dirExists(v.providerFS, dir+"/resources") { + resourceFiles, _ := fs.ReadDir(v.providerFS, dir+"/resources") mismatchOpt.ResourceEntries = resourceFiles } - if dirExists(filepath.Join(dir, "functions")) { - functionFiles, _ := os.ReadDir(filepath.Join(dir, "functions")) + if dirExists(v.providerFS, dir+"/functions") { + functionFiles, _ := fs.ReadDir(v.providerFS, dir+"/functions") mismatchOpt.FunctionEntries = functionFiles } @@ -270,27 +262,23 @@ func (v *validator) validateStaticDocs(dir string) error { return result } -func (v *validator) validateLegacyWebsite(dir string) error { - +func (v *validator) validateLegacyWebsite() error { + dir := "website/docs" var result error options := &check.ProviderFileOptions{ + FileOptions: &check.FileOptions{BasePath: v.providerDir}, FrontMatter: LegacyFrontMatterOptions, ValidExtensions: ValidLegacyFileExtensions, } var files []string - err := filepath.WalkDir(dir, func(path string, d os.DirEntry, err error) error { + err := fs.WalkDir(v.providerFS, dir, func(path string, d fs.DirEntry, err error) error { if err != nil { return fmt.Errorf("error walking directory %q: %w", dir, err) } - - rel, err := filepath.Rel(v.providerDir, path) - if err != nil { - return err - } if d.IsDir() { - match, err := doublestar.PathMatch(filepath.FromSlash(DocumentationDirGlobPattern), rel) + match, err := doublestar.Match(DocumentationDirGlobPattern, path) if err != nil { return err } @@ -298,12 +286,12 @@ func (v *validator) validateLegacyWebsite(dir string) error { return nil // skip valid non-documentation directories } - v.logger.infof("running invalid directories check on %s", rel) - result = errors.Join(result, check.InvalidDirectoriesCheck(rel)) + v.logger.infof("running invalid directories check on %s", path) + result = errors.Join(result, check.InvalidDirectoriesCheck(path)) return nil } - match, err := doublestar.PathMatch(filepath.FromSlash(DocumentationGlobPattern), rel) + match, err := doublestar.Match(DocumentationGlobPattern, path) if err != nil { return err } @@ -312,15 +300,13 @@ func (v *validator) validateLegacyWebsite(dir string) error { } // Configure FrontMatterOptions based on file type - if d.Name() == "index.md" { + if removeAllExt(d.Name()) == "index" { options.FrontMatter = LegacyIndexFrontMatterOptions - } else if _, relErr := filepath.Rel(rel, "guides"); relErr != nil { - options.FrontMatter = LegacyGuideFrontMatterOptions } else { options.FrontMatter = LegacyFrontMatterOptions } - v.logger.infof("running file checks on %s", rel) - result = errors.Join(result, check.NewProviderFileCheck(options).Run(path)) + v.logger.infof("running file checks on %s", path) + result = errors.Join(result, check.NewProviderFileCheck(v.providerFS, options).Run(path)) files = append(files, path) return nil @@ -334,16 +320,16 @@ func (v *validator) validateLegacyWebsite(dir string) error { Schema: v.providerSchema, } - if dirExists(filepath.Join(dir, "d")) { - dataSourceFiles, _ := os.ReadDir(filepath.Join(dir, "d")) + if dirExists(v.providerFS, dir+"/d") { + dataSourceFiles, _ := fs.ReadDir(v.providerFS, dir+"/d") mismatchOpt.DatasourceEntries = dataSourceFiles } - if dirExists(filepath.Join(dir, "r")) { - resourceFiles, _ := os.ReadDir(filepath.Join(dir, "r")) + if dirExists(v.providerFS, dir+"/r") { + resourceFiles, _ := fs.ReadDir(v.providerFS, dir+"/r") mismatchOpt.ResourceEntries = resourceFiles } - if dirExists(filepath.Join(dir, "functions")) { - functionFiles, _ := os.ReadDir(filepath.Join(dir, "functions")) + if dirExists(v.providerFS, dir+"/functions") { + functionFiles, _ := fs.ReadDir(v.providerFS, dir+"/functions") mismatchOpt.FunctionEntries = functionFiles } @@ -355,8 +341,8 @@ func (v *validator) validateLegacyWebsite(dir string) error { return result } -func dirExists(name string) bool { - if file, err := os.Stat(name); err != nil { +func dirExists(fileSys fs.FS, name string) bool { + if file, err := fs.Stat(fileSys, name); err != nil { return false } else if !file.IsDir() { return false diff --git a/internal/provider/validate_test.go b/internal/provider/validate_test.go index 4f087b9c..a6ada21d 100644 --- a/internal/provider/validate_test.go +++ b/internal/provider/validate_test.go @@ -4,31 +4,171 @@ package provider import ( + "bytes" + "io/fs" "path/filepath" "testing" + "testing/fstest" "github.com/bmatcuk/doublestar/v4" + "github.com/google/go-cmp/cmp" "github.com/hashicorp/cli" + tfjson "github.com/hashicorp/terraform-json" + "gopkg.in/yaml.v3" ) -func TestValidateStaticDocs(t *testing.T) { +// FrontMatterData represents the YAML frontmatter of Terraform Provider documentation. +type FrontMatterData struct { + Description *string `yaml:"description,omitempty"` + Layout *string `yaml:"layout,omitempty"` + PageTitle *string `yaml:"page_title,omitempty"` + SidebarCurrent *string `yaml:"sidebar_current,omitempty"` + Subcategory *string `yaml:"subcategory,omitempty"` +} + +var exampleDescription = "Example description." +var exampleLayout = "Example Layout" +var examplePageTitle = "Example Page Title" +var exampleSidebarCurrent = "Example Sidebar Current" +var exampleSubcategory = "Example Subcategory" + +var ValidRegistryResourceFrontMatter = FrontMatterData{ + Subcategory: &exampleSubcategory, + PageTitle: &examplePageTitle, + Description: &exampleDescription, +} + +var ValidLegacyResourceFrontMatter = FrontMatterData{ + Subcategory: &exampleSubcategory, + Layout: &exampleLayout, + PageTitle: &examplePageTitle, + Description: &exampleDescription, +} + +var ValidRegistryIndexFrontMatter = FrontMatterData{ + PageTitle: &examplePageTitle, + Description: &exampleDescription, +} + +var ValidLegacyIndexFrontMatter = FrontMatterData{ + Layout: &exampleLayout, + PageTitle: &examplePageTitle, + Description: &exampleDescription, +} + +var ValidRegistryGuideFrontMatter = FrontMatterData{ + PageTitle: &examplePageTitle, +} + +var ValidLegacyGuideFrontMatter = FrontMatterData{ + Layout: &exampleLayout, + PageTitle: &examplePageTitle, + Description: &exampleDescription, +} + +var InvalidYAMLFrontMatter = fstest.MapFile{ + Data: []byte("---\nsubcategory: \"Example\"\npage_title: \"Example: example_thing\"\ndescription: |-\nMissing indentation.\n---\n"), +} + +func TestValidateStaticDocs_DirectoryChecks(t *testing.T) { t.Parallel() testCases := map[string]struct { - BasePath string - ExpectError bool + ProviderFS fs.FS ExpectedError string }{ "valid registry directories": { - BasePath: filepath.Join("testdata", "valid-registry-directories"), + ProviderFS: fstest.MapFS{ + "docs/data-sources/thing.md": { + Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), + }, + "docs/functions/thing.md": { + Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), + }, + "docs/guides/thing.md": { + Data: encodeYAML(t, &ValidRegistryGuideFrontMatter), + }, + "docs/nonregistrydocs/valid.md": { + Data: []byte("non-registry documentation"), + }, + "docs/resources/thing.md": { + Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), + }, + "docs/CONTRIBUTING.md": { + Data: []byte("contribution guidelines"), + }, + "docs/index.md": { + Data: encodeYAML(t, &ValidRegistryIndexFrontMatter), + }, + }, }, - "valid registry directories with cdktf docs": { - BasePath: filepath.Join("testdata", "valid-registry-directories-with-cdktf"), + ProviderFS: fstest.MapFS{ + "docs/cdktf/typescript/data-sources/thing.md": { + Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), + }, + "docs/cdktf/typescirpt/guides/thing.md": { + Data: encodeYAML(t, &ValidRegistryGuideFrontMatter), + }, + "docs/cdktf/typescript/nonregistrydocs/valid.md": { + Data: []byte("non-registry documentation"), + }, + "docs/cdktf/typescript/resources/thing.md": { + Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), + }, + "docs/cdktf/typescript/CONTRIBUTING.md": { + Data: []byte("contribution guidelines"), + }, + "docs/cdktf/typescript/index.md": { + Data: encodeYAML(t, &ValidRegistryIndexFrontMatter), + }, + "docs/data-sources/thing.md": { + Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), + }, + "docs/guides/thing.md": { + Data: encodeYAML(t, &ValidRegistryGuideFrontMatter), + }, + "docs/nonregistrydocs/valid.md": { + Data: []byte("non-registry documentation"), + }, + "docs/resources/thing.md": { + Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), + }, + "docs/CONTRIBUTING.md": { + Data: []byte("contribution guidelines"), + }, + "docs/index.md": { + Data: encodeYAML(t, &ValidRegistryIndexFrontMatter), + }, + }, }, "invalid registry directories": { - BasePath: filepath.Join("testdata", "invalid-registry-directories"), - ExpectError: true, - ExpectedError: "invalid Terraform Provider documentation directory found: " + filepath.Join("docs", "resources", "invalid"), + ProviderFS: fstest.MapFS{ + "docs/data-sources/invalid/thing.md": { + Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), + }, + "docs/guides/invalid/thing.md": { + Data: encodeYAML(t, &ValidRegistryGuideFrontMatter), + }, + "docs/nonregistrydocs/valid.md": { + Data: []byte("non-registry documentation"), + }, + "docs/functions/invalid/thing.md": { + Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), + }, + "docs/resources/invalid/thing.md": { + Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), + }, + "docs/CONTRIBUTING.md": { + Data: []byte("contribution guidelines"), + }, + "docs/index.md": { + Data: encodeYAML(t, &ValidRegistryIndexFrontMatter), + }, + }, + ExpectedError: "invalid Terraform Provider documentation directory found: " + filepath.Join("docs", "data-sources", "invalid") + + "\ninvalid Terraform Provider documentation directory found: " + filepath.Join("docs", "functions", "invalid") + + "\ninvalid Terraform Provider documentation directory found: " + filepath.Join("docs", "guides", "invalid") + + "\ninvalid Terraform Provider documentation directory found: " + filepath.Join("docs", "resources", "invalid"), }, } @@ -39,46 +179,620 @@ func TestValidateStaticDocs(t *testing.T) { t.Parallel() v := &validator{ - providerDir: testCase.BasePath, + providerFS: testCase.ProviderFS, providerName: "terraform-provider-test", logger: NewLogger(cli.NewMockUi()), } + got := v.validateStaticDocs() - got := v.validateStaticDocs(filepath.Join(v.providerDir, "docs")) + if got == nil && testCase.ExpectedError != "" { + t.Fatalf("expected error: %s, but got no error", testCase.ExpectedError) + } - if got == nil && testCase.ExpectError { - t.Errorf("expected error, got no error") + if got != nil && got.Error() != testCase.ExpectedError { + t.Errorf("Unexpected response (+wanted, -got): %s", cmp.Diff(testCase.ExpectedError, got.Error())) } + }) + } +} - if got != nil && !testCase.ExpectError { - t.Errorf("expected no error, got error: %s", got) +func TestValidateStaticDocs_FileChecks(t *testing.T) { + t.Parallel() + testCases := map[string]struct { + ProviderFS fs.FS + ExpectedError string + }{ + "invalid data source files": { + ProviderFS: fstest.MapFS{ + "docs/data-sources/invalid_extension.txt": { + Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), + }, + "docs/data-sources/invalid_frontmatter.md": &InvalidYAMLFrontMatter, + "docs/data-sources/with_layout.md": { + Data: encodeYAML(t, + &FrontMatterData{ + Layout: &exampleLayout, + Subcategory: &exampleSubcategory, + PageTitle: &examplePageTitle, + Description: &exampleDescription, + }, + ), + }, + "docs/data-sources/with_sidebar_current.md": { + Data: encodeYAML(t, + &FrontMatterData{ + SidebarCurrent: &exampleSidebarCurrent, + Subcategory: &exampleSubcategory, + PageTitle: &examplePageTitle, + Description: &exampleDescription, + }, + ), + }, + }, + ExpectedError: filepath.Join("docs", "data-sources", "invalid_extension.txt") + ": error checking file extension: file does not end with a valid extension, valid extensions: [.md]\n" + + filepath.Join("docs", "data-sources", "invalid_frontmatter.md") + ": error checking file frontmatter: error parsing YAML frontmatter: yaml: line 4: could not find expected ':'\n" + + filepath.Join("docs", "data-sources", "with_layout.md") + ": error checking file frontmatter: YAML frontmatter should not contain layout\n" + + filepath.Join("docs", "data-sources", "with_sidebar_current.md") + ": error checking file frontmatter: YAML frontmatter should not contain sidebar_current", + }, + "invalid resource files": { + ProviderFS: fstest.MapFS{ + "docs/resources/invalid_extension.txt": { + Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), + }, + "docs/resources/invalid_frontmatter.md": &InvalidYAMLFrontMatter, + "docs/resources/with_layout.md": { + Data: encodeYAML(t, + &FrontMatterData{ + Layout: &exampleLayout, + Subcategory: &exampleSubcategory, + PageTitle: &examplePageTitle, + Description: &exampleDescription, + }, + ), + }, + "docs/resources/with_sidebar_current.md": { + Data: encodeYAML(t, + &FrontMatterData{ + SidebarCurrent: &exampleSidebarCurrent, + Subcategory: &exampleSubcategory, + PageTitle: &examplePageTitle, + Description: &exampleDescription, + }, + ), + }, + }, + ExpectedError: filepath.Join("docs", "resources", "invalid_extension.txt") + ": error checking file extension: file does not end with a valid extension, valid extensions: [.md]\n" + + filepath.Join("docs", "resources", "invalid_frontmatter.md") + ": error checking file frontmatter: error parsing YAML frontmatter: yaml: line 4: could not find expected ':'\n" + + filepath.Join("docs", "resources", "with_layout.md") + ": error checking file frontmatter: YAML frontmatter should not contain layout\n" + + filepath.Join("docs", "resources", "with_sidebar_current.md") + ": error checking file frontmatter: YAML frontmatter should not contain sidebar_current", + }, + "invalid guide files": { + ProviderFS: fstest.MapFS{ + "docs/guides/invalid_extension.txt": { + Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), + }, + "docs/guides/invalid_frontmatter.md": &InvalidYAMLFrontMatter, + "docs/guides/with_layout.md": { + Data: encodeYAML(t, + &FrontMatterData{ + Layout: &exampleLayout, + Subcategory: &exampleSubcategory, + PageTitle: &examplePageTitle, + Description: &exampleDescription, + }, + ), + }, + "docs/guides/with_sidebar_current.md": { + Data: encodeYAML(t, + &FrontMatterData{ + SidebarCurrent: &exampleSidebarCurrent, + Subcategory: &exampleSubcategory, + PageTitle: &examplePageTitle, + Description: &exampleDescription, + }, + ), + }, + "docs/guides/without_page_title.md": { + Data: encodeYAML(t, + &FrontMatterData{ + Subcategory: &exampleSubcategory, + Description: &exampleDescription, + }, + ), + }, + }, + ExpectedError: filepath.Join("docs", "guides", "invalid_extension.txt") + ": error checking file extension: file does not end with a valid extension, valid extensions: [.md]\n" + + filepath.Join("docs", "guides", "invalid_frontmatter.md") + ": error checking file frontmatter: error parsing YAML frontmatter: yaml: line 4: could not find expected ':'\n" + + filepath.Join("docs", "guides", "with_layout.md") + ": error checking file frontmatter: YAML frontmatter should not contain layout\n" + + filepath.Join("docs", "guides", "with_sidebar_current.md") + ": error checking file frontmatter: YAML frontmatter should not contain sidebar_current\n" + + filepath.Join("docs", "guides", "without_page_title.md") + ": error checking file frontmatter: YAML frontmatter missing required page_title", + }, + "invalid index file - invalid extension": { + ProviderFS: fstest.MapFS{ + "docs/index.txt": { + Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), + }, + }, + ExpectedError: filepath.Join("docs", "index.txt") + ": error checking file extension: file does not end with a valid extension, valid extensions: [.md]", + }, + "invalid index file - invalid frontmatter": { + ProviderFS: fstest.MapFS{ + "docs/index.md": &InvalidYAMLFrontMatter, + }, + ExpectedError: filepath.Join("docs", "index.md") + ": error checking file frontmatter: error parsing YAML frontmatter: yaml: line 4: could not find expected ':'", + }, + "invalid index file - with layout": { + ProviderFS: fstest.MapFS{ + "docs/index.md": { + Data: encodeYAML(t, + &FrontMatterData{ + Layout: &exampleLayout, + PageTitle: &examplePageTitle, + Description: &exampleDescription, + }, + ), + }, + }, + ExpectedError: filepath.Join("docs", "index.md") + ": error checking file frontmatter: YAML frontmatter should not contain layout", + }, + "invalid index file - with sidebar current": { + ProviderFS: fstest.MapFS{ + "docs/index.md": { + Data: encodeYAML(t, + &FrontMatterData{ + SidebarCurrent: &exampleSidebarCurrent, + PageTitle: &examplePageTitle, + Description: &exampleDescription, + }, + ), + }, + }, + ExpectedError: filepath.Join("docs", "index.md") + ": error checking file frontmatter: YAML frontmatter should not contain sidebar_current", + }, + "invalid index file - with subcategory": { + ProviderFS: fstest.MapFS{ + "docs/index.md": { + Data: encodeYAML(t, + &FrontMatterData{ + Subcategory: &exampleSubcategory, + PageTitle: &examplePageTitle, + Description: &exampleDescription, + }, + ), + }, + }, + ExpectedError: filepath.Join("docs", "index.md") + ": error checking file frontmatter: YAML frontmatter should not contain subcategory", + }, + } + + for name, testCase := range testCases { + name := name + testCase := testCase + t.Run(name, func(t *testing.T) { + t.Parallel() + + v := &validator{ + providerFS: testCase.ProviderFS, + providerName: "terraform-provider-test", + + logger: NewLogger(cli.NewMockUi()), + } + got := v.validateStaticDocs() + + if got == nil && testCase.ExpectedError != "" { + t.Fatalf("expected error: %s, but got no error", testCase.ExpectedError) } if got != nil && got.Error() != testCase.ExpectedError { - t.Errorf("expected error: %s, got error: %s", testCase.ExpectedError, got) + t.Errorf("Unexpected response (+wanted, -got): %s", cmp.Diff(testCase.ExpectedError, got.Error())) } }) } } -func TestValidateLegacyWebsite(t *testing.T) { +func TestValidateStaticDocs_FileMismatchCheck(t *testing.T) { t.Parallel() testCases := map[string]struct { - BasePath string - ExpectError bool + ProviderFS fs.FS + ProviderSchema *tfjson.ProviderSchema + ExpectedError string + }{ + "valid - no mismatch": { + ProviderSchema: &tfjson.ProviderSchema{ + DataSourceSchemas: map[string]*tfjson.Schema{ + "test_pet": {}, + }, + ResourceSchemas: map[string]*tfjson.Schema{ + "test_id": {}, + }, + Functions: map[string]*tfjson.FunctionSignature{ + "parse_id": {}, + }, + }, + ProviderFS: fstest.MapFS{ + "docs/data-sources/pet.md": { + Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), + }, + "docs/functions/parse_id.md": { + Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), + }, + "docs/resources/id.md": { + Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), + }, + }, + }, + "invalid - missing files": { + ProviderSchema: &tfjson.ProviderSchema{ + DataSourceSchemas: map[string]*tfjson.Schema{ + "test_pet": {}, + "test_pet2": {}, + }, + ResourceSchemas: map[string]*tfjson.Schema{ + "test_id": {}, + "test_id2": {}, + }, + Functions: map[string]*tfjson.FunctionSignature{ + "parse_id": {}, + "parse_id2": {}, + }, + }, + ProviderFS: fstest.MapFS{ + "docs/data-sources/pet.md": { + Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), + }, + "docs/functions/parse_id.md": { + Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), + }, + "docs/resources/id.md": { + Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), + }, + }, + ExpectedError: "missing documentation file for resource: test_id2\n" + + "missing documentation file for datasource: test_pet2\n" + + "missing documentation file for function: parse_id2", + }, + "invalid - extra files": { + ProviderSchema: &tfjson.ProviderSchema{ + DataSourceSchemas: map[string]*tfjson.Schema{ + "test_pet": {}, + }, + ResourceSchemas: map[string]*tfjson.Schema{ + "test_id": {}, + }, + Functions: map[string]*tfjson.FunctionSignature{ + "parse_id": {}, + }, + }, + ProviderFS: fstest.MapFS{ + "docs/data-sources/pet.md": { + Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), + }, + "docs/data-sources/pet2.md": { + Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), + }, + "docs/functions/parse_id.md": { + Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), + }, + "docs/functions/parse_id2.md": { + Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), + }, + "docs/resources/id.md": { + Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), + }, + "docs/resources/id2.md": { + Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), + }, + }, + ExpectedError: "matching resource for documentation file (id2.md) not found, file is extraneous or incorrectly named\n" + + "matching datasource for documentation file (pet2.md) not found, file is extraneous or incorrectly named\n" + + "matching function for documentation file (parse_id2.md) not found, file is extraneous or incorrectly named", + }, + } + + for name, testCase := range testCases { + name := name + testCase := testCase + t.Run(name, func(t *testing.T) { + t.Parallel() + + v := &validator{ + providerSchema: testCase.ProviderSchema, + providerFS: testCase.ProviderFS, + providerName: "terraform-provider-test", + + logger: NewLogger(cli.NewMockUi()), + } + got := v.validateStaticDocs() + + if got == nil && testCase.ExpectedError != "" { + t.Fatalf("expected error: %s, but got no error", testCase.ExpectedError) + } + + if got != nil && got.Error() != testCase.ExpectedError { + t.Errorf("Unexpected response (+wanted, -got): %s", cmp.Diff(testCase.ExpectedError, got.Error())) + } + }) + } +} + +func TestValidateLegacyWebsite_DirectoryChecks(t *testing.T) { + t.Parallel() + testCases := map[string]struct { + ProviderFS fs.FS ExpectedError string }{ "valid legacy directories": { - BasePath: filepath.Join("testdata", "valid-legacy-directories"), + ProviderFS: fstest.MapFS{ + "website/docs/d/thing.html.markdown": { + Data: encodeYAML(t, &ValidLegacyResourceFrontMatter), + }, + "website/docs/functions/thing.html.markdown": { + Data: encodeYAML(t, &ValidLegacyResourceFrontMatter), + }, + "website/docs/guides/thing.html.markdown": { + Data: encodeYAML(t, &ValidLegacyGuideFrontMatter), + }, + "website/docs/r/thing.html.markdown": { + Data: encodeYAML(t, &ValidLegacyResourceFrontMatter), + }, + "website/docs/index.html.markdown": { + Data: encodeYAML(t, &ValidLegacyIndexFrontMatter), + }, + }, }, "valid legacy directories with cdktf docs": { - BasePath: filepath.Join("testdata", "valid-legacy-directories-with-cdktf"), + ProviderFS: fstest.MapFS{ + "website/docs/cdktf/typescript/d/thing.html.markdown": { + Data: encodeYAML(t, &ValidLegacyResourceFrontMatter), + }, + "website/docs/cdktf/typescript/guides/thing.html.markdown": { + Data: encodeYAML(t, &ValidLegacyGuideFrontMatter), + }, + "website/docs/cdktf/typescript/r/thing.html.markdown": { + Data: encodeYAML(t, &ValidLegacyResourceFrontMatter), + }, + "website/docs/cdktf/typescript/index.html.markdown": { + Data: encodeYAML(t, &ValidLegacyIndexFrontMatter), + }, + "website/docs/d/thing.html.markdown": { + Data: encodeYAML(t, &ValidLegacyResourceFrontMatter), + }, + "website/docs/guides/thing.html.markdown": { + Data: encodeYAML(t, &ValidLegacyGuideFrontMatter), + }, + "website/docs/r/thing.html.markdown": { + Data: encodeYAML(t, &ValidLegacyResourceFrontMatter), + }, + "website/docs/index.html.markdown": { + Data: encodeYAML(t, &ValidLegacyIndexFrontMatter), + }, + }, }, "invalid legacy directories": { - BasePath: filepath.Join("testdata", "invalid-legacy-directories"), - ExpectError: true, - ExpectedError: "invalid Terraform Provider documentation directory found: " + filepath.Join("website", "docs", "r", "invalid"), + ProviderFS: fstest.MapFS{ + "website/docs/d/invalid/thing.html.markdown": { + Data: encodeYAML(t, &ValidLegacyResourceFrontMatter), + }, + "website/docs/functions/invalid/thing.html.markdown": { + Data: encodeYAML(t, &ValidLegacyResourceFrontMatter), + }, + "website/docs/guides/invalid/thing.html.markdown": { + Data: encodeYAML(t, &ValidLegacyGuideFrontMatter), + }, + "website/docs/r/invalid/thing.html.markdown": { + Data: encodeYAML(t, &ValidLegacyResourceFrontMatter), + }, + "website/docs/index.html.markdown": { + Data: encodeYAML(t, &ValidLegacyIndexFrontMatter), + }, + }, + ExpectedError: "invalid Terraform Provider documentation directory found: " + filepath.Join("website", "docs", "d", "invalid") + + "\ninvalid Terraform Provider documentation directory found: " + filepath.Join("website", "docs", "functions", "invalid") + + "\ninvalid Terraform Provider documentation directory found: " + filepath.Join("website", "docs", "guides", "invalid") + + "\ninvalid Terraform Provider documentation directory found: " + filepath.Join("website", "docs", "r", "invalid"), + }, + } + + for name, testCase := range testCases { + name := name + testCase := testCase + t.Run(name, func(t *testing.T) { + t.Parallel() + + v := &validator{ + providerFS: testCase.ProviderFS, + providerName: "terraform-provider-test", + + logger: NewLogger(cli.NewMockUi()), + } + got := v.validateLegacyWebsite() + + if got == nil && testCase.ExpectedError != "" { + t.Fatalf("expected error: %s, but got no error", testCase.ExpectedError) + } + + if got != nil && got.Error() != testCase.ExpectedError { + t.Errorf("Unexpected response (+wanted, -got): %s", cmp.Diff(testCase.ExpectedError, got.Error())) + } + }) + } +} + +func TestValidateLegacyWebsite_FileChecks(t *testing.T) { + t.Parallel() + testCases := map[string]struct { + ProviderFS fs.FS + ExpectedError string + }{ + "invalid data source files": { + ProviderFS: fstest.MapFS{ + "website/docs/d/invalid_extension.txt": { + Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), + }, + "website/docs/d/invalid_frontmatter.html.markdown": &InvalidYAMLFrontMatter, + "website/docs/d/without_layout.html.markdown": { + Data: encodeYAML(t, + &FrontMatterData{ + Subcategory: &exampleSubcategory, + PageTitle: &examplePageTitle, + Description: &exampleDescription, + }, + ), + }, + "website/docs/d/with_sidebar_current.html.markdown": { + Data: encodeYAML(t, + &FrontMatterData{ + SidebarCurrent: &exampleSidebarCurrent, + Subcategory: &exampleSubcategory, + Layout: &exampleLayout, + PageTitle: &examplePageTitle, + Description: &exampleDescription, + }, + ), + }, + }, + ExpectedError: filepath.Join("website", "docs", "d", "invalid_extension.txt") + ": error checking file extension: file does not end with a valid extension, valid extensions: [.html.markdown .html.md .markdown .md]\n" + + filepath.Join("website", "docs", "d", "invalid_frontmatter.html.markdown") + ": error checking file frontmatter: error parsing YAML frontmatter: yaml: line 4: could not find expected ':'\n" + + filepath.Join("website", "docs", "d", "with_sidebar_current.html.markdown") + ": error checking file frontmatter: YAML frontmatter should not contain sidebar_current\n" + + filepath.Join("website", "docs", "d", "without_layout.html.markdown") + ": error checking file frontmatter: YAML frontmatter missing required layout", + }, + "invalid resource files": { + ProviderFS: fstest.MapFS{ + "website/docs/r/invalid_extension.txt": { + Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), + }, + "website/docs/r/invalid_frontmatter.html.markdown": &InvalidYAMLFrontMatter, + "website/docs/r/without_layout.html.markdown": { + Data: encodeYAML(t, + &FrontMatterData{ + Subcategory: &exampleSubcategory, + PageTitle: &examplePageTitle, + Description: &exampleDescription, + }, + ), + }, + "website/docs/r/with_sidebar_current.html.markdown": { + Data: encodeYAML(t, + &FrontMatterData{ + SidebarCurrent: &exampleSidebarCurrent, + Subcategory: &exampleSubcategory, + Layout: &exampleLayout, + PageTitle: &examplePageTitle, + Description: &exampleDescription, + }, + ), + }, + }, + ExpectedError: filepath.Join("website", "docs", "r", "invalid_extension.txt") + ": error checking file extension: file does not end with a valid extension, valid extensions: [.html.markdown .html.md .markdown .md]\n" + + filepath.Join("website", "docs", "r", "invalid_frontmatter.html.markdown") + ": error checking file frontmatter: error parsing YAML frontmatter: yaml: line 4: could not find expected ':'\n" + + filepath.Join("website", "docs", "r", "with_sidebar_current.html.markdown") + ": error checking file frontmatter: YAML frontmatter should not contain sidebar_current\n" + + filepath.Join("website", "docs", "r", "without_layout.html.markdown") + ": error checking file frontmatter: YAML frontmatter missing required layout", + }, + "invalid guide files": { + ProviderFS: fstest.MapFS{ + "website/docs/guides/invalid_extension.txt": { + Data: encodeYAML(t, &ValidLegacyGuideFrontMatter), + }, + "website/docs/guides/invalid_frontmatter.html.markdown": &InvalidYAMLFrontMatter, + "website/docs/guides/with_sidebar_current.html.markdown": { + Data: encodeYAML(t, + &FrontMatterData{ + SidebarCurrent: &exampleSidebarCurrent, + Layout: &exampleLayout, + PageTitle: &examplePageTitle, + Description: &exampleDescription, + }, + ), + }, + "website/docs/guides/without_description.html.markdown": { + Data: encodeYAML(t, + &FrontMatterData{ + Layout: &exampleLayout, + PageTitle: &examplePageTitle, + }, + ), + }, + "website/docs/guides/without_layout.html.markdown": { + Data: encodeYAML(t, + &FrontMatterData{ + PageTitle: &examplePageTitle, + Description: &exampleDescription, + }, + ), + }, + "website/docs/guides/without_page_title.html.markdown": { + Data: encodeYAML(t, + &FrontMatterData{ + Layout: &exampleLayout, + Description: &exampleDescription, + }, + ), + }, + }, + ExpectedError: filepath.Join("website", "docs", "guides", "invalid_extension.txt") + ": error checking file extension: file does not end with a valid extension, valid extensions: [.html.markdown .html.md .markdown .md]\n" + + filepath.Join("website", "docs", "guides", "invalid_frontmatter.html.markdown") + ": error checking file frontmatter: error parsing YAML frontmatter: yaml: line 4: could not find expected ':'\n" + + filepath.Join("website", "docs", "guides", "with_sidebar_current.html.markdown") + ": error checking file frontmatter: YAML frontmatter should not contain sidebar_current\n" + + filepath.Join("website", "docs", "guides", "without_description.html.markdown") + ": error checking file frontmatter: YAML frontmatter missing required description\n" + + filepath.Join("website", "docs", "guides", "without_layout.html.markdown") + ": error checking file frontmatter: YAML frontmatter missing required layout\n" + + filepath.Join("website", "docs", "guides", "without_page_title.html.markdown") + ": error checking file frontmatter: YAML frontmatter missing required page_title", + }, + "invalid index file - invalid extension": { + ProviderFS: fstest.MapFS{ + "website/docs/index.txt": { + Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), + }, + }, + ExpectedError: filepath.Join("website", "docs", "index.txt") + ": error checking file extension: file does not end with a valid extension, valid extensions: [.html.markdown .html.md .markdown .md]", + }, + "invalid index file - invalid frontmatter": { + ProviderFS: fstest.MapFS{ + "website/docs/index.html.markdown": &InvalidYAMLFrontMatter, + }, + ExpectedError: filepath.Join("website", "docs", "index.html.markdown") + ": error checking file frontmatter: error parsing YAML frontmatter: yaml: line 4: could not find expected ':'", + }, + "invalid index file - with sidebar current": { + ProviderFS: fstest.MapFS{ + "website/docs/index.html.markdown": { + Data: encodeYAML(t, + &FrontMatterData{ + SidebarCurrent: &exampleSidebarCurrent, + Layout: &exampleLayout, + PageTitle: &examplePageTitle, + Description: &exampleDescription, + }, + ), + }, + }, + ExpectedError: filepath.Join("website", "docs", "index.html.markdown") + ": error checking file frontmatter: YAML frontmatter should not contain sidebar_current", + }, + "invalid index file - with subcategory": { + ProviderFS: fstest.MapFS{ + "website/docs/index.html.markdown": { + Data: encodeYAML(t, + &FrontMatterData{ + Subcategory: &exampleSubcategory, + Layout: &exampleLayout, + PageTitle: &examplePageTitle, + Description: &exampleDescription, + }, + ), + }, + }, + ExpectedError: filepath.Join("website", "docs", "index.html.markdown") + ": error checking file frontmatter: YAML frontmatter should not contain subcategory", + }, + "invalid index file - without layout": { + ProviderFS: fstest.MapFS{ + "website/docs/index.html.markdown": { + Data: encodeYAML(t, + &FrontMatterData{ + PageTitle: &examplePageTitle, + Description: &exampleDescription, + }, + ), + }, + }, + ExpectedError: filepath.Join("website", "docs", "index.html.markdown") + ": error checking file frontmatter: YAML frontmatter missing required layout", }, } @@ -89,24 +803,144 @@ func TestValidateLegacyWebsite(t *testing.T) { t.Parallel() v := &validator{ - providerDir: testCase.BasePath, + providerFS: testCase.ProviderFS, providerName: "terraform-provider-test", logger: NewLogger(cli.NewMockUi()), } + got := v.validateLegacyWebsite() + + if got == nil && testCase.ExpectedError != "" { + t.Fatalf("expected error: %s, but got no error", testCase.ExpectedError) + } + + if got != nil && got.Error() != testCase.ExpectedError { + t.Errorf("Unexpected response (+wanted, -got): %s", cmp.Diff(testCase.ExpectedError, got.Error())) + } + }) + } +} + +func TestValidateLegacyWebsite_FileMismatchCheck(t *testing.T) { + t.Parallel() + testCases := map[string]struct { + ProviderFS fs.FS + ProviderSchema *tfjson.ProviderSchema + ExpectedError string + }{ + "valid - no mismatch": { + ProviderSchema: &tfjson.ProviderSchema{ + DataSourceSchemas: map[string]*tfjson.Schema{ + "test_pet": {}, + }, + ResourceSchemas: map[string]*tfjson.Schema{ + "test_id": {}, + }, + Functions: map[string]*tfjson.FunctionSignature{ + "parse_id": {}, + }, + }, + ProviderFS: fstest.MapFS{ + "website/docs/d/pet.html.markdown": { + Data: encodeYAML(t, &ValidLegacyResourceFrontMatter), + }, + "website/docs/functions/parse_id.html.markdown": { + Data: encodeYAML(t, &ValidLegacyResourceFrontMatter), + }, + "website/docs/r/id.html.markdown": { + Data: encodeYAML(t, &ValidLegacyResourceFrontMatter), + }, + }, + }, + "invalid - missing files": { + ProviderSchema: &tfjson.ProviderSchema{ + DataSourceSchemas: map[string]*tfjson.Schema{ + "test_pet": {}, + "test_pet2": {}, + }, + ResourceSchemas: map[string]*tfjson.Schema{ + "test_id": {}, + "test_id2": {}, + }, + Functions: map[string]*tfjson.FunctionSignature{ + "parse_id": {}, + "parse_id2": {}, + }, + }, + ProviderFS: fstest.MapFS{ + "website/docs/d/pet.html.markdown": { + Data: encodeYAML(t, &ValidLegacyResourceFrontMatter), + }, + "website/docs/functions/parse_id.html.markdown": { + Data: encodeYAML(t, &ValidLegacyResourceFrontMatter), + }, + "website/docs/r/id.html.markdown": { + Data: encodeYAML(t, &ValidLegacyResourceFrontMatter), + }, + }, + ExpectedError: "missing documentation file for resource: test_id2\n" + + "missing documentation file for datasource: test_pet2\n" + + "missing documentation file for function: parse_id2", + }, + "invalid - extra files": { + ProviderSchema: &tfjson.ProviderSchema{ + DataSourceSchemas: map[string]*tfjson.Schema{ + "test_pet": {}, + }, + ResourceSchemas: map[string]*tfjson.Schema{ + "test_id": {}, + }, + Functions: map[string]*tfjson.FunctionSignature{ + "parse_id": {}, + }, + }, + ProviderFS: fstest.MapFS{ + "website/docs/d/pet.html.markdown": { + Data: encodeYAML(t, &ValidLegacyResourceFrontMatter), + }, + "website/docs/d/pet2.html.markdown": { + Data: encodeYAML(t, &ValidLegacyResourceFrontMatter), + }, + "website/docs/functions/parse_id.html.markdown": { + Data: encodeYAML(t, &ValidLegacyResourceFrontMatter), + }, + "website/docs/functions/parse_id2.html.markdown": { + Data: encodeYAML(t, &ValidLegacyResourceFrontMatter), + }, + "website/docs/r/id.html.markdown": { + Data: encodeYAML(t, &ValidLegacyResourceFrontMatter), + }, + "website/docs/r/id2.html.markdown": { + Data: encodeYAML(t, &ValidLegacyResourceFrontMatter), + }, + }, + ExpectedError: "matching resource for documentation file (id2.html.markdown) not found, file is extraneous or incorrectly named\n" + + "matching datasource for documentation file (pet2.html.markdown) not found, file is extraneous or incorrectly named\n" + + "matching function for documentation file (parse_id2.html.markdown) not found, file is extraneous or incorrectly named", + }, + } - got := v.validateLegacyWebsite(filepath.Join(v.providerDir, "website")) + for name, testCase := range testCases { + name := name + testCase := testCase + t.Run(name, func(t *testing.T) { + t.Parallel() + + v := &validator{ + providerSchema: testCase.ProviderSchema, + providerFS: testCase.ProviderFS, + providerName: "terraform-provider-test", - if got == nil && testCase.ExpectError { - t.Errorf("expected error, got no error") + logger: NewLogger(cli.NewMockUi()), } + got := v.validateLegacyWebsite() - if got != nil && !testCase.ExpectError { - t.Errorf("expected no error, got error: %s", got) + if got == nil && testCase.ExpectedError != "" { + t.Fatalf("expected error: %s, but got no error", testCase.ExpectedError) } if got != nil && got.Error() != testCase.ExpectedError { - t.Errorf("expected error: %s, got error: %s", testCase.ExpectedError, got) + t.Errorf("Unexpected response (+wanted, -got): %s", cmp.Diff(testCase.ExpectedError, got.Error())) } }) } @@ -166,3 +1000,15 @@ func TestDocumentationDirGlobPattern(t *testing.T) { }) } } + +func encodeYAML(t *testing.T, data *FrontMatterData) []byte { + t.Helper() + var buf bytes.Buffer + buf.Write([]byte("---\n")) + err := yaml.NewEncoder(&buf).Encode(data) + if err != nil { + t.Fatalf("error encoding YAML: %s", err) + } + buf.Write([]byte("---\n")) + return buf.Bytes() +} From 97bd6c75c40583618bfd9dd165572049bf85298d Mon Sep 17 00:00:00 2001 From: Selena Goods Date: Fri, 1 Nov 2024 12:42:04 -0400 Subject: [PATCH 38/71] all: add support for ephemeral resources (#415) * Update `generate` subcommand to support ephemeral resources * Update `validate` subcommand to support ephemeral resources * Update `migrate` subcommand to support ephemeral resources * Update README.md * Add changelog entries * Update README.md Co-authored-by: Austin Valle --------- Co-authored-by: Austin Valle --- .../unreleased/FEATURES-20241031-100833.yaml | 5 + .../unreleased/FEATURES-20241031-100904.yaml | 5 + .../unreleased/FEATURES-20241031-100919.yaml | 5 + README.md | 76 ++-- ...k_provider_success_generic_templates.txtar | 1 + ...ork_provider_success_named_templates.txtar | 1 + ...mework_provider_success_no_templates.txtar | 1 + .../generate/null_provider_success.txtar | 1 + ...provider_success_all_framework_types.txtar | 1 + ...k_provider_success_generic_templates.txtar | 326 +++++++++++++----- ...amework_provider_success_legacy_docs.txtar | 239 ++++++++----- ...ork_provider_success_named_templates.txtar | 326 +++++++++++++----- ...mework_provider_success_no_templates.txtar | 244 ++++++++----- ...mework_provider_success_static_files.txtar | 239 ++++++++----- .../generate/nested_id_attribute.txtar | 1 + .../generate/null_provider_success.txtar | 1 + .../migrate/time_provider_idempotency.txtar | 182 +++++++++- .../time_provider_success_docs_website.txtar | 182 +++++++++- ...der_success_docs_website_with_prefix.txtar | 182 +++++++++- ...time_provider_success_legacy_website.txtar | 181 +++++++++- ...r_success_legacy_website_with_prefix.txtar | 181 +++++++++- ...amework_provider_error_file_mismatch.txtar | 64 +++- ...amework_provider_success_legacy_docs.txtar | 44 +++ ...ework_provider_success_registry_docs.txtar | 43 +++ go.mod | 2 +- internal/check/directory.go | 28 +- internal/check/directory_test.go | 16 +- internal/check/file_mismatch.go | 7 + internal/provider/generate.go | 81 ++++- internal/provider/migrate.go | 11 +- internal/provider/testdata/schema.json | 45 +++ internal/provider/util_test.go | 10 +- internal/provider/validate.go | 12 +- internal/provider/validate_test.go | 140 +++++++- 34 files changed, 2366 insertions(+), 517 deletions(-) create mode 100644 .changes/unreleased/FEATURES-20241031-100833.yaml create mode 100644 .changes/unreleased/FEATURES-20241031-100904.yaml create mode 100644 .changes/unreleased/FEATURES-20241031-100919.yaml diff --git a/.changes/unreleased/FEATURES-20241031-100833.yaml b/.changes/unreleased/FEATURES-20241031-100833.yaml new file mode 100644 index 00000000..0ef815b9 --- /dev/null +++ b/.changes/unreleased/FEATURES-20241031-100833.yaml @@ -0,0 +1,5 @@ +kind: FEATURES +body: 'generate: Add support for ephemeral resources' +time: 2024-10-31T10:08:33.606686-04:00 +custom: + Issue: "415" diff --git a/.changes/unreleased/FEATURES-20241031-100904.yaml b/.changes/unreleased/FEATURES-20241031-100904.yaml new file mode 100644 index 00000000..0d8a35e7 --- /dev/null +++ b/.changes/unreleased/FEATURES-20241031-100904.yaml @@ -0,0 +1,5 @@ +kind: FEATURES +body: 'migrate: Add support for ephemeral resources' +time: 2024-10-31T10:09:04.175251-04:00 +custom: + Issue: "415" diff --git a/.changes/unreleased/FEATURES-20241031-100919.yaml b/.changes/unreleased/FEATURES-20241031-100919.yaml new file mode 100644 index 00000000..6e2096ea --- /dev/null +++ b/.changes/unreleased/FEATURES-20241031-100919.yaml @@ -0,0 +1,5 @@ +kind: FEATURES +body: 'validate: Add support for ephemeral resources' +time: 2024-10-31T10:09:19.716278-04:00 +custom: + Issue: "415" diff --git a/README.md b/README.md index 6e30fd9e..dc1edecc 100644 --- a/README.md +++ b/README.md @@ -112,6 +112,7 @@ When you run `tfplugindocs`, by default from the root directory of a provider co * Generate resource template files, if missing * Generate data source template files, if missing * Generate function template files, if missing (Requires Terraform v1.8.0+) +* Generate ephemeral resource template files, if missing (Requires Terraform v1.10.0+) * Copy all non-template files to the output website directory * Process all the remaining templates to generate files for the output website directory @@ -193,16 +194,18 @@ For templates: > **NOTE:** In the following conventional paths for templates, ``, ``, and `` do not include the provider prefix. -| Path | Description | -|-------------------------------------------------------|----------------------------------------| -| `templates/` | Root of templated docs | -| `templates/index.md[.tmpl]` | Docs index page (or template) | -| `templates/data-sources.md[.tmpl]` | Generic data source page (or template) | -| `templates/data-sources/.md[.tmpl]` | Data source page (or template) | -| `templates/functions.md[.tmpl]` | Generic function page (or template) | -| `templates/functions/.md[.tmpl]` | Function page (or template) | -| `templates/resources.md[.tmpl]` | Generic resource page (or template) | -| `templates/resources/.md[.tmpl]` | Resource page (or template) | +| Path | Description | +|--------------------------------------------------------------------|-----------------------------------------------| +| `templates/` | Root of templated docs | +| `templates/index.md[.tmpl]` | Docs index page (or template) | +| `templates/data-sources.md[.tmpl]` | Generic data source page (or template) | +| `templates/data-sources/.md[.tmpl]` | Data source page (or template) | +| `templates/ephemeral-resources.md[.tmpl]` | Generic ephemeral resource page (or template) | +| `templates/ephemeral-resources/.md[.tmpl]` | Ephemeral resource page (or template) | +| `templates/functions.md[.tmpl]` | Generic function page (or template) | +| `templates/functions/.md[.tmpl]` | Function page (or template) | +| `templates/resources.md[.tmpl]` | Generic resource page (or template) | +| `templates/resources/.md[.tmpl]` | Resource page (or template) | Note: the `.tmpl` extension is necessary, for the file to be correctly handled as a template. @@ -211,14 +214,15 @@ For examples: > **NOTE:** In the following conventional paths for examples, `` and `` include the provider prefix as well, but the provider prefix is **NOT** included in``. > For example, the data source [`caller_identity`](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) in the `aws` provider would have an "example" conventional path of: `examples/data-sources/aws_caller_identity/data-source.tf` -| Path | Description | -|-----------------------------------------------------------|---------------------------------| -| `examples/` | Root of examples | -| `examples/provider/provider.tf` | Provider example config | -| `examples/data-sources//data-source.tf` | Data source example config | -| `examples/functions//function.tf` | Function example config | -| `examples/resources//resource.tf` | Resource example config | -| `examples/resources//import.sh` | Resource example import command | +| Path | Description | +|---------------------------------------------------------------------------|-----------------------------------| +| `examples/` | Root of examples | +| `examples/provider/provider.tf` | Provider example config | +| `examples/data-sources//data-source.tf` | Data source example config | +| `examples/ephemeral-resources//ephemeral-resource.tf` | Ephemeral resource example config | +| `examples/functions//function.tf` | Function example config | +| `examples/resources//resource.tf` | Resource example config | +| `examples/resources//import.sh` | Resource example import command | #### Migration @@ -229,25 +233,27 @@ The `migrate` subcommand assumes the following conventional paths for the render Legacy website directory structure: -| Path | Description | -|-------------------------------------------------------|-----------------------------| -| `website/` | Root of website docs | -| `website/docs/guides` | Root of guides subdirectory | -| `website/docs/index.html.markdown` | Docs index page | -| `website/docs/d/.html.markdown` | Data source page | -| `website/docs/functons/.html.markdown` | Functions page | -| `website/docs/r/.html.markdown` | Resource page | +| Path | Description | +|----------------------------------------------------------------------------|-----------------------------| +| `website/` | Root of website docs | +| `website/docs/guides` | Root of guides subdirectory | +| `website/docs/index.html.markdown` | Docs index page | +| `website/docs/d/.html.markdown` | Data source page | +| `website/docs/ephemeral-resources/.html.markdown` | Ephemeral resource page | +| `website/docs/functons/.html.markdown` | Functions page | +| `website/docs/r/.html.markdown` | Resource page | Docs website directory structure: -| Path | Description | -|------------------------------------------------------|-----------------------------| -| `docs/` | Root of website docs | -| `docs/guides` | Root of guides subdirectory | -| `docs/index.html.markdown` | Docs index page | -| `docs/data-sources/.html.markdown` | Data source page | -| `docs/functions/.html.markdown` | Function page | -| `docs/resources/.html.markdown` | Resource page | +| Path | Description | +|--------------------------------------------------------------------|-----------------------------| +| `docs/` | Root of website docs | +| `docs/guides` | Root of guides subdirectory | +| `docs/index.html.markdown` | Docs index page | +| `docs/data-sources/.html.markdown` | Data source page | +| `docs/ephemeral-resources/.html.markdown` | Ephemeral resource page | +| `docs/functions/.html.markdown` | Function page | +| `docs/resources/.html.markdown` | Resource page | Files named `index` (before the first `.`) in the website docs root directory and files in the `website/docs/d/`, `website/docs/r/`, `docs/data-sources/`, and `docs/resources/` subdirectories will be converted to `tfplugindocs` templates. @@ -275,7 +281,7 @@ using the following data fields and functions: | `.RenderedProviderName` | string | Value provided via argument `--rendered-provider-name`, otherwise same as `.ProviderName` | | `.SchemaMarkdown` | string | a Markdown formatted Provider Schema definition | -##### Resources / Data Source Fields +##### Managed Resource / Ephemeral Resource / Data Source Fields | Field | Type | Description | |------------------------:|:------:|-------------------------------------------------------------------------------------------| diff --git a/cmd/tfplugindocs/testdata/scripts/provider-build/generate/framework_provider_success_generic_templates.txtar b/cmd/tfplugindocs/testdata/scripts/provider-build/generate/framework_provider_success_generic_templates.txtar index 3f6010cd..cf5f7b6a 100644 --- a/cmd/tfplugindocs/testdata/scripts/provider-build/generate/framework_provider_success_generic_templates.txtar +++ b/cmd/tfplugindocs/testdata/scripts/provider-build/generate/framework_provider_success_generic_templates.txtar @@ -26,6 +26,7 @@ resource "scaffolding_example" fallback template exists, creating template generating missing data source content data-source "scaffolding_example" fallback template exists, creating template generating missing function content +generating missing ephemeral resource content generating missing provider content provider "terraform-provider-scaffolding" template exists, skipping rendering static website diff --git a/cmd/tfplugindocs/testdata/scripts/provider-build/generate/framework_provider_success_named_templates.txtar b/cmd/tfplugindocs/testdata/scripts/provider-build/generate/framework_provider_success_named_templates.txtar index e4b3d497..a7354950 100644 --- a/cmd/tfplugindocs/testdata/scripts/provider-build/generate/framework_provider_success_named_templates.txtar +++ b/cmd/tfplugindocs/testdata/scripts/provider-build/generate/framework_provider_success_named_templates.txtar @@ -26,6 +26,7 @@ resource "scaffolding_example" template exists, skipping generating missing data source content data-source "scaffolding_example" template exists, skipping generating missing function content +generating missing ephemeral resource content generating missing provider content provider "terraform-provider-scaffolding" template exists, skipping rendering static website diff --git a/cmd/tfplugindocs/testdata/scripts/provider-build/generate/framework_provider_success_no_templates.txtar b/cmd/tfplugindocs/testdata/scripts/provider-build/generate/framework_provider_success_no_templates.txtar index 01e3829e..bb6e91cc 100644 --- a/cmd/tfplugindocs/testdata/scripts/provider-build/generate/framework_provider_success_no_templates.txtar +++ b/cmd/tfplugindocs/testdata/scripts/provider-build/generate/framework_provider_success_no_templates.txtar @@ -24,6 +24,7 @@ generating new template for "scaffolding_example" generating missing data source content generating new template for data-source "scaffolding_example" generating missing function content +generating missing ephemeral resource content generating missing provider content generating new template for "terraform-provider-scaffolding" rendering static website diff --git a/cmd/tfplugindocs/testdata/scripts/provider-build/generate/null_provider_success.txtar b/cmd/tfplugindocs/testdata/scripts/provider-build/generate/null_provider_success.txtar index 0c8fa4eb..263e85c4 100644 --- a/cmd/tfplugindocs/testdata/scripts/provider-build/generate/null_provider_success.txtar +++ b/cmd/tfplugindocs/testdata/scripts/provider-build/generate/null_provider_success.txtar @@ -23,6 +23,7 @@ resource "null_resource" fallback template exists, creating template generating missing data source content data-source "null_data_source" fallback template exists, creating template generating missing function content +generating missing ephemeral resource content generating missing provider content provider "terraform-provider-null" template exists, skipping rendering static website diff --git a/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_all_framework_types.txtar b/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_all_framework_types.txtar index 040d727b..b58019ee 100644 --- a/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_all_framework_types.txtar +++ b/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_all_framework_types.txtar @@ -19,6 +19,7 @@ generating new template for "scaffolding_example" generating missing data source content generating missing function content generating new template for function "scaffolding" +generating missing ephemeral resource content generating missing provider content generating new template for "terraform-provider-scaffolding" rendering static website diff --git a/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_generic_templates.txtar b/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_generic_templates.txtar index 187ea8b9..3984d4e7 100644 --- a/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_generic_templates.txtar +++ b/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_generic_templates.txtar @@ -10,6 +10,7 @@ cmpenv docs/index.md expected-index.md cmpenv docs/data-sources/example.md expected-datasource.md cmpenv docs/resources/example.md expected-resource.md cmpenv docs/functions/example.md expected-function.md +cmpenv docs/ephemeral-resources/example.md expected-ephemeral-resource.md -- expected-output.txt -- @@ -24,12 +25,15 @@ generating missing data source content data-source "scaffolding_example" fallback template exists, creating template generating missing function content function "example" fallback template exists, creating template +generating missing ephemeral resource content +ephemeral resource "scaffolding_example" fallback template exists, creating template generating missing provider content provider "terraform-provider-scaffolding" template exists, skipping rendering static website cleaning rendered website dir rendering templated website to static markdown rendering "data-sources/example.md.tmpl" +rendering "ephemeral-resources/example.md.tmpl" rendering "functions/example.md.tmpl" rendering "index.md.tmpl" rendering "resources/example.md.tmpl" @@ -239,6 +243,63 @@ Import is supported using the following syntax: terraform import scaffolding_example.example ``` +tffile: +## Example Usage + +```terraform +resource "scaffolding_example" "example" { + configurable_attribute = "some-value" +} +``` +-- expected-ephemeral-resource.md -- +# Data Fields + +Name: scaffolding_example +Type: Ephemeral Resource +Description: Example ephemeral resource +HasExample: true +ExampleFile: $WORK/examples/ephemeral-resources/scaffolding_example/ephemeral-resource.tf +HasImport: false +ProviderName: terraform-provider-scaffolding +ProviderShortName: scaffolding +RenderedProviderName: terraform-provider-scaffolding +SchemaMarkdown: +## Schema + +### Optional + +- `configurable_attribute` (String) Example configurable attribute +- `defaulted` (String) Example configurable attribute with default value + +### Read-Only + +- `id` (String) Example identifier + + + +# Functions + +lower: ephemeral resource +plainmarkdown: Ephemeral Resource +prefixlines: Prefix: Ephemeral Resource +split: [scaffolding example] +title: Ephemeral Resource +trimspace: Ephemeral Resource +upper: EPHEMERAL RESOURCE + +# Conditionals and File Functions + +printf codefile: + + +printf tffile: +## Example Usage + +{{tffile "$WORK/examples/ephemeral-resources/scaffolding_example/ephemeral-resource.tf"}} + +codefile: + + tffile: ## Example Usage @@ -438,6 +499,63 @@ tffile: {{ if .HasExample -}} ## Example Usage +{{tffile .ExampleFile }} +{{- end }} +-- templates/ephemeral-resources.md.tmpl -- +# Data Fields + +Name: {{.Name}} +Type: {{.Type}} +Description: {{.Description}} +HasExample: {{.HasExample}} +ExampleFile: {{.ExampleFile}} +HasImport: {{.HasImport}} +ProviderName: {{.ProviderName}} +ProviderShortName: {{.ProviderShortName}} +RenderedProviderName: {{.RenderedProviderName}} +SchemaMarkdown: {{.SchemaMarkdown}} + +# Functions + +lower: {{ .Type | lower }} +plainmarkdown: {{ .Type | plainmarkdown }} +prefixlines: {{ .Type | prefixlines "Prefix: " }} +split: {{ split .Name "_" }} +title: {{ .Type | title }} +trimspace: {{ .Type | trimspace }} +upper: {{ .Type | upper }} + +# Conditionals and File Functions + +printf codefile: +{{ if .HasImport -}} +## Import + +Import is supported using the following syntax: + +{{ printf "{{codefile \"shell\" %q}}" .ImportFile }} +{{- end }} + +printf tffile: +{{ if .HasExample -}} +## Example Usage + +{{ printf "{{tffile %q}}" .ExampleFile }} +{{- end }} + +codefile: +{{ if .HasImport -}} +## Import + +Import is supported using the following syntax: + +{{codefile "shell" .ImportFile }} +{{- end }} + +tffile: +{{ if .HasExample -}} +## Example Usage + {{tffile .ExampleFile }} {{- end }} -- examples/README.md -- @@ -468,98 +586,132 @@ resource "scaffolding_example" "example" { } -- examples/resources/scaffolding_example/import.sh -- terraform import scaffolding_example.example +-- examples/ephemeral-resources/scaffolding_example/ephemeral-resource.tf -- +resource "scaffolding_example" "example" { + configurable_attribute = "some-value" +} -- schema.json -- { - "format_version": "1.0", - "provider_schemas": { - "registry.terraform.io/hashicorp/scaffolding": { - "provider": { - "version": 0, - "block": { - "attributes": { - "endpoint": { - "type": "string", - "description": "Example provider attribute", - "description_kind": "markdown", - "optional": true - } - }, - "description": "Example provider", - "description_kind": "markdown" - } - }, - "resource_schemas": { - "scaffolding_example": { - "version": 0, - "block": { - "attributes": { - "configurable_attribute": { - "type": "string", - "description": "Example configurable attribute", - "description_kind": "markdown", - "optional": true - }, - "defaulted": { - "type": "string", - "description": "Example configurable attribute with default value", - "description_kind": "markdown", - "optional": true, - "computed": true - }, - "id": { - "type": "string", - "description": "Example identifier", - "description_kind": "markdown", - "computed": true - } + "format_version": "1.0", + "provider_schemas": { + "registry.terraform.io/hashicorp/scaffolding": { + "provider": { + "version": 0, + "block": { + "attributes": { + "endpoint": { + "type": "string", + "description": "Example provider attribute", + "description_kind": "markdown", + "optional": true + } + }, + "description": "Example provider", + "description_kind": "markdown" + } }, - "description": "Example resource", - "description_kind": "markdown" - } - } - }, - "data_source_schemas": { - "scaffolding_example": { - "version": 0, - "block": { - "attributes": { - "configurable_attribute": { - "type": "string", - "description": "Example configurable attribute", - "description_kind": "markdown", - "optional": true - }, - "id": { - "type": "string", - "description": "Example identifier", - "description_kind": "markdown", - "computed": true - } + "resource_schemas": { + "scaffolding_example": { + "version": 0, + "block": { + "attributes": { + "configurable_attribute": { + "type": "string", + "description": "Example configurable attribute", + "description_kind": "markdown", + "optional": true + }, + "defaulted": { + "type": "string", + "description": "Example configurable attribute with default value", + "description_kind": "markdown", + "optional": true, + "computed": true + }, + "id": { + "type": "string", + "description": "Example identifier", + "description_kind": "markdown", + "computed": true + } + }, + "description": "Example resource", + "description_kind": "markdown" + } + } }, - "description": "Example data source", - "description_kind": "markdown" - } - } - }, - "functions": { - "example": { - "description": "Given a string value, returns the same value.", - "summary": "Echo a string", - "return_type": "string", - "parameters": [ - { - "name": "input", - "description": "Value to echo.", - "type": "string" + "ephemeral_resource_schemas": { + "scaffolding_example": { + "version": 0, + "block": { + "attributes": { + "configurable_attribute": { + "type": "string", + "description": "Example configurable attribute", + "description_kind": "markdown", + "optional": true + }, + "defaulted": { + "type": "string", + "description": "Example configurable attribute with default value", + "description_kind": "markdown", + "optional": true, + "computed": true + }, + "id": { + "type": "string", + "description": "Example identifier", + "description_kind": "markdown", + "computed": true + } + }, + "description": "Example ephemeral resource", + "description_kind": "markdown" + } + } + }, + "data_source_schemas": { + "scaffolding_example": { + "version": 0, + "block": { + "attributes": { + "configurable_attribute": { + "type": "string", + "description": "Example configurable attribute", + "description_kind": "markdown", + "optional": true + }, + "id": { + "type": "string", + "description": "Example identifier", + "description_kind": "markdown", + "computed": true + } + }, + "description": "Example data source", + "description_kind": "markdown" + } + } + }, + "functions": { + "example": { + "description": "Given a string value, returns the same value.", + "summary": "Echo a string", + "return_type": "string", + "parameters": [ + { + "name": "input", + "description": "Value to echo.", + "type": "string" + } + ], + "variadic_parameter": { + "name": "variadicInput", + "description": "Variadic input to echo.", + "type": "string" + } + } } - ], - "variadic_parameter": { - "name": "variadicInput", - "description": "Variadic input to echo.", - "type": "string" - } } - } } - } } \ No newline at end of file diff --git a/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_legacy_docs.txtar b/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_legacy_docs.txtar index 03973af1..9d175252 100644 --- a/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_legacy_docs.txtar +++ b/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_legacy_docs.txtar @@ -22,6 +22,11 @@ cmp templates/functions/example.markdown docs/functions/example.markdown cmp templates/functions/example.html.markdown docs/functions/example.html.markdown cmp templates/functions/example.html.md docs/functions/example.html.md +cmp templates/ephemeral-resources/example.md docs/ephemeral-resources/example.md +cmp templates/ephemeral-resources/example.markdown docs/ephemeral-resources/example.markdown +cmp templates/ephemeral-resources/example.html.markdown docs/ephemeral-resources/example.html.markdown +cmp templates/ephemeral-resources/example.html.md docs/ephemeral-resources/example.html.md + cmp templates/index.md docs/index.md cmp templates/index.markdown docs/index.markdown cmp templates/index.html.markdown docs/index.html.markdown @@ -38,6 +43,8 @@ generating missing data source content data-source "scaffolding_example" static file exists, skipping generating missing function content function "example" static file exists, skipping +generating missing ephemeral resource content +ephemeral resource "scaffolding_example" static file exists, skipping generating missing provider content provider "terraform-provider-scaffolding" static file exists, skipping rendering static website @@ -47,6 +54,10 @@ copying non-template file: "d/example.html.markdown" copying non-template file: "d/example.html.md" copying non-template file: "d/example.markdown" copying non-template file: "d/example.md" +copying non-template file: "ephemeral-resources/example.html.markdown" +copying non-template file: "ephemeral-resources/example.html.md" +copying non-template file: "ephemeral-resources/example.markdown" +copying non-template file: "ephemeral-resources/example.md" copying non-template file: "functions/example.html.markdown" copying non-template file: "functions/example.html.md" copying non-template file: "functions/example.markdown" @@ -117,6 +128,26 @@ Type: {{.Type}} -- templates/functions/example.html.md -- # Data Fields +Name: {{.Name}} +Type: {{.Type}} +-- templates/ephemeral-resources/example.md -- +# Data Fields + +Name: {{.Name}} +Type: {{.Type}} +-- templates/ephemeral-resources/example.markdown -- +# Data Fields + +Name: {{.Name}} +Type: {{.Type}} +-- templates/ephemeral-resources/example.html.markdown -- +# Data Fields + +Name: {{.Name}} +Type: {{.Type}} +-- templates/ephemeral-resources/example.html.md -- +# Data Fields + Name: {{.Name}} Type: {{.Type}} -- templates/index.md -- @@ -161,100 +192,134 @@ provider "scaffolding" { resource "scaffolding_example" "example" { configurable_attribute = "some-value" } +-- examples/ephemeral-resources/scaffolding_example/ephemeral-resource.tf -- +resource "scaffolding_example" "example" { + configurable_attribute = "some-value" +} -- examples/resources/scaffolding_example/import.sh -- terraform import scaffolding_example.example -- schema.json -- { - "format_version": "1.0", - "provider_schemas": { - "registry.terraform.io/hashicorp/scaffolding": { - "provider": { - "version": 0, - "block": { - "attributes": { - "endpoint": { - "type": "string", - "description": "Example provider attribute", - "description_kind": "markdown", - "optional": true - } - }, - "description": "Example provider", - "description_kind": "markdown" - } - }, - "resource_schemas": { - "scaffolding_example": { - "version": 0, - "block": { - "attributes": { - "configurable_attribute": { - "type": "string", - "description": "Example configurable attribute", - "description_kind": "markdown", - "optional": true - }, - "defaulted": { - "type": "string", - "description": "Example configurable attribute with default value", - "description_kind": "markdown", - "optional": true, - "computed": true - }, - "id": { - "type": "string", - "description": "Example identifier", - "description_kind": "markdown", - "computed": true - } + "format_version": "1.0", + "provider_schemas": { + "registry.terraform.io/hashicorp/scaffolding": { + "provider": { + "version": 0, + "block": { + "attributes": { + "endpoint": { + "type": "string", + "description": "Example provider attribute", + "description_kind": "markdown", + "optional": true + } + }, + "description": "Example provider", + "description_kind": "markdown" + } }, - "description": "Example resource", - "description_kind": "markdown" - } - } - }, - "data_source_schemas": { - "scaffolding_example": { - "version": 0, - "block": { - "attributes": { - "configurable_attribute": { - "type": "string", - "description": "Example configurable attribute", - "description_kind": "markdown", - "optional": true - }, - "id": { - "type": "string", - "description": "Example identifier", - "description_kind": "markdown", - "computed": true - } + "resource_schemas": { + "scaffolding_example": { + "version": 0, + "block": { + "attributes": { + "configurable_attribute": { + "type": "string", + "description": "Example configurable attribute", + "description_kind": "markdown", + "optional": true + }, + "defaulted": { + "type": "string", + "description": "Example configurable attribute with default value", + "description_kind": "markdown", + "optional": true, + "computed": true + }, + "id": { + "type": "string", + "description": "Example identifier", + "description_kind": "markdown", + "computed": true + } + }, + "description": "Example resource", + "description_kind": "markdown" + } + } }, - "description": "Example data source", - "description_kind": "markdown" - } - } - }, - "functions": { - "example": { - "description": "Given a string value, returns the same value.", - "summary": "Echo a string", - "return_type": "string", - "parameters": [ - { - "name": "input", - "description": "Value to echo.", - "type": "string" + "ephemeral_resource_schemas": { + "scaffolding_example": { + "version": 0, + "block": { + "attributes": { + "configurable_attribute": { + "type": "string", + "description": "Example configurable attribute", + "description_kind": "markdown", + "optional": true + }, + "defaulted": { + "type": "string", + "description": "Example configurable attribute with default value", + "description_kind": "markdown", + "optional": true, + "computed": true + }, + "id": { + "type": "string", + "description": "Example identifier", + "description_kind": "markdown", + "computed": true + } + }, + "description": "Example ephemeral resource", + "description_kind": "markdown" + } + } + }, + "data_source_schemas": { + "scaffolding_example": { + "version": 0, + "block": { + "attributes": { + "configurable_attribute": { + "type": "string", + "description": "Example configurable attribute", + "description_kind": "markdown", + "optional": true + }, + "id": { + "type": "string", + "description": "Example identifier", + "description_kind": "markdown", + "computed": true + } + }, + "description": "Example data source", + "description_kind": "markdown" + } + } + }, + "functions": { + "example": { + "description": "Given a string value, returns the same value.", + "summary": "Echo a string", + "return_type": "string", + "parameters": [ + { + "name": "input", + "description": "Value to echo.", + "type": "string" + } + ], + "variadic_parameter": { + "name": "variadicInput", + "description": "Variadic input to echo.", + "type": "string" + } + } } - ], - "variadic_parameter": { - "name": "variadicInput", - "description": "Variadic input to echo.", - "type": "string" - } } - } } - } } \ No newline at end of file diff --git a/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_named_templates.txtar b/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_named_templates.txtar index 15680887..50d254eb 100644 --- a/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_named_templates.txtar +++ b/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_named_templates.txtar @@ -10,6 +10,7 @@ cmpenv docs/index.md expected-index.md cmpenv docs/data-sources/example.md expected-datasource.md cmpenv docs/resources/example.md expected-resource.md cmpenv docs/functions/example.md expected-function.md +cmpenv docs/ephemeral-resources/example.md expected-ephemeral-resource.md -- expected-output.txt -- rendering website for provider "terraform-provider-scaffolding" (as "terraform-provider-scaffolding") @@ -23,12 +24,15 @@ generating missing data source content data-source "scaffolding_example" template exists, skipping generating missing function content function "example" template exists, skipping +generating missing ephemeral resource content +ephemeral resource "scaffolding_example" template exists, skipping generating missing provider content provider "terraform-provider-scaffolding" template exists, skipping rendering static website cleaning rendered website dir rendering templated website to static markdown rendering "data-sources/example.md.tmpl" +rendering "ephemeral-resources/example.md.tmpl" rendering "functions/example.md.tmpl" rendering "index.md.tmpl" rendering "resources/example.md.tmpl" @@ -238,6 +242,63 @@ Import is supported using the following syntax: terraform import scaffolding_example.example ``` +tffile: +## Example Usage + +```terraform +resource "scaffolding_example" "example" { + configurable_attribute = "some-value" +} +``` +-- expected-ephemeral-resource.md -- +# Data Fields + +Name: scaffolding_example +Type: Ephemeral Resource +Description: Example ephemeral resource +HasExample: true +ExampleFile: $WORK/examples/ephemeral-resources/scaffolding_example/ephemeral-resource.tf +HasImport: false +ProviderName: terraform-provider-scaffolding +ProviderShortName: scaffolding +RenderedProviderName: terraform-provider-scaffolding +SchemaMarkdown: +## Schema + +### Optional + +- `configurable_attribute` (String) Example configurable attribute +- `defaulted` (String) Example configurable attribute with default value + +### Read-Only + +- `id` (String) Example identifier + + + +# Functions + +lower: ephemeral resource +plainmarkdown: Ephemeral Resource +prefixlines: Prefix: Ephemeral Resource +split: [scaffolding example] +title: Ephemeral Resource +trimspace: Ephemeral Resource +upper: EPHEMERAL RESOURCE + +# Conditionals and File Functions + +printf codefile: + + +printf tffile: +## Example Usage + +{{tffile "$WORK/examples/ephemeral-resources/scaffolding_example/ephemeral-resource.tf"}} + +codefile: + + tffile: ## Example Usage @@ -437,6 +498,63 @@ tffile: {{ if .HasExample -}} ## Example Usage +{{tffile .ExampleFile }} +{{- end }} +-- templates/ephemeral-resources/example.md.tmpl -- +# Data Fields + +Name: {{.Name}} +Type: {{.Type}} +Description: {{.Description}} +HasExample: {{.HasExample}} +ExampleFile: {{.ExampleFile}} +HasImport: {{.HasImport}} +ProviderName: {{.ProviderName}} +ProviderShortName: {{.ProviderShortName}} +RenderedProviderName: {{.RenderedProviderName}} +SchemaMarkdown: {{.SchemaMarkdown}} + +# Functions + +lower: {{ .Type | lower }} +plainmarkdown: {{ .Type | plainmarkdown }} +prefixlines: {{ .Type | prefixlines "Prefix: " }} +split: {{ split .Name "_" }} +title: {{ .Type | title }} +trimspace: {{ .Type | trimspace }} +upper: {{ .Type | upper }} + +# Conditionals and File Functions + +printf codefile: +{{ if .HasImport -}} +## Import + +Import is supported using the following syntax: + +{{ printf "{{codefile \"shell\" %q}}" .ImportFile }} +{{- end }} + +printf tffile: +{{ if .HasExample -}} +## Example Usage + +{{ printf "{{tffile %q}}" .ExampleFile }} +{{- end }} + +codefile: +{{ if .HasImport -}} +## Import + +Import is supported using the following syntax: + +{{codefile "shell" .ImportFile }} +{{- end }} + +tffile: +{{ if .HasExample -}} +## Example Usage + {{tffile .ExampleFile }} {{- end }} -- examples/README.md -- @@ -465,100 +583,134 @@ provider "scaffolding" { resource "scaffolding_example" "example" { configurable_attribute = "some-value" } +-- examples/ephemeral-resources/scaffolding_example/ephemeral-resource.tf -- +resource "scaffolding_example" "example" { + configurable_attribute = "some-value" +} -- examples/resources/scaffolding_example/import.sh -- terraform import scaffolding_example.example -- schema.json -- { - "format_version": "1.0", - "provider_schemas": { - "registry.terraform.io/hashicorp/scaffolding": { - "provider": { - "version": 0, - "block": { - "attributes": { - "endpoint": { - "type": "string", - "description": "Example provider attribute", - "description_kind": "markdown", - "optional": true - } - }, - "description": "Example provider", - "description_kind": "markdown" - } - }, - "resource_schemas": { - "scaffolding_example": { - "version": 0, - "block": { - "attributes": { - "configurable_attribute": { - "type": "string", - "description": "Example configurable attribute", - "description_kind": "markdown", - "optional": true - }, - "defaulted": { - "type": "string", - "description": "Example configurable attribute with default value", - "description_kind": "markdown", - "optional": true, - "computed": true - }, - "id": { - "type": "string", - "description": "Example identifier", - "description_kind": "markdown", - "computed": true - } + "format_version": "1.0", + "provider_schemas": { + "registry.terraform.io/hashicorp/scaffolding": { + "provider": { + "version": 0, + "block": { + "attributes": { + "endpoint": { + "type": "string", + "description": "Example provider attribute", + "description_kind": "markdown", + "optional": true + } + }, + "description": "Example provider", + "description_kind": "markdown" + } }, - "description": "Example resource", - "description_kind": "markdown" - } - } - }, - "data_source_schemas": { - "scaffolding_example": { - "version": 0, - "block": { - "attributes": { - "configurable_attribute": { - "type": "string", - "description": "Example configurable attribute", - "description_kind": "markdown", - "optional": true - }, - "id": { - "type": "string", - "description": "Example identifier", - "description_kind": "markdown", - "computed": true - } + "resource_schemas": { + "scaffolding_example": { + "version": 0, + "block": { + "attributes": { + "configurable_attribute": { + "type": "string", + "description": "Example configurable attribute", + "description_kind": "markdown", + "optional": true + }, + "defaulted": { + "type": "string", + "description": "Example configurable attribute with default value", + "description_kind": "markdown", + "optional": true, + "computed": true + }, + "id": { + "type": "string", + "description": "Example identifier", + "description_kind": "markdown", + "computed": true + } + }, + "description": "Example resource", + "description_kind": "markdown" + } + } }, - "description": "Example data source", - "description_kind": "markdown" - } - } - }, - "functions": { - "example": { - "description": "Given a string value, returns the same value.", - "summary": "Echo a string", - "return_type": "string", - "parameters": [ - { - "name": "input", - "description": "Value to echo.", - "type": "string" + "ephemeral_resource_schemas": { + "scaffolding_example": { + "version": 0, + "block": { + "attributes": { + "configurable_attribute": { + "type": "string", + "description": "Example configurable attribute", + "description_kind": "markdown", + "optional": true + }, + "defaulted": { + "type": "string", + "description": "Example configurable attribute with default value", + "description_kind": "markdown", + "optional": true, + "computed": true + }, + "id": { + "type": "string", + "description": "Example identifier", + "description_kind": "markdown", + "computed": true + } + }, + "description": "Example ephemeral resource", + "description_kind": "markdown" + } + } + }, + "data_source_schemas": { + "scaffolding_example": { + "version": 0, + "block": { + "attributes": { + "configurable_attribute": { + "type": "string", + "description": "Example configurable attribute", + "description_kind": "markdown", + "optional": true + }, + "id": { + "type": "string", + "description": "Example identifier", + "description_kind": "markdown", + "computed": true + } + }, + "description": "Example data source", + "description_kind": "markdown" + } + } + }, + "functions": { + "example": { + "description": "Given a string value, returns the same value.", + "summary": "Echo a string", + "return_type": "string", + "parameters": [ + { + "name": "input", + "description": "Value to echo.", + "type": "string" + } + ], + "variadic_parameter": { + "name": "variadicInput", + "description": "Variadic input to echo.", + "type": "string" + } + } } - ], - "variadic_parameter": { - "name": "variadicInput", - "description": "Variadic input to echo.", - "type": "string" - } } - } } - } } \ No newline at end of file diff --git a/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_no_templates.txtar b/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_no_templates.txtar index 8ac9b9ad..861b396e 100644 --- a/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_no_templates.txtar +++ b/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_no_templates.txtar @@ -9,6 +9,7 @@ cmp docs/index.md expected-index.md cmp docs/data-sources/example.md expected-datasource.md cmp docs/resources/example.md expected-resource.md cmp docs/functions/example.md expected-function.md +cmp docs/ephemeral-resources/example.md expected-ephemeral-resource.md -- expected-output.txt -- rendering website for provider "terraform-provider-scaffolding" (as "terraform-provider-scaffolding") @@ -21,12 +22,15 @@ generating missing data source content generating new template for data-source "scaffolding_example" generating missing function content generating new template for function "example" +generating missing ephemeral resource content +generating new template for "scaffolding_example" generating missing provider content generating new template for "terraform-provider-scaffolding" rendering static website cleaning rendered website dir rendering templated website to static markdown rendering "data-sources/example.md.tmpl" +rendering "ephemeral-resources/example.md.tmpl" rendering "functions/example.md.tmpl" rendering "index.md.tmpl" rendering "resources/example.md.tmpl" @@ -153,6 +157,38 @@ resource "scaffolding_example" "example" { ### Read-Only +- `id` (String) Example identifier +-- expected-ephemeral-resource.md -- +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "scaffolding_example Ephemeral Resource - terraform-provider-scaffolding" +subcategory: "" +description: |- + Example ephemeral resource +--- + +# scaffolding_example (Ephemeral Resource) + +Example ephemeral resource + +## Example Usage + +```terraform +resource "scaffolding_example" "example" { + configurable_attribute = "some-value" +} +``` + + +## Schema + +### Optional + +- `configurable_attribute` (String) Example configurable attribute +- `defaulted` (String) Example configurable attribute with default value + +### Read-Only + - `id` (String) Example identifier -- examples/README.md -- # Examples @@ -180,99 +216,133 @@ provider "scaffolding" { resource "scaffolding_example" "example" { configurable_attribute = "some-value" } +-- examples/ephemeral-resources/scaffolding_example/ephemeral-resource.tf -- +resource "scaffolding_example" "example" { + configurable_attribute = "some-value" +} -- schema.json -- { - "format_version": "1.0", - "provider_schemas": { - "registry.terraform.io/hashicorp/scaffolding": { - "provider": { - "version": 0, - "block": { - "attributes": { - "endpoint": { - "type": "string", - "description": "Example provider attribute", - "description_kind": "markdown", - "optional": true - } - }, - "description": "Example provider", - "description_kind": "markdown" - } - }, - "resource_schemas": { - "scaffolding_example": { - "version": 0, - "block": { - "attributes": { - "configurable_attribute": { - "type": "string", - "description": "Example configurable attribute", - "description_kind": "markdown", - "optional": true - }, - "defaulted": { - "type": "string", - "description": "Example configurable attribute with default value", - "description_kind": "markdown", - "optional": true, - "computed": true - }, - "id": { - "type": "string", - "description": "Example identifier", - "description_kind": "markdown", - "computed": true - } + "format_version": "1.0", + "provider_schemas": { + "registry.terraform.io/hashicorp/scaffolding": { + "provider": { + "version": 0, + "block": { + "attributes": { + "endpoint": { + "type": "string", + "description": "Example provider attribute", + "description_kind": "markdown", + "optional": true + } + }, + "description": "Example provider", + "description_kind": "markdown" + } }, - "description": "Example resource", - "description_kind": "markdown" - } - } - }, - "data_source_schemas": { - "scaffolding_example": { - "version": 0, - "block": { - "attributes": { - "configurable_attribute": { - "type": "string", - "description": "Example configurable attribute", - "description_kind": "markdown", - "optional": true - }, - "id": { - "type": "string", - "description": "Example identifier", - "description_kind": "markdown", - "computed": true - } + "resource_schemas": { + "scaffolding_example": { + "version": 0, + "block": { + "attributes": { + "configurable_attribute": { + "type": "string", + "description": "Example configurable attribute", + "description_kind": "markdown", + "optional": true + }, + "defaulted": { + "type": "string", + "description": "Example configurable attribute with default value", + "description_kind": "markdown", + "optional": true, + "computed": true + }, + "id": { + "type": "string", + "description": "Example identifier", + "description_kind": "markdown", + "computed": true + } + }, + "description": "Example resource", + "description_kind": "markdown" + } + } }, - "description": "Example data source", - "description_kind": "markdown" - } - } - }, - "functions": { - "example": { - "description": "Given a string value, returns the same value.", - "summary": "Echo a string", - "return_type": "string", - "parameters": [ - { - "name": "input", - "description": "Value to echo.", - "type": "string" + "ephemeral_resource_schemas": { + "scaffolding_example": { + "version": 0, + "block": { + "attributes": { + "configurable_attribute": { + "type": "string", + "description": "Example configurable attribute", + "description_kind": "markdown", + "optional": true + }, + "defaulted": { + "type": "string", + "description": "Example configurable attribute with default value", + "description_kind": "markdown", + "optional": true, + "computed": true + }, + "id": { + "type": "string", + "description": "Example identifier", + "description_kind": "markdown", + "computed": true + } + }, + "description": "Example ephemeral resource", + "description_kind": "markdown" + } + } + }, + "data_source_schemas": { + "scaffolding_example": { + "version": 0, + "block": { + "attributes": { + "configurable_attribute": { + "type": "string", + "description": "Example configurable attribute", + "description_kind": "markdown", + "optional": true + }, + "id": { + "type": "string", + "description": "Example identifier", + "description_kind": "markdown", + "computed": true + } + }, + "description": "Example data source", + "description_kind": "markdown" + } + } + }, + "functions": { + "example": { + "description": "Given a string value, returns the same value.", + "summary": "Echo a string", + "return_type": "string", + "parameters": [ + { + "name": "input", + "description": "Value to echo.", + "type": "string" + } + ], + "variadic_parameter": { + "name": "variadicInput", + "description": "Variadic input to echo.", + "type": "string" + } + } } - ], - "variadic_parameter": { - "name": "variadicInput", - "description": "Variadic input to echo.", - "type": "string" - } } - } } - } } \ No newline at end of file diff --git a/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_static_files.txtar b/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_static_files.txtar index bc0309b3..f37cdfc4 100644 --- a/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_static_files.txtar +++ b/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_static_files.txtar @@ -22,6 +22,11 @@ cmp templates/functions/example.markdown docs/functions/example.markdown cmp templates/functions/example.html.markdown docs/functions/example.html.markdown cmp templates/functions/example.html.md docs/functions/example.html.md +cmp templates/ephemeral-resources/example.md docs/ephemeral-resources/example.md +cmp templates/ephemeral-resources/example.markdown docs/ephemeral-resources/example.markdown +cmp templates/ephemeral-resources/example.html.markdown docs/ephemeral-resources/example.html.markdown +cmp templates/ephemeral-resources/example.html.md docs/ephemeral-resources/example.html.md + cmp templates/index.md docs/index.md cmp templates/index.markdown docs/index.markdown cmp templates/index.html.markdown docs/index.html.markdown @@ -38,6 +43,8 @@ generating missing data source content data-source "scaffolding_example" static file exists, skipping generating missing function content function "example" static file exists, skipping +generating missing ephemeral resource content +ephemeral resource "scaffolding_example" static file exists, skipping generating missing provider content provider "terraform-provider-scaffolding" static file exists, skipping rendering static website @@ -47,6 +54,10 @@ copying non-template file: "data-sources/example.html.markdown" copying non-template file: "data-sources/example.html.md" copying non-template file: "data-sources/example.markdown" copying non-template file: "data-sources/example.md" +copying non-template file: "ephemeral-resources/example.html.markdown" +copying non-template file: "ephemeral-resources/example.html.md" +copying non-template file: "ephemeral-resources/example.markdown" +copying non-template file: "ephemeral-resources/example.md" copying non-template file: "functions/example.html.markdown" copying non-template file: "functions/example.html.md" copying non-template file: "functions/example.markdown" @@ -117,6 +128,26 @@ Type: {{.Type}} -- templates/functions/example.html.md -- # Data Fields +Name: {{.Name}} +Type: {{.Type}} +-- templates/ephemeral-resources/example.md -- +# Data Fields + +Name: {{.Name}} +Type: {{.Type}} +-- templates/ephemeral-resources/example.markdown -- +# Data Fields + +Name: {{.Name}} +Type: {{.Type}} +-- templates/ephemeral-resources/example.html.markdown -- +# Data Fields + +Name: {{.Name}} +Type: {{.Type}} +-- templates/ephemeral-resources/example.html.md -- +# Data Fields + Name: {{.Name}} Type: {{.Type}} -- templates/index.md -- @@ -161,100 +192,134 @@ provider "scaffolding" { resource "scaffolding_example" "example" { configurable_attribute = "some-value" } +-- examples/ephemeral-resources/scaffolding_example/ephemeral-resource.tf -- +resource "scaffolding_example" "example" { + configurable_attribute = "some-value" +} -- examples/resources/scaffolding_example/import.sh -- terraform import scaffolding_example.example -- schema.json -- { - "format_version": "1.0", - "provider_schemas": { - "registry.terraform.io/hashicorp/scaffolding": { - "provider": { - "version": 0, - "block": { - "attributes": { - "endpoint": { - "type": "string", - "description": "Example provider attribute", - "description_kind": "markdown", - "optional": true - } - }, - "description": "Example provider", - "description_kind": "markdown" - } - }, - "resource_schemas": { - "scaffolding_example": { - "version": 0, - "block": { - "attributes": { - "configurable_attribute": { - "type": "string", - "description": "Example configurable attribute", - "description_kind": "markdown", - "optional": true - }, - "defaulted": { - "type": "string", - "description": "Example configurable attribute with default value", - "description_kind": "markdown", - "optional": true, - "computed": true - }, - "id": { - "type": "string", - "description": "Example identifier", - "description_kind": "markdown", - "computed": true - } + "format_version": "1.0", + "provider_schemas": { + "registry.terraform.io/hashicorp/scaffolding": { + "provider": { + "version": 0, + "block": { + "attributes": { + "endpoint": { + "type": "string", + "description": "Example provider attribute", + "description_kind": "markdown", + "optional": true + } + }, + "description": "Example provider", + "description_kind": "markdown" + } }, - "description": "Example resource", - "description_kind": "markdown" - } - } - }, - "data_source_schemas": { - "scaffolding_example": { - "version": 0, - "block": { - "attributes": { - "configurable_attribute": { - "type": "string", - "description": "Example configurable attribute", - "description_kind": "markdown", - "optional": true - }, - "id": { - "type": "string", - "description": "Example identifier", - "description_kind": "markdown", - "computed": true - } + "resource_schemas": { + "scaffolding_example": { + "version": 0, + "block": { + "attributes": { + "configurable_attribute": { + "type": "string", + "description": "Example configurable attribute", + "description_kind": "markdown", + "optional": true + }, + "defaulted": { + "type": "string", + "description": "Example configurable attribute with default value", + "description_kind": "markdown", + "optional": true, + "computed": true + }, + "id": { + "type": "string", + "description": "Example identifier", + "description_kind": "markdown", + "computed": true + } + }, + "description": "Example resource", + "description_kind": "markdown" + } + } }, - "description": "Example data source", - "description_kind": "markdown" - } - } - }, - "functions": { - "example": { - "description": "Given a string value, returns the same value.", - "summary": "Echo a string", - "return_type": "string", - "parameters": [ - { - "name": "input", - "description": "Value to echo.", - "type": "string" + "ephemeral_resource_schemas": { + "scaffolding_example": { + "version": 0, + "block": { + "attributes": { + "configurable_attribute": { + "type": "string", + "description": "Example configurable attribute", + "description_kind": "markdown", + "optional": true + }, + "defaulted": { + "type": "string", + "description": "Example configurable attribute with default value", + "description_kind": "markdown", + "optional": true, + "computed": true + }, + "id": { + "type": "string", + "description": "Example identifier", + "description_kind": "markdown", + "computed": true + } + }, + "description": "Example ephemeral resource", + "description_kind": "markdown" + } + } + }, + "data_source_schemas": { + "scaffolding_example": { + "version": 0, + "block": { + "attributes": { + "configurable_attribute": { + "type": "string", + "description": "Example configurable attribute", + "description_kind": "markdown", + "optional": true + }, + "id": { + "type": "string", + "description": "Example identifier", + "description_kind": "markdown", + "computed": true + } + }, + "description": "Example data source", + "description_kind": "markdown" + } + } + }, + "functions": { + "example": { + "description": "Given a string value, returns the same value.", + "summary": "Echo a string", + "return_type": "string", + "parameters": [ + { + "name": "input", + "description": "Value to echo.", + "type": "string" + } + ], + "variadic_parameter": { + "name": "variadicInput", + "description": "Variadic input to echo.", + "type": "string" + } + } } - ], - "variadic_parameter": { - "name": "variadicInput", - "description": "Variadic input to echo.", - "type": "string" - } } - } } - } } \ No newline at end of file diff --git a/cmd/tfplugindocs/testdata/scripts/schema-json/generate/nested_id_attribute.txtar b/cmd/tfplugindocs/testdata/scripts/schema-json/generate/nested_id_attribute.txtar index 943c54c8..21628fae 100644 --- a/cmd/tfplugindocs/testdata/scripts/schema-json/generate/nested_id_attribute.txtar +++ b/cmd/tfplugindocs/testdata/scripts/schema-json/generate/nested_id_attribute.txtar @@ -17,6 +17,7 @@ generating missing resource content generating new template for "scaffolding_example" generating missing data source content generating missing function content +generating missing ephemeral resource content generating missing provider content generating new template for "terraform-provider-scaffolding" rendering static website diff --git a/cmd/tfplugindocs/testdata/scripts/schema-json/generate/null_provider_success.txtar b/cmd/tfplugindocs/testdata/scripts/schema-json/generate/null_provider_success.txtar index 91597c24..e05ef443 100644 --- a/cmd/tfplugindocs/testdata/scripts/schema-json/generate/null_provider_success.txtar +++ b/cmd/tfplugindocs/testdata/scripts/schema-json/generate/null_provider_success.txtar @@ -18,6 +18,7 @@ resource "null_resource" fallback template exists, creating template generating missing data source content data-source "null_data_source" fallback template exists, creating template generating missing function content +generating missing ephemeral resource content generating missing provider content provider "terraform-provider-null" template exists, skipping rendering static website diff --git a/cmd/tfplugindocs/testdata/scripts/schema-json/migrate/time_provider_idempotency.txtar b/cmd/tfplugindocs/testdata/scripts/schema-json/migrate/time_provider_idempotency.txtar index f2d0dcb6..7427ef84 100644 --- a/cmd/tfplugindocs/testdata/scripts/schema-json/migrate/time_provider_idempotency.txtar +++ b/cmd/tfplugindocs/testdata/scripts/schema-json/migrate/time_provider_idempotency.txtar @@ -17,6 +17,7 @@ cmpenv templates/resources/offset.md.tmpl exp-templates/resources/offset.md.tmpl cmpenv templates/resources/rotating.md.tmpl exp-templates/resources/rotating.md.tmpl cmpenv templates/resources/sleep.md.tmpl exp-templates/resources/sleep.md.tmpl cmpenv templates/resources/static.md.tmpl exp-templates/resources/static.md.tmpl +cmpenv templates/ephemeral-resources/ephemeral_static.md.tmpl exp-templates/ephemeral-resources/ephemeral_static.md.tmpl # Check generated example files cmpenv examples/example_1.tf examples/example_1.tf @@ -37,13 +38,25 @@ cmpenv examples/resources/sleep/example_3.tf exp-examples/resources/sleep/exampl cmpenv examples/resources/sleep/import_1.sh exp-examples/resources/sleep/import_1.sh cmpenv examples/resources/sleep/import_2.sh exp-examples/resources/sleep/import_2.sh -cmpenv examples/resources/static/example_1.tf examples/resources/static/example_1.tf -cmpenv examples/resources/static/example_2.tf examples/resources/static/example_2.tf -cmpenv examples/resources/static/import_1.sh examples/resources/static/import_1.sh +cmpenv examples/resources/static/example_1.tf exp-examples/resources/static/example_1.tf +cmpenv examples/resources/static/example_2.tf exp-examples/resources/static/example_2.tf +cmpenv examples/resources/static/import_1.sh exp-examples/resources/static/import_1.sh + +cmpenv examples/ephemeral-resources/ephemeral_static/example_1.tf exp-examples/ephemeral-resources/ephemeral_static/example_1.tf +cmpenv examples/ephemeral-resources/ephemeral_static/example_2.tf exp-examples/ephemeral-resources/ephemeral_static/example_2.tf +cmpenv examples/ephemeral-resources/ephemeral_static/import_1.sh exp-examples/ephemeral-resources/ephemeral_static/import_1.sh -- expected-output.txt -- migrating website from "$WORK/docs" to "$WORK/templates" -migrating functons directory: functions +migrating ephemeral resources directory: ephemeral-resources +migrating file "ephemeral_static.html.markdown" +extracting YAML frontmatter to "$WORK/templates/ephemeral-resources/ephemeral_static.md.tmpl" +extracting code examples from "ephemeral_static.html.markdown" +creating example file "$WORK/examples/ephemeral-resources/ephemeral_static/example_1.tf" +creating example file "$WORK/examples/ephemeral-resources/ephemeral_static/example_2.tf" +creating import file "$WORK/examples/ephemeral-resources/ephemeral_static/import_1.sh" +finished creating template "$WORK/templates/ephemeral-resources/ephemeral_static.md.tmpl" +migrating functions directory: functions migrating file "rfc3339_parse.html.markdown" extracting YAML frontmatter to "$WORK/templates/functions/rfc3339_parse.md.tmpl" extracting code examples from "rfc3339_parse.html.markdown" @@ -516,6 +529,85 @@ This resource can be imported using the UTC RFC3339 value, e.g. $ terraform import time_static.example 2020-02-12T06:36:13Z ``` +The `triggers` argument cannot be imported. +-- docs/ephemeral-resources/ephemeral_static.html.markdown -- +--- +layout: "time" +page_title: "Time: time_ephemeral_static" +description: |- + Manages a static time resource. +--- + +# Resource: time_static + +Manages a static time resource, which keeps a locally sourced UTC timestamp stored in the Terraform state. This prevents perpetual differences caused by using the [`timestamp()` function](https://www.terraform.io/docs/configuration/functions/timestamp.html). + +-> Further manipulation of incoming or outgoing values can be accomplished with the [`formatdate()` function](https://www.terraform.io/docs/configuration/functions/formatdate.html) and the [`timeadd()` function](https://www.terraform.io/docs/configuration/functions/timeadd.html). + +## Example Usage + +### Basic Usage + +```hcl +resource "time_static" "example" {} + +output "current_time" { + value = time_static.example.rfc3339 +} +``` + +### Triggers Usage + +```hcl +resource "time_static" "ami_update" { + triggers = { + # Save the time each switch of an AMI id + ami_id = data.aws_ami.example.id + } +} + +resource "aws_instance" "server" { + # Read the AMI id "through" the time_static resource to ensure that + # both will change together. + ami = time_static.ami_update.triggers.ami_id + + tags = { + AmiUpdateTime = time_static.ami_update.rfc3339 + } + + # ... (other aws_instance arguments) ... +} +``` + +## Argument Reference + +The following arguments are optional: + +* `triggers` - (Optional) Arbitrary map of values that, when changed, will trigger a new base timestamp value to be saved. See [the main provider documentation](../index.html) for more information. +* `rfc3339` - (Optional) Configure the base timestamp with an UTC [RFC3339 time string](https://tools.ietf.org/html/rfc3339#section-5.8) (`YYYY-MM-DDTHH:MM:SSZ`). Defaults to the current time. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `day` - Number day of timestamp. +* `hour` - Number hour of timestamp. +* `id` - UTC RFC3339 timestamp format, e.g. `2020-02-12T06:36:13Z`. +* `minute` - Number minute of timestamp. +* `month` - Number month of timestamp. +* `rfc3339` - UTC RFC3339 format of timestamp, e.g. `2020-02-12T06:36:13Z`. +* `second` - Number second of timestamp. +* `unix` - Number of seconds since epoch time, e.g. `1581489373`. +* `year` - Number year of timestamp. + +## Import + +This resource can be imported using the UTC RFC3339 value, e.g. + +```console +$ terraform import time_static.example 2020-02-12T06:36:13Z +``` + The `triggers` argument cannot be imported. -- exp-examples/example_1.tf -- resource "time_static" "ami_update" { @@ -663,6 +755,33 @@ resource "aws_instance" "server" { } -- exp-examples/resources/static/import_1.sh -- $ terraform import time_static.example 2020-02-12T06:36:13Z +-- exp-examples/ephemeral-resources/ephemeral_static/example_1.tf -- +resource "time_static" "example" {} + +output "current_time" { + value = time_static.example.rfc3339 +} +-- exp-examples/ephemeral-resources/ephemeral_static/example_2.tf -- +resource "time_static" "ami_update" { + triggers = { + # Save the time each switch of an AMI id + ami_id = data.aws_ami.example.id + } +} + +resource "aws_instance" "server" { + # Read the AMI id "through" the time_static resource to ensure that + # both will change together. + ami = time_static.ami_update.triggers.ami_id + + tags = { + AmiUpdateTime = time_static.ami_update.rfc3339 + } + + # ... (other aws_instance arguments) ... +} +-- exp-examples/ephemeral-resources/ephemeral_static/import_1.sh -- +$ terraform import time_static.example 2020-02-12T06:36:13Z -- exp-templates/index.md.tmpl -- --- page_title: "Provider: Time" @@ -963,4 +1082,59 @@ This resource can be imported using the UTC RFC3339 value, e.g. {{codefile "shell" "examples/resources/static/import_1.sh"}} +The `triggers` argument cannot be imported. +-- exp-templates/ephemeral-resources/ephemeral_static.md.tmpl -- +--- +page_title: "Time: time_ephemeral_static" +description: |- + Manages a static time resource. +--- + +{{/* This template serves as a starting point for documentation generation, and can be customized with hardcoded values and/or doc gen templates. + +For example, the {{ .SchemaMarkdown }} template can be used to replace manual schema documentation if descriptions of schema attributes are added in the provider source code. */ -}} + +# Resource: time_static + +Manages a static time resource, which keeps a locally sourced UTC timestamp stored in the Terraform state. This prevents perpetual differences caused by using the [`timestamp()` function](https://www.terraform.io/docs/configuration/functions/timestamp.html). + +-> Further manipulation of incoming or outgoing values can be accomplished with the [`formatdate()` function](https://www.terraform.io/docs/configuration/functions/formatdate.html) and the [`timeadd()` function](https://www.terraform.io/docs/configuration/functions/timeadd.html). + +## Example Usage + +### Basic Usage + +{{tffile "examples/ephemeral-resources/ephemeral_static/example_1.tf"}} + +### Triggers Usage + +{{tffile "examples/ephemeral-resources/ephemeral_static/example_2.tf"}} + +## Argument Reference + +The following arguments are optional: + +* `triggers` - (Optional) Arbitrary map of values that, when changed, will trigger a new base timestamp value to be saved. See [the main provider documentation](../index.html) for more information. +* `rfc3339` - (Optional) Configure the base timestamp with an UTC [RFC3339 time string](https://tools.ietf.org/html/rfc3339#section-5.8) (`YYYY-MM-DDTHH:MM:SSZ`). Defaults to the current time. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `day` - Number day of timestamp. +* `hour` - Number hour of timestamp. +* `id` - UTC RFC3339 timestamp format, e.g. `2020-02-12T06:36:13Z`. +* `minute` - Number minute of timestamp. +* `month` - Number month of timestamp. +* `rfc3339` - UTC RFC3339 format of timestamp, e.g. `2020-02-12T06:36:13Z`. +* `second` - Number second of timestamp. +* `unix` - Number of seconds since epoch time, e.g. `1581489373`. +* `year` - Number year of timestamp. + +## Import + +This resource can be imported using the UTC RFC3339 value, e.g. + +{{codefile "shell" "examples/ephemeral-resources/ephemeral_static/import_1.sh"}} + The `triggers` argument cannot be imported. \ No newline at end of file diff --git a/cmd/tfplugindocs/testdata/scripts/schema-json/migrate/time_provider_success_docs_website.txtar b/cmd/tfplugindocs/testdata/scripts/schema-json/migrate/time_provider_success_docs_website.txtar index ea93de7c..6928f37a 100644 --- a/cmd/tfplugindocs/testdata/scripts/schema-json/migrate/time_provider_success_docs_website.txtar +++ b/cmd/tfplugindocs/testdata/scripts/schema-json/migrate/time_provider_success_docs_website.txtar @@ -15,6 +15,7 @@ cmpenv templates/resources/offset.md.tmpl exp-templates/resources/offset.md.tmpl cmpenv templates/resources/rotating.md.tmpl exp-templates/resources/rotating.md.tmpl cmpenv templates/resources/sleep.md.tmpl exp-templates/resources/sleep.md.tmpl cmpenv templates/resources/static.md.tmpl exp-templates/resources/static.md.tmpl +cmpenv templates/ephemeral-resources/ephemeral_static.md.tmpl exp-templates/ephemeral-resources/ephemeral_static.md.tmpl # Check generated example files cmpenv examples/example_1.tf examples/example_1.tf @@ -35,13 +36,25 @@ cmpenv examples/resources/sleep/example_3.tf exp-examples/resources/sleep/exampl cmpenv examples/resources/sleep/import_1.sh exp-examples/resources/sleep/import_1.sh cmpenv examples/resources/sleep/import_2.sh exp-examples/resources/sleep/import_2.sh -cmpenv examples/resources/static/example_1.tf examples/resources/static/example_1.tf -cmpenv examples/resources/static/example_2.tf examples/resources/static/example_2.tf -cmpenv examples/resources/static/import_1.sh examples/resources/static/import_1.sh +cmpenv examples/resources/static/example_1.tf exp-examples/resources/static/example_1.tf +cmpenv examples/resources/static/example_2.tf exp-examples/resources/static/example_2.tf +cmpenv examples/resources/static/import_1.sh exp-examples/resources/static/import_1.sh + +cmpenv examples/ephemeral-resources/ephemeral_static/example_1.tf exp-examples/ephemeral-resources/ephemeral_static/example_1.tf +cmpenv examples/ephemeral-resources/ephemeral_static/example_2.tf exp-examples/ephemeral-resources/ephemeral_static/example_2.tf +cmpenv examples/ephemeral-resources/ephemeral_static/import_1.sh exp-examples/ephemeral-resources/ephemeral_static/import_1.sh -- expected-output.txt -- migrating website from "$WORK/docs" to "$WORK/templates" -migrating functons directory: functions +migrating ephemeral resources directory: ephemeral-resources +migrating file "ephemeral_static.html.markdown" +extracting YAML frontmatter to "$WORK/templates/ephemeral-resources/ephemeral_static.md.tmpl" +extracting code examples from "ephemeral_static.html.markdown" +creating example file "$WORK/examples/ephemeral-resources/ephemeral_static/example_1.tf" +creating example file "$WORK/examples/ephemeral-resources/ephemeral_static/example_2.tf" +creating import file "$WORK/examples/ephemeral-resources/ephemeral_static/import_1.sh" +finished creating template "$WORK/templates/ephemeral-resources/ephemeral_static.md.tmpl" +migrating functions directory: functions migrating file "rfc3339_parse.html.markdown" extracting YAML frontmatter to "$WORK/templates/functions/rfc3339_parse.md.tmpl" extracting code examples from "rfc3339_parse.html.markdown" @@ -514,6 +527,85 @@ This resource can be imported using the UTC RFC3339 value, e.g. $ terraform import time_static.example 2020-02-12T06:36:13Z ``` +The `triggers` argument cannot be imported. +-- docs/ephemeral-resources/ephemeral_static.html.markdown -- +--- +layout: "time" +page_title: "Time: time_ephemeral_static" +description: |- + Manages a static time resource. +--- + +# Resource: time_static + +Manages a static time resource, which keeps a locally sourced UTC timestamp stored in the Terraform state. This prevents perpetual differences caused by using the [`timestamp()` function](https://www.terraform.io/docs/configuration/functions/timestamp.html). + +-> Further manipulation of incoming or outgoing values can be accomplished with the [`formatdate()` function](https://www.terraform.io/docs/configuration/functions/formatdate.html) and the [`timeadd()` function](https://www.terraform.io/docs/configuration/functions/timeadd.html). + +## Example Usage + +### Basic Usage + +```hcl +resource "time_static" "example" {} + +output "current_time" { + value = time_static.example.rfc3339 +} +``` + +### Triggers Usage + +```hcl +resource "time_static" "ami_update" { + triggers = { + # Save the time each switch of an AMI id + ami_id = data.aws_ami.example.id + } +} + +resource "aws_instance" "server" { + # Read the AMI id "through" the time_static resource to ensure that + # both will change together. + ami = time_static.ami_update.triggers.ami_id + + tags = { + AmiUpdateTime = time_static.ami_update.rfc3339 + } + + # ... (other aws_instance arguments) ... +} +``` + +## Argument Reference + +The following arguments are optional: + +* `triggers` - (Optional) Arbitrary map of values that, when changed, will trigger a new base timestamp value to be saved. See [the main provider documentation](../index.html) for more information. +* `rfc3339` - (Optional) Configure the base timestamp with an UTC [RFC3339 time string](https://tools.ietf.org/html/rfc3339#section-5.8) (`YYYY-MM-DDTHH:MM:SSZ`). Defaults to the current time. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `day` - Number day of timestamp. +* `hour` - Number hour of timestamp. +* `id` - UTC RFC3339 timestamp format, e.g. `2020-02-12T06:36:13Z`. +* `minute` - Number minute of timestamp. +* `month` - Number month of timestamp. +* `rfc3339` - UTC RFC3339 format of timestamp, e.g. `2020-02-12T06:36:13Z`. +* `second` - Number second of timestamp. +* `unix` - Number of seconds since epoch time, e.g. `1581489373`. +* `year` - Number year of timestamp. + +## Import + +This resource can be imported using the UTC RFC3339 value, e.g. + +```console +$ terraform import time_static.example 2020-02-12T06:36:13Z +``` + The `triggers` argument cannot be imported. -- exp-examples/example_1.tf -- resource "time_static" "ami_update" { @@ -661,6 +753,33 @@ resource "aws_instance" "server" { } -- exp-examples/resources/static/import_1.sh -- $ terraform import time_static.example 2020-02-12T06:36:13Z +-- exp-examples/ephemeral-resources/ephemeral_static/example_1.tf -- +resource "time_static" "example" {} + +output "current_time" { + value = time_static.example.rfc3339 +} +-- exp-examples/ephemeral-resources/ephemeral_static/example_2.tf -- +resource "time_static" "ami_update" { + triggers = { + # Save the time each switch of an AMI id + ami_id = data.aws_ami.example.id + } +} + +resource "aws_instance" "server" { + # Read the AMI id "through" the time_static resource to ensure that + # both will change together. + ami = time_static.ami_update.triggers.ami_id + + tags = { + AmiUpdateTime = time_static.ami_update.rfc3339 + } + + # ... (other aws_instance arguments) ... +} +-- exp-examples/ephemeral-resources/ephemeral_static/import_1.sh -- +$ terraform import time_static.example 2020-02-12T06:36:13Z -- exp-templates/index.md.tmpl -- --- page_title: "Provider: Time" @@ -961,4 +1080,59 @@ This resource can be imported using the UTC RFC3339 value, e.g. {{codefile "shell" "examples/resources/static/import_1.sh"}} +The `triggers` argument cannot be imported. +-- exp-templates/ephemeral-resources/ephemeral_static.md.tmpl -- +--- +page_title: "Time: time_ephemeral_static" +description: |- + Manages a static time resource. +--- + +{{/* This template serves as a starting point for documentation generation, and can be customized with hardcoded values and/or doc gen templates. + +For example, the {{ .SchemaMarkdown }} template can be used to replace manual schema documentation if descriptions of schema attributes are added in the provider source code. */ -}} + +# Resource: time_static + +Manages a static time resource, which keeps a locally sourced UTC timestamp stored in the Terraform state. This prevents perpetual differences caused by using the [`timestamp()` function](https://www.terraform.io/docs/configuration/functions/timestamp.html). + +-> Further manipulation of incoming or outgoing values can be accomplished with the [`formatdate()` function](https://www.terraform.io/docs/configuration/functions/formatdate.html) and the [`timeadd()` function](https://www.terraform.io/docs/configuration/functions/timeadd.html). + +## Example Usage + +### Basic Usage + +{{tffile "examples/ephemeral-resources/ephemeral_static/example_1.tf"}} + +### Triggers Usage + +{{tffile "examples/ephemeral-resources/ephemeral_static/example_2.tf"}} + +## Argument Reference + +The following arguments are optional: + +* `triggers` - (Optional) Arbitrary map of values that, when changed, will trigger a new base timestamp value to be saved. See [the main provider documentation](../index.html) for more information. +* `rfc3339` - (Optional) Configure the base timestamp with an UTC [RFC3339 time string](https://tools.ietf.org/html/rfc3339#section-5.8) (`YYYY-MM-DDTHH:MM:SSZ`). Defaults to the current time. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `day` - Number day of timestamp. +* `hour` - Number hour of timestamp. +* `id` - UTC RFC3339 timestamp format, e.g. `2020-02-12T06:36:13Z`. +* `minute` - Number minute of timestamp. +* `month` - Number month of timestamp. +* `rfc3339` - UTC RFC3339 format of timestamp, e.g. `2020-02-12T06:36:13Z`. +* `second` - Number second of timestamp. +* `unix` - Number of seconds since epoch time, e.g. `1581489373`. +* `year` - Number year of timestamp. + +## Import + +This resource can be imported using the UTC RFC3339 value, e.g. + +{{codefile "shell" "examples/ephemeral-resources/ephemeral_static/import_1.sh"}} + The `triggers` argument cannot be imported. \ No newline at end of file diff --git a/cmd/tfplugindocs/testdata/scripts/schema-json/migrate/time_provider_success_docs_website_with_prefix.txtar b/cmd/tfplugindocs/testdata/scripts/schema-json/migrate/time_provider_success_docs_website_with_prefix.txtar index 0192624b..11704c44 100644 --- a/cmd/tfplugindocs/testdata/scripts/schema-json/migrate/time_provider_success_docs_website_with_prefix.txtar +++ b/cmd/tfplugindocs/testdata/scripts/schema-json/migrate/time_provider_success_docs_website_with_prefix.txtar @@ -15,6 +15,7 @@ cmpenv templates/resources/offset.md.tmpl exp-templates/resources/offset.md.tmpl cmpenv templates/resources/rotating.md.tmpl exp-templates/resources/rotating.md.tmpl cmpenv templates/resources/sleep.md.tmpl exp-templates/resources/sleep.md.tmpl cmpenv templates/resources/static.md.tmpl exp-templates/resources/static.md.tmpl +cmpenv templates/ephemeral-resources/ephemeral_static.md.tmpl exp-templates/ephemeral-resources/ephemeral_static.md.tmpl # Check generated example files cmpenv examples/example_1.tf examples/example_1.tf @@ -35,13 +36,25 @@ cmpenv examples/resources/sleep/example_3.tf exp-examples/resources/sleep/exampl cmpenv examples/resources/sleep/import_1.sh exp-examples/resources/sleep/import_1.sh cmpenv examples/resources/sleep/import_2.sh exp-examples/resources/sleep/import_2.sh -cmpenv examples/resources/static/example_1.tf examples/resources/static/example_1.tf -cmpenv examples/resources/static/example_2.tf examples/resources/static/example_2.tf -cmpenv examples/resources/static/import_1.sh examples/resources/static/import_1.sh +cmpenv examples/resources/static/example_1.tf exp-examples/resources/static/example_1.tf +cmpenv examples/resources/static/example_2.tf exp-examples/resources/static/example_2.tf +cmpenv examples/resources/static/import_1.sh exp-examples/resources/static/import_1.sh + +cmpenv examples/ephemeral-resources/ephemeral_static/example_1.tf exp-examples/ephemeral-resources/ephemeral_static/example_1.tf +cmpenv examples/ephemeral-resources/ephemeral_static/example_2.tf exp-examples/ephemeral-resources/ephemeral_static/example_2.tf +cmpenv examples/ephemeral-resources/ephemeral_static/import_1.sh exp-examples/ephemeral-resources/ephemeral_static/import_1.sh -- expected-output.txt -- migrating website from "$WORK/docs" to "$WORK/templates" -migrating functons directory: functions +migrating ephemeral resources directory: ephemeral-resources +migrating file "time_ephemeral_static.html.markdown" +extracting YAML frontmatter to "$WORK/templates/ephemeral-resources/ephemeral_static.md.tmpl" +extracting code examples from "time_ephemeral_static.html.markdown" +creating example file "$WORK/examples/ephemeral-resources/ephemeral_static/example_1.tf" +creating example file "$WORK/examples/ephemeral-resources/ephemeral_static/example_2.tf" +creating import file "$WORK/examples/ephemeral-resources/ephemeral_static/import_1.sh" +finished creating template "$WORK/templates/ephemeral-resources/ephemeral_static.md.tmpl" +migrating functions directory: functions migrating file "time_rfc3339_parse.html.markdown" extracting YAML frontmatter to "$WORK/templates/functions/rfc3339_parse.md.tmpl" extracting code examples from "time_rfc3339_parse.html.markdown" @@ -514,6 +527,85 @@ This resource can be imported using the UTC RFC3339 value, e.g. $ terraform import time_static.example 2020-02-12T06:36:13Z ``` +The `triggers` argument cannot be imported. +-- docs/ephemeral-resources/time_ephemeral_static.html.markdown -- +--- +layout: "time" +page_title: "Time: time_ephemeral_static" +description: |- + Manages a static time resource. +--- + +# Resource: time_static + +Manages a static time resource, which keeps a locally sourced UTC timestamp stored in the Terraform state. This prevents perpetual differences caused by using the [`timestamp()` function](https://www.terraform.io/docs/configuration/functions/timestamp.html). + +-> Further manipulation of incoming or outgoing values can be accomplished with the [`formatdate()` function](https://www.terraform.io/docs/configuration/functions/formatdate.html) and the [`timeadd()` function](https://www.terraform.io/docs/configuration/functions/timeadd.html). + +## Example Usage + +### Basic Usage + +```hcl +resource "time_static" "example" {} + +output "current_time" { + value = time_static.example.rfc3339 +} +``` + +### Triggers Usage + +```hcl +resource "time_static" "ami_update" { + triggers = { + # Save the time each switch of an AMI id + ami_id = data.aws_ami.example.id + } +} + +resource "aws_instance" "server" { + # Read the AMI id "through" the time_static resource to ensure that + # both will change together. + ami = time_static.ami_update.triggers.ami_id + + tags = { + AmiUpdateTime = time_static.ami_update.rfc3339 + } + + # ... (other aws_instance arguments) ... +} +``` + +## Argument Reference + +The following arguments are optional: + +* `triggers` - (Optional) Arbitrary map of values that, when changed, will trigger a new base timestamp value to be saved. See [the main provider documentation](../index.html) for more information. +* `rfc3339` - (Optional) Configure the base timestamp with an UTC [RFC3339 time string](https://tools.ietf.org/html/rfc3339#section-5.8) (`YYYY-MM-DDTHH:MM:SSZ`). Defaults to the current time. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `day` - Number day of timestamp. +* `hour` - Number hour of timestamp. +* `id` - UTC RFC3339 timestamp format, e.g. `2020-02-12T06:36:13Z`. +* `minute` - Number minute of timestamp. +* `month` - Number month of timestamp. +* `rfc3339` - UTC RFC3339 format of timestamp, e.g. `2020-02-12T06:36:13Z`. +* `second` - Number second of timestamp. +* `unix` - Number of seconds since epoch time, e.g. `1581489373`. +* `year` - Number year of timestamp. + +## Import + +This resource can be imported using the UTC RFC3339 value, e.g. + +```console +$ terraform import time_static.example 2020-02-12T06:36:13Z +``` + The `triggers` argument cannot be imported. -- exp-examples/example_1.tf -- resource "time_static" "ami_update" { @@ -661,6 +753,33 @@ resource "aws_instance" "server" { } -- exp-examples/resources/static/import_1.sh -- $ terraform import time_static.example 2020-02-12T06:36:13Z +-- exp-examples/ephemeral-resources/ephemeral_static/example_1.tf -- +resource "time_static" "example" {} + +output "current_time" { + value = time_static.example.rfc3339 +} +-- exp-examples/ephemeral-resources/ephemeral_static/example_2.tf -- +resource "time_static" "ami_update" { + triggers = { + # Save the time each switch of an AMI id + ami_id = data.aws_ami.example.id + } +} + +resource "aws_instance" "server" { + # Read the AMI id "through" the time_static resource to ensure that + # both will change together. + ami = time_static.ami_update.triggers.ami_id + + tags = { + AmiUpdateTime = time_static.ami_update.rfc3339 + } + + # ... (other aws_instance arguments) ... +} +-- exp-examples/ephemeral-resources/ephemeral_static/import_1.sh -- +$ terraform import time_static.example 2020-02-12T06:36:13Z -- exp-templates/index.md.tmpl -- --- page_title: "Provider: Time" @@ -961,4 +1080,59 @@ This resource can be imported using the UTC RFC3339 value, e.g. {{codefile "shell" "examples/resources/static/import_1.sh"}} +The `triggers` argument cannot be imported. +-- exp-templates/ephemeral-resources/ephemeral_static.md.tmpl -- +--- +page_title: "Time: time_ephemeral_static" +description: |- + Manages a static time resource. +--- + +{{/* This template serves as a starting point for documentation generation, and can be customized with hardcoded values and/or doc gen templates. + +For example, the {{ .SchemaMarkdown }} template can be used to replace manual schema documentation if descriptions of schema attributes are added in the provider source code. */ -}} + +# Resource: time_static + +Manages a static time resource, which keeps a locally sourced UTC timestamp stored in the Terraform state. This prevents perpetual differences caused by using the [`timestamp()` function](https://www.terraform.io/docs/configuration/functions/timestamp.html). + +-> Further manipulation of incoming or outgoing values can be accomplished with the [`formatdate()` function](https://www.terraform.io/docs/configuration/functions/formatdate.html) and the [`timeadd()` function](https://www.terraform.io/docs/configuration/functions/timeadd.html). + +## Example Usage + +### Basic Usage + +{{tffile "examples/ephemeral-resources/ephemeral_static/example_1.tf"}} + +### Triggers Usage + +{{tffile "examples/ephemeral-resources/ephemeral_static/example_2.tf"}} + +## Argument Reference + +The following arguments are optional: + +* `triggers` - (Optional) Arbitrary map of values that, when changed, will trigger a new base timestamp value to be saved. See [the main provider documentation](../index.html) for more information. +* `rfc3339` - (Optional) Configure the base timestamp with an UTC [RFC3339 time string](https://tools.ietf.org/html/rfc3339#section-5.8) (`YYYY-MM-DDTHH:MM:SSZ`). Defaults to the current time. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `day` - Number day of timestamp. +* `hour` - Number hour of timestamp. +* `id` - UTC RFC3339 timestamp format, e.g. `2020-02-12T06:36:13Z`. +* `minute` - Number minute of timestamp. +* `month` - Number month of timestamp. +* `rfc3339` - UTC RFC3339 format of timestamp, e.g. `2020-02-12T06:36:13Z`. +* `second` - Number second of timestamp. +* `unix` - Number of seconds since epoch time, e.g. `1581489373`. +* `year` - Number year of timestamp. + +## Import + +This resource can be imported using the UTC RFC3339 value, e.g. + +{{codefile "shell" "examples/ephemeral-resources/ephemeral_static/import_1.sh"}} + The `triggers` argument cannot be imported. \ No newline at end of file diff --git a/cmd/tfplugindocs/testdata/scripts/schema-json/migrate/time_provider_success_legacy_website.txtar b/cmd/tfplugindocs/testdata/scripts/schema-json/migrate/time_provider_success_legacy_website.txtar index 736e2d3b..1b067803 100644 --- a/cmd/tfplugindocs/testdata/scripts/schema-json/migrate/time_provider_success_legacy_website.txtar +++ b/cmd/tfplugindocs/testdata/scripts/schema-json/migrate/time_provider_success_legacy_website.txtar @@ -15,6 +15,7 @@ cmpenv templates/resources/offset.md.tmpl exp-templates/resources/offset.md.tmpl cmpenv templates/resources/rotating.md.tmpl exp-templates/resources/rotating.md.tmpl cmpenv templates/resources/sleep.md.tmpl exp-templates/resources/sleep.md.tmpl cmpenv templates/resources/static.md.tmpl exp-templates/resources/static.md.tmpl +cmpenv templates/ephemeral-resources/ephemeral_static.md.tmpl exp-templates/ephemeral-resources/ephemeral_static.md.tmpl # Check generated example files cmpenv examples/example_1.tf examples/example_1.tf @@ -35,16 +36,28 @@ cmpenv examples/resources/sleep/example_3.tf exp-examples/resources/sleep/exampl cmpenv examples/resources/sleep/import_1.sh exp-examples/resources/sleep/import_1.sh cmpenv examples/resources/sleep/import_2.sh exp-examples/resources/sleep/import_2.sh -cmpenv examples/resources/static/example_1.tf examples/resources/static/example_1.tf -cmpenv examples/resources/static/example_2.tf examples/resources/static/example_2.tf -cmpenv examples/resources/static/import_1.sh examples/resources/static/import_1.sh +cmpenv examples/resources/static/example_1.tf exp-examples/resources/static/example_1.tf +cmpenv examples/resources/static/example_2.tf exp-examples/resources/static/example_2.tf +cmpenv examples/resources/static/import_1.sh exp-examples/resources/static/import_1.sh + +cmpenv examples/ephemeral-resources/ephemeral_static/example_1.tf exp-examples/ephemeral-resources/ephemeral_static/example_1.tf +cmpenv examples/ephemeral-resources/ephemeral_static/example_2.tf exp-examples/ephemeral-resources/ephemeral_static/example_2.tf +cmpenv examples/ephemeral-resources/ephemeral_static/import_1.sh exp-examples/ephemeral-resources/ephemeral_static/import_1.sh # Verify legacy website directory is removed ! exists website/ -- expected-output.txt -- migrating website from "$WORK/website/docs" to "$WORK/templates" -migrating functons directory: functions +migrating ephemeral resources directory: ephemeral-resources +migrating file "ephemeral_static.html.markdown" +extracting YAML frontmatter to "$WORK/templates/ephemeral-resources/ephemeral_static.md.tmpl" +extracting code examples from "ephemeral_static.html.markdown" +creating example file "$WORK/examples/ephemeral-resources/ephemeral_static/example_1.tf" +creating example file "$WORK/examples/ephemeral-resources/ephemeral_static/example_2.tf" +creating import file "$WORK/examples/ephemeral-resources/ephemeral_static/import_1.sh" +finished creating template "$WORK/templates/ephemeral-resources/ephemeral_static.md.tmpl" +migrating functions directory: functions migrating file "rfc3339_parse.html.markdown" extracting YAML frontmatter to "$WORK/templates/functions/rfc3339_parse.md.tmpl" extracting code examples from "rfc3339_parse.html.markdown" @@ -518,7 +531,85 @@ $ terraform import time_static.example 2020-02-12T06:36:13Z ``` The `triggers` argument cannot be imported. +-- website/docs/ephemeral-resources/ephemeral_static.html.markdown -- +--- +layout: "time" +page_title: "Time: time_ephemeral_static" +description: |- + Manages a static time resource. +--- + +# Resource: time_static + +Manages a static time resource, which keeps a locally sourced UTC timestamp stored in the Terraform state. This prevents perpetual differences caused by using the [`timestamp()` function](https://www.terraform.io/docs/configuration/functions/timestamp.html). + +-> Further manipulation of incoming or outgoing values can be accomplished with the [`formatdate()` function](https://www.terraform.io/docs/configuration/functions/formatdate.html) and the [`timeadd()` function](https://www.terraform.io/docs/configuration/functions/timeadd.html). + +## Example Usage + +### Basic Usage + +```hcl +resource "time_static" "example" {} + +output "current_time" { + value = time_static.example.rfc3339 +} +``` + +### Triggers Usage + +```hcl +resource "time_static" "ami_update" { + triggers = { + # Save the time each switch of an AMI id + ami_id = data.aws_ami.example.id + } +} + +resource "aws_instance" "server" { + # Read the AMI id "through" the time_static resource to ensure that + # both will change together. + ami = time_static.ami_update.triggers.ami_id + + tags = { + AmiUpdateTime = time_static.ami_update.rfc3339 + } + + # ... (other aws_instance arguments) ... +} +``` + +## Argument Reference + +The following arguments are optional: + +* `triggers` - (Optional) Arbitrary map of values that, when changed, will trigger a new base timestamp value to be saved. See [the main provider documentation](../index.html) for more information. +* `rfc3339` - (Optional) Configure the base timestamp with an UTC [RFC3339 time string](https://tools.ietf.org/html/rfc3339#section-5.8) (`YYYY-MM-DDTHH:MM:SSZ`). Defaults to the current time. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `day` - Number day of timestamp. +* `hour` - Number hour of timestamp. +* `id` - UTC RFC3339 timestamp format, e.g. `2020-02-12T06:36:13Z`. +* `minute` - Number minute of timestamp. +* `month` - Number month of timestamp. +* `rfc3339` - UTC RFC3339 format of timestamp, e.g. `2020-02-12T06:36:13Z`. +* `second` - Number second of timestamp. +* `unix` - Number of seconds since epoch time, e.g. `1581489373`. +* `year` - Number year of timestamp. + +## Import + +This resource can be imported using the UTC RFC3339 value, e.g. + +```console +$ terraform import time_static.example 2020-02-12T06:36:13Z +``` +The `triggers` argument cannot be imported. -- exp-examples/example_1.tf -- resource "time_static" "ami_update" { triggers = { @@ -665,6 +756,33 @@ resource "aws_instance" "server" { } -- exp-examples/resources/static/import_1.sh -- $ terraform import time_static.example 2020-02-12T06:36:13Z +-- exp-examples/ephemeral-resources/ephemeral_static/example_1.tf -- +resource "time_static" "example" {} + +output "current_time" { + value = time_static.example.rfc3339 +} +-- exp-examples/ephemeral-resources/ephemeral_static/example_2.tf -- +resource "time_static" "ami_update" { + triggers = { + # Save the time each switch of an AMI id + ami_id = data.aws_ami.example.id + } +} + +resource "aws_instance" "server" { + # Read the AMI id "through" the time_static resource to ensure that + # both will change together. + ami = time_static.ami_update.triggers.ami_id + + tags = { + AmiUpdateTime = time_static.ami_update.rfc3339 + } + + # ... (other aws_instance arguments) ... +} +-- exp-examples/ephemeral-resources/ephemeral_static/import_1.sh -- +$ terraform import time_static.example 2020-02-12T06:36:13Z -- exp-templates/index.md.tmpl -- --- page_title: "Provider: Time" @@ -965,4 +1083,59 @@ This resource can be imported using the UTC RFC3339 value, e.g. {{codefile "shell" "examples/resources/static/import_1.sh"}} +The `triggers` argument cannot be imported. +-- exp-templates/ephemeral-resources/ephemeral_static.md.tmpl -- +--- +page_title: "Time: time_ephemeral_static" +description: |- + Manages a static time resource. +--- + +{{/* This template serves as a starting point for documentation generation, and can be customized with hardcoded values and/or doc gen templates. + +For example, the {{ .SchemaMarkdown }} template can be used to replace manual schema documentation if descriptions of schema attributes are added in the provider source code. */ -}} + +# Resource: time_static + +Manages a static time resource, which keeps a locally sourced UTC timestamp stored in the Terraform state. This prevents perpetual differences caused by using the [`timestamp()` function](https://www.terraform.io/docs/configuration/functions/timestamp.html). + +-> Further manipulation of incoming or outgoing values can be accomplished with the [`formatdate()` function](https://www.terraform.io/docs/configuration/functions/formatdate.html) and the [`timeadd()` function](https://www.terraform.io/docs/configuration/functions/timeadd.html). + +## Example Usage + +### Basic Usage + +{{tffile "examples/ephemeral-resources/ephemeral_static/example_1.tf"}} + +### Triggers Usage + +{{tffile "examples/ephemeral-resources/ephemeral_static/example_2.tf"}} + +## Argument Reference + +The following arguments are optional: + +* `triggers` - (Optional) Arbitrary map of values that, when changed, will trigger a new base timestamp value to be saved. See [the main provider documentation](../index.html) for more information. +* `rfc3339` - (Optional) Configure the base timestamp with an UTC [RFC3339 time string](https://tools.ietf.org/html/rfc3339#section-5.8) (`YYYY-MM-DDTHH:MM:SSZ`). Defaults to the current time. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `day` - Number day of timestamp. +* `hour` - Number hour of timestamp. +* `id` - UTC RFC3339 timestamp format, e.g. `2020-02-12T06:36:13Z`. +* `minute` - Number minute of timestamp. +* `month` - Number month of timestamp. +* `rfc3339` - UTC RFC3339 format of timestamp, e.g. `2020-02-12T06:36:13Z`. +* `second` - Number second of timestamp. +* `unix` - Number of seconds since epoch time, e.g. `1581489373`. +* `year` - Number year of timestamp. + +## Import + +This resource can be imported using the UTC RFC3339 value, e.g. + +{{codefile "shell" "examples/ephemeral-resources/ephemeral_static/import_1.sh"}} + The `triggers` argument cannot be imported. \ No newline at end of file diff --git a/cmd/tfplugindocs/testdata/scripts/schema-json/migrate/time_provider_success_legacy_website_with_prefix.txtar b/cmd/tfplugindocs/testdata/scripts/schema-json/migrate/time_provider_success_legacy_website_with_prefix.txtar index 75f93373..e1ce2305 100644 --- a/cmd/tfplugindocs/testdata/scripts/schema-json/migrate/time_provider_success_legacy_website_with_prefix.txtar +++ b/cmd/tfplugindocs/testdata/scripts/schema-json/migrate/time_provider_success_legacy_website_with_prefix.txtar @@ -15,6 +15,7 @@ cmpenv templates/resources/offset.md.tmpl exp-templates/resources/offset.md.tmpl cmpenv templates/resources/rotating.md.tmpl exp-templates/resources/rotating.md.tmpl cmpenv templates/resources/sleep.md.tmpl exp-templates/resources/sleep.md.tmpl cmpenv templates/resources/static.md.tmpl exp-templates/resources/static.md.tmpl +cmpenv templates/ephemeral-resources/ephemeral_static.md.tmpl exp-templates/ephemeral-resources/ephemeral_static.md.tmpl # Check generated example files cmpenv examples/example_1.tf examples/example_1.tf @@ -35,16 +36,28 @@ cmpenv examples/resources/sleep/example_3.tf exp-examples/resources/sleep/exampl cmpenv examples/resources/sleep/import_1.sh exp-examples/resources/sleep/import_1.sh cmpenv examples/resources/sleep/import_2.sh exp-examples/resources/sleep/import_2.sh -cmpenv examples/resources/static/example_1.tf examples/resources/static/example_1.tf -cmpenv examples/resources/static/example_2.tf examples/resources/static/example_2.tf -cmpenv examples/resources/static/import_1.sh examples/resources/static/import_1.sh +cmpenv examples/resources/static/example_1.tf exp-examples/resources/static/example_1.tf +cmpenv examples/resources/static/example_2.tf exp-examples/resources/static/example_2.tf +cmpenv examples/resources/static/import_1.sh exp-examples/resources/static/import_1.sh + +cmpenv examples/ephemeral-resources/ephemeral_static/example_1.tf exp-examples/ephemeral-resources/ephemeral_static/example_1.tf +cmpenv examples/ephemeral-resources/ephemeral_static/example_2.tf exp-examples/ephemeral-resources/ephemeral_static/example_2.tf +cmpenv examples/ephemeral-resources/ephemeral_static/import_1.sh exp-examples/ephemeral-resources/ephemeral_static/import_1.sh # Verify legacy website directory is removed ! exists website/ -- expected-output.txt -- migrating website from "$WORK/website/docs" to "$WORK/templates" -migrating functons directory: functions +migrating ephemeral resources directory: ephemeral-resources +migrating file "time_ephemeral_static.html.markdown" +extracting YAML frontmatter to "$WORK/templates/ephemeral-resources/ephemeral_static.md.tmpl" +extracting code examples from "time_ephemeral_static.html.markdown" +creating example file "$WORK/examples/ephemeral-resources/ephemeral_static/example_1.tf" +creating example file "$WORK/examples/ephemeral-resources/ephemeral_static/example_2.tf" +creating import file "$WORK/examples/ephemeral-resources/ephemeral_static/import_1.sh" +finished creating template "$WORK/templates/ephemeral-resources/ephemeral_static.md.tmpl" +migrating functions directory: functions migrating file "time_rfc3339_parse.html.markdown" extracting YAML frontmatter to "$WORK/templates/functions/rfc3339_parse.md.tmpl" extracting code examples from "time_rfc3339_parse.html.markdown" @@ -518,7 +531,85 @@ $ terraform import time_static.example 2020-02-12T06:36:13Z ``` The `triggers` argument cannot be imported. +-- website/docs/ephemeral-resources/time_ephemeral_static.html.markdown -- +--- +layout: "time" +page_title: "Time: time_ephemeral_static" +description: |- + Manages a static time resource. +--- + +# Resource: time_static + +Manages a static time resource, which keeps a locally sourced UTC timestamp stored in the Terraform state. This prevents perpetual differences caused by using the [`timestamp()` function](https://www.terraform.io/docs/configuration/functions/timestamp.html). + +-> Further manipulation of incoming or outgoing values can be accomplished with the [`formatdate()` function](https://www.terraform.io/docs/configuration/functions/formatdate.html) and the [`timeadd()` function](https://www.terraform.io/docs/configuration/functions/timeadd.html). + +## Example Usage + +### Basic Usage + +```hcl +resource "time_static" "example" {} + +output "current_time" { + value = time_static.example.rfc3339 +} +``` + +### Triggers Usage + +```hcl +resource "time_static" "ami_update" { + triggers = { + # Save the time each switch of an AMI id + ami_id = data.aws_ami.example.id + } +} + +resource "aws_instance" "server" { + # Read the AMI id "through" the time_static resource to ensure that + # both will change together. + ami = time_static.ami_update.triggers.ami_id + + tags = { + AmiUpdateTime = time_static.ami_update.rfc3339 + } + + # ... (other aws_instance arguments) ... +} +``` + +## Argument Reference + +The following arguments are optional: + +* `triggers` - (Optional) Arbitrary map of values that, when changed, will trigger a new base timestamp value to be saved. See [the main provider documentation](../index.html) for more information. +* `rfc3339` - (Optional) Configure the base timestamp with an UTC [RFC3339 time string](https://tools.ietf.org/html/rfc3339#section-5.8) (`YYYY-MM-DDTHH:MM:SSZ`). Defaults to the current time. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `day` - Number day of timestamp. +* `hour` - Number hour of timestamp. +* `id` - UTC RFC3339 timestamp format, e.g. `2020-02-12T06:36:13Z`. +* `minute` - Number minute of timestamp. +* `month` - Number month of timestamp. +* `rfc3339` - UTC RFC3339 format of timestamp, e.g. `2020-02-12T06:36:13Z`. +* `second` - Number second of timestamp. +* `unix` - Number of seconds since epoch time, e.g. `1581489373`. +* `year` - Number year of timestamp. + +## Import + +This resource can be imported using the UTC RFC3339 value, e.g. + +```console +$ terraform import time_static.example 2020-02-12T06:36:13Z +``` +The `triggers` argument cannot be imported. -- exp-examples/example_1.tf -- resource "time_static" "ami_update" { triggers = { @@ -665,6 +756,33 @@ resource "aws_instance" "server" { } -- exp-examples/resources/static/import_1.sh -- $ terraform import time_static.example 2020-02-12T06:36:13Z +-- exp-examples/ephemeral-resources/ephemeral_static/example_1.tf -- +resource "time_static" "example" {} + +output "current_time" { + value = time_static.example.rfc3339 +} +-- exp-examples/ephemeral-resources/ephemeral_static/example_2.tf -- +resource "time_static" "ami_update" { + triggers = { + # Save the time each switch of an AMI id + ami_id = data.aws_ami.example.id + } +} + +resource "aws_instance" "server" { + # Read the AMI id "through" the time_static resource to ensure that + # both will change together. + ami = time_static.ami_update.triggers.ami_id + + tags = { + AmiUpdateTime = time_static.ami_update.rfc3339 + } + + # ... (other aws_instance arguments) ... +} +-- exp-examples/ephemeral-resources/ephemeral_static/import_1.sh -- +$ terraform import time_static.example 2020-02-12T06:36:13Z -- exp-templates/index.md.tmpl -- --- page_title: "Provider: Time" @@ -965,4 +1083,59 @@ This resource can be imported using the UTC RFC3339 value, e.g. {{codefile "shell" "examples/resources/static/import_1.sh"}} +The `triggers` argument cannot be imported. +-- exp-templates/ephemeral-resources/ephemeral_static.md.tmpl -- +--- +page_title: "Time: time_ephemeral_static" +description: |- + Manages a static time resource. +--- + +{{/* This template serves as a starting point for documentation generation, and can be customized with hardcoded values and/or doc gen templates. + +For example, the {{ .SchemaMarkdown }} template can be used to replace manual schema documentation if descriptions of schema attributes are added in the provider source code. */ -}} + +# Resource: time_static + +Manages a static time resource, which keeps a locally sourced UTC timestamp stored in the Terraform state. This prevents perpetual differences caused by using the [`timestamp()` function](https://www.terraform.io/docs/configuration/functions/timestamp.html). + +-> Further manipulation of incoming or outgoing values can be accomplished with the [`formatdate()` function](https://www.terraform.io/docs/configuration/functions/formatdate.html) and the [`timeadd()` function](https://www.terraform.io/docs/configuration/functions/timeadd.html). + +## Example Usage + +### Basic Usage + +{{tffile "examples/ephemeral-resources/ephemeral_static/example_1.tf"}} + +### Triggers Usage + +{{tffile "examples/ephemeral-resources/ephemeral_static/example_2.tf"}} + +## Argument Reference + +The following arguments are optional: + +* `triggers` - (Optional) Arbitrary map of values that, when changed, will trigger a new base timestamp value to be saved. See [the main provider documentation](../index.html) for more information. +* `rfc3339` - (Optional) Configure the base timestamp with an UTC [RFC3339 time string](https://tools.ietf.org/html/rfc3339#section-5.8) (`YYYY-MM-DDTHH:MM:SSZ`). Defaults to the current time. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `day` - Number day of timestamp. +* `hour` - Number hour of timestamp. +* `id` - UTC RFC3339 timestamp format, e.g. `2020-02-12T06:36:13Z`. +* `minute` - Number minute of timestamp. +* `month` - Number month of timestamp. +* `rfc3339` - UTC RFC3339 format of timestamp, e.g. `2020-02-12T06:36:13Z`. +* `second` - Number second of timestamp. +* `unix` - Number of seconds since epoch time, e.g. `1581489373`. +* `year` - Number year of timestamp. + +## Import + +This resource can be imported using the UTC RFC3339 value, e.g. + +{{codefile "shell" "examples/ephemeral-resources/ephemeral_static/import_1.sh"}} + The `triggers` argument cannot be imported. \ No newline at end of file diff --git a/cmd/tfplugindocs/testdata/scripts/schema-json/validate/framework_provider_error_file_mismatch.txtar b/cmd/tfplugindocs/testdata/scripts/schema-json/validate/framework_provider_error_file_mismatch.txtar index 8a0d2e19..e19a80b4 100644 --- a/cmd/tfplugindocs/testdata/scripts/schema-json/validate/framework_provider_error_file_mismatch.txtar +++ b/cmd/tfplugindocs/testdata/scripts/schema-json/validate/framework_provider_error_file_mismatch.txtar @@ -5,10 +5,16 @@ [!unix] skip ! exec tfplugindocs validate --provider-name=terraform-provider-scaffolding --providers-schema=schema.json stderr 'Error executing command: validation errors found:' -stderr 'matching resource for documentation file \(resource2.md\) not found, file is extraneous or incorrectly named' +stderr 'matching resource for documentation file \(example2.md\) not found, file is extraneous or incorrectly named' stderr 'missing documentation file for resource: scaffolding_example' +stderr 'matching datasource for documentation file \(example2.md\) not found, file is extraneous or incorrectly named' +stderr 'missing documentation file for datasource: scaffolding_example' +stderr 'matching function for documentation file \(example2.md\) not found, file is extraneous or incorrectly named' +stderr 'missing documentation file for function: example' +stderr 'matching ephemeral resource for documentation file \(example2.md\) not found, file is extraneous or incorrectly named' +stderr 'missing documentation file for ephemeral resource: scaffolding_example' --- docs/data-sources/example.md -- +-- docs/data-sources/example2.md -- --- subcategory: "Example" page_title: "Example: example_thing" @@ -19,7 +25,29 @@ description: |- Name: {{.Name}} Type: {{.Type}} --- docs/resources/resource2.md -- +-- docs/resources/example2.md -- +--- +subcategory: "Example" +page_title: "Example: example_thing" +description: |- + Example description. +--- +# Data Fields + +Name: {{.Name}} +Type: {{.Type}} +-- docs/ephemeral-resources/example2.md -- +--- +subcategory: "Example" +page_title: "Example: example_thing" +description: |- + Example description. +--- +# Data Fields + +Name: {{.Name}} +Type: {{.Type}} +-- docs/functions/example2.md -- --- subcategory: "Example" page_title: "Example: example_thing" @@ -80,6 +108,36 @@ Type: {{.Type}} } } }, + "ephemeral_resource_schemas": { + "scaffolding_example": { + "version": 0, + "block": { + "attributes": { + "configurable_attribute": { + "type": "string", + "description": "Example configurable attribute", + "description_kind": "markdown", + "optional": true + }, + "defaulted": { + "type": "string", + "description": "Example configurable attribute with default value", + "description_kind": "markdown", + "optional": true, + "computed": true + }, + "id": { + "type": "string", + "description": "Example identifier", + "description_kind": "markdown", + "computed": true + } + }, + "description": "Example resource", + "description_kind": "markdown" + } + } + }, "data_source_schemas": { "scaffolding_example": { "version": 0, diff --git a/cmd/tfplugindocs/testdata/scripts/schema-json/validate/framework_provider_success_legacy_docs.txtar b/cmd/tfplugindocs/testdata/scripts/schema-json/validate/framework_provider_success_legacy_docs.txtar index c87edab2..fa9df60f 100644 --- a/cmd/tfplugindocs/testdata/scripts/schema-json/validate/framework_provider_success_legacy_docs.txtar +++ b/cmd/tfplugindocs/testdata/scripts/schema-json/validate/framework_provider_success_legacy_docs.txtar @@ -13,6 +13,8 @@ running mixed directories check detected legacy website directory, running checks running invalid directories check on website/docs/d running file checks on website/docs/d/example.html.md +running invalid directories check on website/docs/ephemeral-resources +running file checks on website/docs/ephemeral-resources/example.html.md running invalid directories check on website/docs/functions running file checks on website/docs/functions/example.html.md running invalid directories check on website/docs/guides @@ -68,6 +70,18 @@ description: |- --- # Data Fields +Name: {{.Name}} +Type: {{.Type}} +-- website/docs/ephemeral-resources/example.html.md -- +--- +subcategory: "Example" +layout: "example" +page_title: "Example: example_thing" +description: |- + Example description. +--- +# Data Fields + Name: {{.Name}} Type: {{.Type}} -- website/docs/index.html.md -- @@ -131,6 +145,36 @@ Type: {{.Type}} } } }, + "ephemeral_resource_schemas": { + "scaffolding_example": { + "version": 0, + "block": { + "attributes": { + "configurable_attribute": { + "type": "string", + "description": "Example configurable attribute", + "description_kind": "markdown", + "optional": true + }, + "defaulted": { + "type": "string", + "description": "Example configurable attribute with default value", + "description_kind": "markdown", + "optional": true, + "computed": true + }, + "id": { + "type": "string", + "description": "Example identifier", + "description_kind": "markdown", + "computed": true + } + }, + "description": "Example resource", + "description_kind": "markdown" + } + } + }, "data_source_schemas": { "scaffolding_example": { "version": 0, diff --git a/cmd/tfplugindocs/testdata/scripts/schema-json/validate/framework_provider_success_registry_docs.txtar b/cmd/tfplugindocs/testdata/scripts/schema-json/validate/framework_provider_success_registry_docs.txtar index 220a8c3b..5fc21654 100644 --- a/cmd/tfplugindocs/testdata/scripts/schema-json/validate/framework_provider_success_registry_docs.txtar +++ b/cmd/tfplugindocs/testdata/scripts/schema-json/validate/framework_provider_success_registry_docs.txtar @@ -13,6 +13,8 @@ running mixed directories check detected static docs directory, running checks running invalid directories check on docs/data-sources running file checks on docs/data-sources/example.md +running invalid directories check on docs/ephemeral-resources +running file checks on docs/ephemeral-resources/example.md running invalid directories check on docs/functions running file checks on docs/functions/example.md running invalid directories check on docs/guides @@ -74,6 +76,17 @@ description: |- --- # Data Fields +Name: {{.Name}} +Type: {{.Type}} +-- docs/ephemeral-resources/example.md -- +--- +subcategory: "Example" +page_title: "Example: example_thing" +description: |- + Example description. +--- +# Data Fields + Name: {{.Name}} Type: {{.Type}} -- schema.json -- @@ -126,6 +139,36 @@ Type: {{.Type}} } } }, + "ephemeral_resource_schemas": { + "scaffolding_example": { + "version": 0, + "block": { + "attributes": { + "configurable_attribute": { + "type": "string", + "description": "Example configurable attribute", + "description_kind": "markdown", + "optional": true + }, + "defaulted": { + "type": "string", + "description": "Example configurable attribute with default value", + "description_kind": "markdown", + "optional": true, + "computed": true + }, + "id": { + "type": "string", + "description": "Example identifier", + "description_kind": "markdown", + "computed": true + } + }, + "description": "Example resource", + "description_kind": "markdown" + } + } + }, "data_source_schemas": { "scaffolding_example": { "version": 0, diff --git a/go.mod b/go.mod index b5bb2240..57fd2989 100644 --- a/go.mod +++ b/go.mod @@ -19,6 +19,7 @@ require ( go.abhg.dev/goldmark/frontmatter v0.2.0 golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df golang.org/x/text v0.19.0 + gopkg.in/yaml.v3 v3.0.1 ) require ( @@ -53,5 +54,4 @@ require ( golang.org/x/sys v0.21.0 // indirect golang.org/x/tools v0.22.0 // indirect gopkg.in/yaml.v2 v2.3.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/internal/check/directory.go b/internal/check/directory.go index 17c16d42..15be21ca 100644 --- a/internal/check/directory.go +++ b/internal/check/directory.go @@ -13,17 +13,19 @@ import ( const ( CdktfIndexDirectory = `cdktf` - LegacyIndexDirectory = `website/docs` - LegacyDataSourcesDirectory = `d` - LegacyGuidesDirectory = `guides` - LegacyResourcesDirectory = `r` - LegacyFunctionsDirectory = `functions` - - RegistryIndexDirectory = `docs` - RegistryDataSourcesDirectory = `data-sources` - RegistryGuidesDirectory = `guides` - RegistryResourcesDirectory = `resources` - RegistryFunctionsDirectory = `functions` + LegacyIndexDirectory = `website/docs` + LegacyDataSourcesDirectory = `d` + LegacyEphemeralResourcesDirectory = `ephemeral-resources` + LegacyGuidesDirectory = `guides` + LegacyResourcesDirectory = `r` + LegacyFunctionsDirectory = `functions` + + RegistryIndexDirectory = `docs` + RegistryDataSourcesDirectory = `data-sources` + RegistryEphemeralResourcesDirectory = `ephemeral-resources` + RegistryGuidesDirectory = `guides` + RegistryResourcesDirectory = `resources` + RegistryFunctionsDirectory = `functions` // Terraform Registry Storage Limits // https://www.terraform.io/docs/registry/providers/docs.html#storage-limits @@ -35,6 +37,7 @@ const ( var ValidLegacyDirectories = []string{ LegacyIndexDirectory, LegacyIndexDirectory + "/" + LegacyDataSourcesDirectory, + LegacyIndexDirectory + "/" + LegacyEphemeralResourcesDirectory, LegacyIndexDirectory + "/" + LegacyGuidesDirectory, LegacyIndexDirectory + "/" + LegacyResourcesDirectory, LegacyIndexDirectory + "/" + LegacyFunctionsDirectory, @@ -43,6 +46,7 @@ var ValidLegacyDirectories = []string{ var ValidRegistryDirectories = []string{ RegistryIndexDirectory, RegistryIndexDirectory + "/" + RegistryDataSourcesDirectory, + RegistryIndexDirectory + "/" + RegistryEphemeralResourcesDirectory, RegistryIndexDirectory + "/" + RegistryGuidesDirectory, RegistryIndexDirectory + "/" + RegistryResourcesDirectory, RegistryIndexDirectory + "/" + RegistryFunctionsDirectory, @@ -59,6 +63,7 @@ var ValidCdktfLanguages = []string{ var ValidLegacySubdirectories = []string{ LegacyIndexDirectory, LegacyDataSourcesDirectory, + LegacyEphemeralResourcesDirectory, LegacyGuidesDirectory, LegacyResourcesDirectory, } @@ -66,6 +71,7 @@ var ValidLegacySubdirectories = []string{ var ValidRegistrySubdirectories = []string{ RegistryIndexDirectory, RegistryDataSourcesDirectory, + RegistryEphemeralResourcesDirectory, RegistryGuidesDirectory, RegistryResourcesDirectory, } diff --git a/internal/check/directory_test.go b/internal/check/directory_test.go index 95c6f8a7..b2432de5 100644 --- a/internal/check/directory_test.go +++ b/internal/check/directory_test.go @@ -11,7 +11,7 @@ import ( "github.com/bmatcuk/doublestar/v4" ) -var DocumentationGlobPattern = `{docs/index.*,docs/{,cdktf/}{data-sources,guides,resources,functions}/**/*,website/docs/**/*}` +var DocumentationGlobPattern = `{docs/index.*,docs/{,cdktf/}{data-sources,ephemeral-resources,guides,resources,functions}/**/*,website/docs/**/*}` func TestMixedDirectoriesCheck(t *testing.T) { t.Parallel() @@ -38,6 +38,13 @@ func TestMixedDirectoriesCheck(t *testing.T) { }, ExpectError: true, }, + "invalid mixed directories - registry ephemeral resource": { + ProviderFS: fstest.MapFS{ + "docs/ephemeral-resources/invalid.md": {}, + "website/docs/index.md": {}, + }, + ExpectError: true, + }, "invalid mixed directories - registry resource": { ProviderFS: fstest.MapFS{ "docs/resources/invalid.md": {}, @@ -66,6 +73,13 @@ func TestMixedDirectoriesCheck(t *testing.T) { }, ExpectError: true, }, + "invalid mixed directories - legacy ephemeral resource": { + ProviderFS: fstest.MapFS{ + "website/docs/ephemeral-resources/invalid.html.markdown": {}, + "docs/resources/thing.md": {}, + }, + ExpectError: true, + }, "invalid mixed directories - legacy resource": { ProviderFS: fstest.MapFS{ "website/docs/r/invalid.html.markdown": {}, diff --git a/internal/check/file_mismatch.go b/internal/check/file_mismatch.go index d65989fd..c53827d7 100644 --- a/internal/check/file_mismatch.go +++ b/internal/check/file_mismatch.go @@ -28,6 +28,8 @@ type FileMismatchOptions struct { FunctionEntries []os.DirEntry + EphemeralResourceEntries []os.DirEntry + Schema *tfjson.ProviderSchema } @@ -74,6 +76,11 @@ func (check *FileMismatchCheck) Run() error { result = errors.Join(result, err) } + if check.Options.EphemeralResourceEntries != nil { + err := check.ResourceFileMismatchCheck(check.Options.EphemeralResourceEntries, "ephemeral resource", check.Options.Schema.EphemeralResourceSchemas) + result = errors.Join(result, err) + } + return result } diff --git a/internal/provider/generate.go b/internal/provider/generate.go index d0c3c965..7df7b63d 100644 --- a/internal/provider/generate.go +++ b/internal/provider/generate.go @@ -58,6 +58,14 @@ var ( "functions/%s.html.markdown", "functions/%s.html.md", } + websiteEphemeralResourceFile = "ephemeral-resources/%s.md.tmpl" + websiteEphemeralResourceFallbackFile = "ephemeral-resources.md.tmpl" + websiteEphemeralResourceFileStaticCandidates = []string{ + "ephemeral-resources/%s.md", + "ephemeral-resources/%s.markdown", + "ephemeral-resources/%s.html.markdown", + "ephemeral-resources/%s.html.md", + } websiteProviderFile = "index.md.tmpl" websiteProviderFileStaticCandidates = []string{ "index.markdown", @@ -71,6 +79,7 @@ var ( "guides", "resources", "functions", + "ephemeral-resources", } managedWebsiteFiles = []string{ @@ -372,6 +381,42 @@ func (g *generator) generateMissingFunctionTemplate(functionName string) error { return nil } +func (g *generator) generateMissingEphemeralResourceTemplate(resourceName string) error { + templatePath := fmt.Sprintf(websiteEphemeralResourceFile, resourceShortName(resourceName, g.providerName)) + templatePath = filepath.Join(g.TempTemplatesDir(), templatePath) + if fileExists(templatePath) { + g.infof("ephemeral resource %q template exists, skipping", resourceName) + return nil + } + + fallbackTemplatePath := filepath.Join(g.TempTemplatesDir(), websiteEphemeralResourceFallbackFile) + if fileExists(fallbackTemplatePath) { + g.infof("ephemeral resource %q fallback template exists, creating template", resourceName) + err := cp(fallbackTemplatePath, templatePath) + if err != nil { + return fmt.Errorf("unable to copy fallback template for %q: %w", resourceName, err) + } + return nil + } + + for _, candidate := range websiteEphemeralResourceFileStaticCandidates { + candidatePath := fmt.Sprintf(candidate, resourceShortName(resourceName, g.providerName)) + candidatePath = filepath.Join(g.TempTemplatesDir(), candidatePath) + if fileExists(candidatePath) { + g.infof("ephemeral resource %q static file exists, skipping", resourceName) + return nil + } + } + + g.infof("generating new template for %q", resourceName) + err := writeFile(templatePath, string(defaultResourceTemplate)) + if err != nil { + return fmt.Errorf("unable to write template for %q: %w", resourceName, err) + } + + return nil +} + func (g *generator) generateMissingProviderTemplate() error { templatePath := filepath.Join(g.TempTemplatesDir(), websiteProviderFile) if fileExists(templatePath) { @@ -433,6 +478,18 @@ func (g *generator) generateMissingTemplates(providerSchema *tfjson.ProviderSche } } + g.infof("generating missing ephemeral resource content") + for name, schema := range providerSchema.EphemeralResourceSchemas { + if g.ignoreDeprecated && schema.Block.Deprecated { + continue + } + + err := g.generateMissingEphemeralResourceTemplate(name) + if err != nil { + return fmt.Errorf("unable to generate template for ephemeral resource %q: %w", name, err) + } + } + g.infof("generating missing provider content") err := g.generateMissingProviderTemplate() if err != nil { @@ -494,8 +551,11 @@ func (g *generator) renderStaticWebsite(providerSchema *tfjson.ProviderSchema) e relDir, relFile := filepath.Split(rel) relDir = filepath.ToSlash(relDir) - // skip special top-level generic resource, data source, and function templates - if relDir == "" && (relFile == "resources.md.tmpl" || relFile == "data-sources.md.tmpl" || relFile == "functions.md.tmpl") { + // skip special top-level generic resource, data source, function, and ephemeral resource templates + if relDir == "" && (relFile == "resources.md.tmpl" || + relFile == "data-sources.md.tmpl" || + relFile == "functions.md.tmpl" || + relFile == "ephemeral-resources.md.tmpl") { return nil } @@ -579,6 +639,23 @@ func (g *generator) renderStaticWebsite(providerSchema *tfjson.ProviderSchema) e } g.warnf("function entitled %q does not exist", funcName) + case "ephemeral-resources/": + resSchema, resName := resourceSchema(providerSchema.EphemeralResourceSchemas, shortName, relFile) + exampleFilePath := filepath.Join(g.ProviderExamplesDir(), "ephemeral-resources", resName, "ephemeral-resource.tf") + + if resSchema != nil { + tmpl := resourceTemplate(tmplData) + render, err := tmpl.Render(g.providerDir, resName, g.providerName, g.renderedProviderName, "Ephemeral Resource", exampleFilePath, "", resSchema) + if err != nil { + return fmt.Errorf("unable to render ephemeral resource template %q: %w", rel, err) + } + _, err = out.WriteString(render) + if err != nil { + return fmt.Errorf("unable to write rendered string: %w", err) + } + return nil + } + g.warnf("ephemeral resource entitled %q, or %q does not exist", shortName, resName) case "": // provider if relFile == "index.md.tmpl" { tmpl := providerTemplate(tmplData) diff --git a/internal/provider/migrate.go b/internal/provider/migrate.go index babe2127..9abd7734 100644 --- a/internal/provider/migrate.go +++ b/internal/provider/migrate.go @@ -105,7 +105,7 @@ func (m *migrator) Migrate() error { if d.IsDir() { switch d.Name() { case "d", "data-sources": //data-sources - m.infof("migrating data-sources directory: %s", d.Name()) + m.infof("migrating datasources directory: %s", d.Name()) err := filepath.WalkDir(path, m.MigrateTemplate("data-sources")) if err != nil { return err @@ -119,12 +119,19 @@ func (m *migrator) Migrate() error { } return filepath.SkipDir case "functions": - m.infof("migrating functons directory: %s", d.Name()) + m.infof("migrating functions directory: %s", d.Name()) err := filepath.WalkDir(path, m.MigrateTemplate("functions")) if err != nil { return err } return filepath.SkipDir + case "ephemeral-resources": + m.infof("migrating ephemeral resources directory: %s", d.Name()) + err := filepath.WalkDir(path, m.MigrateTemplate("ephemeral-resources")) + if err != nil { + return err + } + return filepath.SkipDir case "guides": m.infof("copying guides directory: %s", d.Name()) err := cp(path, filepath.Join(m.ProviderTemplatesDir(), "guides")) diff --git a/internal/provider/testdata/schema.json b/internal/provider/testdata/schema.json index 868bae22..48876497 100644 --- a/internal/provider/testdata/schema.json +++ b/internal/provider/testdata/schema.json @@ -34,6 +34,32 @@ } } }, + "ephemeral_resource_schemas": { + "null_ephemeral_resource": { + "version": 0, + "block": { + "attributes": { + "id": { + "type": "string", + "description": "This is set to a random value at create time.", + "description_kind": "plain", + "computed": true + }, + "triggers": { + "type": [ + "map", + "string" + ], + "description": "A map of arbitrary strings that, when changed, will force the null resource to be replaced, re-running any associated provisioners.", + "description_kind": "plain", + "optional": true + } + }, + "description": "The `null_resource` resource implements the standard resource lifecycle but takes no further action.\n\nThe `triggers` argument allows specifying an arbitrary set of values that, when changed, will cause the resource to be replaced.", + "description_kind": "plain" + } + } + }, "data_source_schemas": { "null_data_source": { "version": 0, @@ -83,6 +109,25 @@ "deprecated": true } } + }, + "functions": { + "null": { + "description": "Given a string value, returns the same value.", + "summary": "Echo a string", + "return_type": "string", + "parameters": [ + { + "name": "input", + "description": "Value to echo.", + "type": "string" + } + ], + "variadic_parameter": { + "name": "variadicInput", + "description": "Variadic input to echo.", + "type": "string" + } + } } } } diff --git a/internal/provider/util_test.go b/internal/provider/util_test.go index 95e59b84..0e04f13e 100644 --- a/internal/provider/util_test.go +++ b/internal/provider/util_test.go @@ -106,11 +106,19 @@ func Test_extractSchemaFromFile(t *testing.T) { if providerSchema.DataSourceSchemas["null_data_source"] == nil { t.Fatalf("null_data_source not found") } + if providerSchema.Functions["null"] == nil { + t.Fatalf("null function not found") + } + if providerSchema.EphemeralResourceSchemas["null_ephemeral_resource"] == nil { + t.Fatalf("null_ephemeral_resource not found") + } if providerSchema.ResourceSchemas["null_resource"].Block.Attributes["id"] == nil { t.Fatalf("null_resoruce id attribute not found") } if providerSchema.DataSourceSchemas["null_data_source"].Block.Attributes["id"] == nil { t.Fatalf("null_data_source id attribute not found") } - + if providerSchema.EphemeralResourceSchemas["null_ephemeral_resource"].Block.Attributes["id"] == nil { + t.Fatalf("null_ephemeral_resoruce id attribute not found") + } } diff --git a/internal/provider/validate.go b/internal/provider/validate.go index f7751a0b..0ba0fd21 100644 --- a/internal/provider/validate.go +++ b/internal/provider/validate.go @@ -25,8 +25,8 @@ const ( FileExtensionMarkdown = `.markdown` FileExtensionMd = `.md` - DocumentationGlobPattern = `{docs/index.*,docs/{,cdktf/}{data-sources,guides,resources,functions}/**/*,website/docs/**/*}` - DocumentationDirGlobPattern = `{docs/{,cdktf/}{data-sources,guides,resources,functions}{,/*},website/docs/**/*}` + DocumentationGlobPattern = `{docs/index.*,docs/{,cdktf/}{data-sources,ephemeral-resources,guides,resources,functions}/**/*,website/docs/**/*}` + DocumentationDirGlobPattern = `{docs/{,cdktf/}{data-sources,ephemeral-resources,guides,resources,functions}{,/*},website/docs/**/*}` ) var ValidLegacyFileExtensions = []string{ @@ -253,6 +253,10 @@ func (v *validator) validateStaticDocs() error { functionFiles, _ := fs.ReadDir(v.providerFS, dir+"/functions") mismatchOpt.FunctionEntries = functionFiles } + if dirExists(v.providerFS, dir+"/ephemeral-resources") { + ephemeralResourceFiles, _ := fs.ReadDir(v.providerFS, dir+"/ephemeral-resources") + mismatchOpt.EphemeralResourceEntries = ephemeralResourceFiles + } v.logger.infof("running file mismatch check") if err := check.NewFileMismatchCheck(mismatchOpt).Run(); err != nil { @@ -332,6 +336,10 @@ func (v *validator) validateLegacyWebsite() error { functionFiles, _ := fs.ReadDir(v.providerFS, dir+"/functions") mismatchOpt.FunctionEntries = functionFiles } + if dirExists(v.providerFS, dir+"/ephemeral-resources") { + ephemeralResourceFiles, _ := fs.ReadDir(v.providerFS, dir+"/ephemeral-resources") + mismatchOpt.EphemeralResourceEntries = ephemeralResourceFiles + } v.logger.infof("running file mismatch check") if err := check.NewFileMismatchCheck(mismatchOpt).Run(); err != nil { diff --git a/internal/provider/validate_test.go b/internal/provider/validate_test.go index a6ada21d..03de43a3 100644 --- a/internal/provider/validate_test.go +++ b/internal/provider/validate_test.go @@ -81,6 +81,9 @@ func TestValidateStaticDocs_DirectoryChecks(t *testing.T) { "docs/data-sources/thing.md": { Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), }, + "docs/ephemeral-resources/thing.md": { + Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), + }, "docs/functions/thing.md": { Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), }, @@ -106,6 +109,9 @@ func TestValidateStaticDocs_DirectoryChecks(t *testing.T) { "docs/cdktf/typescript/data-sources/thing.md": { Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), }, + "docs/cdktf/typescript/ephemeral-resources/thing.md": { + Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), + }, "docs/cdktf/typescirpt/guides/thing.md": { Data: encodeYAML(t, &ValidRegistryGuideFrontMatter), }, @@ -146,6 +152,9 @@ func TestValidateStaticDocs_DirectoryChecks(t *testing.T) { "docs/data-sources/invalid/thing.md": { Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), }, + "docs/ephemeral-resources/invalid/thing.md": { + Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), + }, "docs/guides/invalid/thing.md": { Data: encodeYAML(t, &ValidRegistryGuideFrontMatter), }, @@ -166,6 +175,7 @@ func TestValidateStaticDocs_DirectoryChecks(t *testing.T) { }, }, ExpectedError: "invalid Terraform Provider documentation directory found: " + filepath.Join("docs", "data-sources", "invalid") + + "\ninvalid Terraform Provider documentation directory found: " + filepath.Join("docs", "ephemeral-resources", "invalid") + "\ninvalid Terraform Provider documentation directory found: " + filepath.Join("docs", "functions", "invalid") + "\ninvalid Terraform Provider documentation directory found: " + filepath.Join("docs", "guides", "invalid") + "\ninvalid Terraform Provider documentation directory found: " + filepath.Join("docs", "resources", "invalid"), @@ -235,6 +245,38 @@ func TestValidateStaticDocs_FileChecks(t *testing.T) { filepath.Join("docs", "data-sources", "with_layout.md") + ": error checking file frontmatter: YAML frontmatter should not contain layout\n" + filepath.Join("docs", "data-sources", "with_sidebar_current.md") + ": error checking file frontmatter: YAML frontmatter should not contain sidebar_current", }, + "invalid ephemeral resource files": { + ProviderFS: fstest.MapFS{ + "docs/ephemeral-resources/invalid_extension.txt": { + Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), + }, + "docs/ephemeral-resources/invalid_frontmatter.md": &InvalidYAMLFrontMatter, + "docs/ephemeral-resources/with_layout.md": { + Data: encodeYAML(t, + &FrontMatterData{ + Layout: &exampleLayout, + Subcategory: &exampleSubcategory, + PageTitle: &examplePageTitle, + Description: &exampleDescription, + }, + ), + }, + "docs/ephemeral-resources/with_sidebar_current.md": { + Data: encodeYAML(t, + &FrontMatterData{ + SidebarCurrent: &exampleSidebarCurrent, + Subcategory: &exampleSubcategory, + PageTitle: &examplePageTitle, + Description: &exampleDescription, + }, + ), + }, + }, + ExpectedError: filepath.Join("docs", "ephemeral-resources", "invalid_extension.txt") + ": error checking file extension: file does not end with a valid extension, valid extensions: [.md]\n" + + filepath.Join("docs", "ephemeral-resources", "invalid_frontmatter.md") + ": error checking file frontmatter: error parsing YAML frontmatter: yaml: line 4: could not find expected ':'\n" + + filepath.Join("docs", "ephemeral-resources", "with_layout.md") + ": error checking file frontmatter: YAML frontmatter should not contain layout\n" + + filepath.Join("docs", "ephemeral-resources", "with_sidebar_current.md") + ": error checking file frontmatter: YAML frontmatter should not contain sidebar_current", + }, "invalid resource files": { ProviderFS: fstest.MapFS{ "docs/resources/invalid_extension.txt": { @@ -403,6 +445,9 @@ func TestValidateStaticDocs_FileMismatchCheck(t *testing.T) { DataSourceSchemas: map[string]*tfjson.Schema{ "test_pet": {}, }, + EphemeralResourceSchemas: map[string]*tfjson.Schema{ + "test_ephemeral_id": {}, + }, ResourceSchemas: map[string]*tfjson.Schema{ "test_id": {}, }, @@ -414,6 +459,9 @@ func TestValidateStaticDocs_FileMismatchCheck(t *testing.T) { "docs/data-sources/pet.md": { Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), }, + "docs/ephemeral-resources/ephemeral_id.md": { + Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), + }, "docs/functions/parse_id.md": { Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), }, @@ -428,6 +476,10 @@ func TestValidateStaticDocs_FileMismatchCheck(t *testing.T) { "test_pet": {}, "test_pet2": {}, }, + EphemeralResourceSchemas: map[string]*tfjson.Schema{ + "test_ephemeral_id": {}, + "test_ephemeral_id2": {}, + }, ResourceSchemas: map[string]*tfjson.Schema{ "test_id": {}, "test_id2": {}, @@ -441,6 +493,9 @@ func TestValidateStaticDocs_FileMismatchCheck(t *testing.T) { "docs/data-sources/pet.md": { Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), }, + "docs/ephemeral-resources/ephemeral_id.md": { + Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), + }, "docs/functions/parse_id.md": { Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), }, @@ -450,13 +505,17 @@ func TestValidateStaticDocs_FileMismatchCheck(t *testing.T) { }, ExpectedError: "missing documentation file for resource: test_id2\n" + "missing documentation file for datasource: test_pet2\n" + - "missing documentation file for function: parse_id2", + "missing documentation file for function: parse_id2\n" + + "missing documentation file for ephemeral resource: test_ephemeral_id2", }, "invalid - extra files": { ProviderSchema: &tfjson.ProviderSchema{ DataSourceSchemas: map[string]*tfjson.Schema{ "test_pet": {}, }, + EphemeralResourceSchemas: map[string]*tfjson.Schema{ + "test_ephemeral_id": {}, + }, ResourceSchemas: map[string]*tfjson.Schema{ "test_id": {}, }, @@ -471,6 +530,12 @@ func TestValidateStaticDocs_FileMismatchCheck(t *testing.T) { "docs/data-sources/pet2.md": { Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), }, + "docs/ephemeral-resources/ephemeral_id.md": { + Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), + }, + "docs/ephemeral-resources/ephemeral_id2.md": { + Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), + }, "docs/functions/parse_id.md": { Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), }, @@ -486,7 +551,8 @@ func TestValidateStaticDocs_FileMismatchCheck(t *testing.T) { }, ExpectedError: "matching resource for documentation file (id2.md) not found, file is extraneous or incorrectly named\n" + "matching datasource for documentation file (pet2.md) not found, file is extraneous or incorrectly named\n" + - "matching function for documentation file (parse_id2.md) not found, file is extraneous or incorrectly named", + "matching function for documentation file (parse_id2.md) not found, file is extraneous or incorrectly named\n" + + "matching ephemeral resource for documentation file (ephemeral_id2.md) not found, file is extraneous or incorrectly named", }, } @@ -527,6 +593,9 @@ func TestValidateLegacyWebsite_DirectoryChecks(t *testing.T) { "website/docs/d/thing.html.markdown": { Data: encodeYAML(t, &ValidLegacyResourceFrontMatter), }, + "website/docs/ephemeral-resources/thing.html.markdown": { + Data: encodeYAML(t, &ValidLegacyResourceFrontMatter), + }, "website/docs/functions/thing.html.markdown": { Data: encodeYAML(t, &ValidLegacyResourceFrontMatter), }, @@ -546,6 +615,9 @@ func TestValidateLegacyWebsite_DirectoryChecks(t *testing.T) { "website/docs/cdktf/typescript/d/thing.html.markdown": { Data: encodeYAML(t, &ValidLegacyResourceFrontMatter), }, + "website/docs/cdktf/typescript/ephemeral-resources/thing.html.markdown": { + Data: encodeYAML(t, &ValidLegacyResourceFrontMatter), + }, "website/docs/cdktf/typescript/guides/thing.html.markdown": { Data: encodeYAML(t, &ValidLegacyGuideFrontMatter), }, @@ -574,6 +646,9 @@ func TestValidateLegacyWebsite_DirectoryChecks(t *testing.T) { "website/docs/d/invalid/thing.html.markdown": { Data: encodeYAML(t, &ValidLegacyResourceFrontMatter), }, + "website/docs/ephemeral-resources/invalid/thing.html.markdown": { + Data: encodeYAML(t, &ValidLegacyResourceFrontMatter), + }, "website/docs/functions/invalid/thing.html.markdown": { Data: encodeYAML(t, &ValidLegacyResourceFrontMatter), }, @@ -588,6 +663,7 @@ func TestValidateLegacyWebsite_DirectoryChecks(t *testing.T) { }, }, ExpectedError: "invalid Terraform Provider documentation directory found: " + filepath.Join("website", "docs", "d", "invalid") + + "\ninvalid Terraform Provider documentation directory found: " + filepath.Join("website", "docs", "ephemeral-resources", "invalid") + "\ninvalid Terraform Provider documentation directory found: " + filepath.Join("website", "docs", "functions", "invalid") + "\ninvalid Terraform Provider documentation directory found: " + filepath.Join("website", "docs", "guides", "invalid") + "\ninvalid Terraform Provider documentation directory found: " + filepath.Join("website", "docs", "r", "invalid"), @@ -657,6 +733,38 @@ func TestValidateLegacyWebsite_FileChecks(t *testing.T) { filepath.Join("website", "docs", "d", "with_sidebar_current.html.markdown") + ": error checking file frontmatter: YAML frontmatter should not contain sidebar_current\n" + filepath.Join("website", "docs", "d", "without_layout.html.markdown") + ": error checking file frontmatter: YAML frontmatter missing required layout", }, + "invalid ephemeral resource files": { + ProviderFS: fstest.MapFS{ + "website/docs/ephemeral-resources/invalid_extension.txt": { + Data: encodeYAML(t, &ValidRegistryResourceFrontMatter), + }, + "website/docs/ephemeral-resources/invalid_frontmatter.html.markdown": &InvalidYAMLFrontMatter, + "website/docs/ephemeral-resources/without_layout.html.markdown": { + Data: encodeYAML(t, + &FrontMatterData{ + Subcategory: &exampleSubcategory, + PageTitle: &examplePageTitle, + Description: &exampleDescription, + }, + ), + }, + "website/docs/ephemeral-resources/with_sidebar_current.html.markdown": { + Data: encodeYAML(t, + &FrontMatterData{ + SidebarCurrent: &exampleSidebarCurrent, + Subcategory: &exampleSubcategory, + Layout: &exampleLayout, + PageTitle: &examplePageTitle, + Description: &exampleDescription, + }, + ), + }, + }, + ExpectedError: filepath.Join("website", "docs", "ephemeral-resources", "invalid_extension.txt") + ": error checking file extension: file does not end with a valid extension, valid extensions: [.html.markdown .html.md .markdown .md]\n" + + filepath.Join("website", "docs", "ephemeral-resources", "invalid_frontmatter.html.markdown") + ": error checking file frontmatter: error parsing YAML frontmatter: yaml: line 4: could not find expected ':'\n" + + filepath.Join("website", "docs", "ephemeral-resources", "with_sidebar_current.html.markdown") + ": error checking file frontmatter: YAML frontmatter should not contain sidebar_current\n" + + filepath.Join("website", "docs", "ephemeral-resources", "without_layout.html.markdown") + ": error checking file frontmatter: YAML frontmatter missing required layout", + }, "invalid resource files": { ProviderFS: fstest.MapFS{ "website/docs/r/invalid_extension.txt": { @@ -833,6 +941,9 @@ func TestValidateLegacyWebsite_FileMismatchCheck(t *testing.T) { DataSourceSchemas: map[string]*tfjson.Schema{ "test_pet": {}, }, + EphemeralResourceSchemas: map[string]*tfjson.Schema{ + "test_ephemeral_id": {}, + }, ResourceSchemas: map[string]*tfjson.Schema{ "test_id": {}, }, @@ -844,6 +955,9 @@ func TestValidateLegacyWebsite_FileMismatchCheck(t *testing.T) { "website/docs/d/pet.html.markdown": { Data: encodeYAML(t, &ValidLegacyResourceFrontMatter), }, + "website/docs/ephemeral-resources/ephemeral_id.html.markdown": { + Data: encodeYAML(t, &ValidLegacyResourceFrontMatter), + }, "website/docs/functions/parse_id.html.markdown": { Data: encodeYAML(t, &ValidLegacyResourceFrontMatter), }, @@ -858,6 +972,10 @@ func TestValidateLegacyWebsite_FileMismatchCheck(t *testing.T) { "test_pet": {}, "test_pet2": {}, }, + EphemeralResourceSchemas: map[string]*tfjson.Schema{ + "test_ephemeral_id": {}, + "test_ephemeral_id2": {}, + }, ResourceSchemas: map[string]*tfjson.Schema{ "test_id": {}, "test_id2": {}, @@ -871,6 +989,9 @@ func TestValidateLegacyWebsite_FileMismatchCheck(t *testing.T) { "website/docs/d/pet.html.markdown": { Data: encodeYAML(t, &ValidLegacyResourceFrontMatter), }, + "website/docs/ephemeral-resources/ephemeral_id.html.markdown": { + Data: encodeYAML(t, &ValidLegacyResourceFrontMatter), + }, "website/docs/functions/parse_id.html.markdown": { Data: encodeYAML(t, &ValidLegacyResourceFrontMatter), }, @@ -880,13 +1001,17 @@ func TestValidateLegacyWebsite_FileMismatchCheck(t *testing.T) { }, ExpectedError: "missing documentation file for resource: test_id2\n" + "missing documentation file for datasource: test_pet2\n" + - "missing documentation file for function: parse_id2", + "missing documentation file for function: parse_id2\n" + + "missing documentation file for ephemeral resource: test_ephemeral_id2", }, "invalid - extra files": { ProviderSchema: &tfjson.ProviderSchema{ DataSourceSchemas: map[string]*tfjson.Schema{ "test_pet": {}, }, + EphemeralResourceSchemas: map[string]*tfjson.Schema{ + "test_ephemeral_id": {}, + }, ResourceSchemas: map[string]*tfjson.Schema{ "test_id": {}, }, @@ -901,6 +1026,12 @@ func TestValidateLegacyWebsite_FileMismatchCheck(t *testing.T) { "website/docs/d/pet2.html.markdown": { Data: encodeYAML(t, &ValidLegacyResourceFrontMatter), }, + "website/docs/ephemeral-resources/ephemeral_id.html.markdown": { + Data: encodeYAML(t, &ValidLegacyResourceFrontMatter), + }, + "website/docs/ephemeral-resources/ephemeral_id2.html.markdown": { + Data: encodeYAML(t, &ValidLegacyResourceFrontMatter), + }, "website/docs/functions/parse_id.html.markdown": { Data: encodeYAML(t, &ValidLegacyResourceFrontMatter), }, @@ -916,7 +1047,8 @@ func TestValidateLegacyWebsite_FileMismatchCheck(t *testing.T) { }, ExpectedError: "matching resource for documentation file (id2.html.markdown) not found, file is extraneous or incorrectly named\n" + "matching datasource for documentation file (pet2.html.markdown) not found, file is extraneous or incorrectly named\n" + - "matching function for documentation file (parse_id2.html.markdown) not found, file is extraneous or incorrectly named", + "matching function for documentation file (parse_id2.html.markdown) not found, file is extraneous or incorrectly named\n" + + "matching ephemeral resource for documentation file (ephemeral_id2.html.markdown) not found, file is extraneous or incorrectly named", }, } From 933b4ae97e0ce355c604e906b0363a2405173b6b Mon Sep 17 00:00:00 2001 From: "hashicorp-tsccr[bot]" <129506189+hashicorp-tsccr[bot]@users.noreply.github.com> Date: Mon, 4 Nov 2024 11:34:40 -0500 Subject: [PATCH 39/71] Result of tsccr-helper -log-level=info gha update -latest .github/ (#416) Co-authored-by: hashicorp-tsccr[bot] --- .github/workflows/ci-changie.yml | 2 +- .github/workflows/compliance.yml | 2 +- .github/workflows/release.yml | 8 ++++---- .github/workflows/test.yml | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci-changie.yml b/.github/workflows/ci-changie.yml index 33ba8ee8..3031aad8 100644 --- a/.github/workflows/ci-changie.yml +++ b/.github/workflows/ci-changie.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest steps: # Ensure terraform-devex-repos is updated on version changes. - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 # Ensure terraform-devex-repos is updated on version changes. - uses: miniscruff/changie-action@6dcc2533cac0495148ed4046c438487e4dceaa23 # v2.0.0 with: diff --git a/.github/workflows/compliance.yml b/.github/workflows/compliance.yml index 9511923d..6a82766b 100644 --- a/.github/workflows/compliance.yml +++ b/.github/workflows/compliance.yml @@ -11,7 +11,7 @@ jobs: copywrite: runs-on: ubuntu-latest steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - uses: hashicorp/setup-copywrite@32638da2d4e81d56a0764aa1547882fc4d209636 # v1.1.3 - run: copywrite headers --plan - run: copywrite license --plan diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4b3613dc..7520b64c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,7 +25,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: fetch-depth: 0 # Avoid persisting GITHUB_TOKEN credentials as they take priority over our service account PAT for `git push` operations @@ -54,7 +54,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: fetch-depth: 0 # Default input is the SHA that initially triggered the workflow. As we created a new commit in the previous job, @@ -79,12 +79,12 @@ jobs: contents: write # Needed for goreleaser to create GitHub release issues: write # Needed for goreleaser to close associated milestone steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: ref: ${{ inputs.versionNumber }} fetch-depth: 0 - - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 + - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 with: go-version-file: 'go.mod' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ae285a4f..f275ccac 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,9 +21,9 @@ jobs: git config --global core.eol lf - name: Check out code - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Setup Go - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 + uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 with: go-version-file: 'go.mod' - name: Run linters From 1350b107707a49064ee0dd1b9ceb748b3dc98b54 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Nov 2024 07:26:47 -0500 Subject: [PATCH 40/71] Bump github.com/golang-jwt/jwt/v4 from 4.5.0 to 4.5.1 in /tools (#417) Bumps [github.com/golang-jwt/jwt/v4](https://github.com/golang-jwt/jwt) from 4.5.0 to 4.5.1. - [Release notes](https://github.com/golang-jwt/jwt/releases) - [Changelog](https://github.com/golang-jwt/jwt/blob/main/VERSION_HISTORY.md) - [Commits](https://github.com/golang-jwt/jwt/compare/v4.5.0...v4.5.1) --- updated-dependencies: - dependency-name: github.com/golang-jwt/jwt/v4 dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- tools/go.mod | 2 +- tools/go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/go.mod b/tools/go.mod index 9938d4ca..738e2a3d 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -18,7 +18,7 @@ require ( github.com/fsnotify/fsnotify v1.5.4 // indirect github.com/go-openapi/errors v0.20.2 // indirect github.com/go-openapi/strfmt v0.21.3 // indirect - github.com/golang-jwt/jwt/v4 v4.5.0 // indirect + github.com/golang-jwt/jwt/v4 v4.5.1 // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/google/go-github/v45 v45.2.0 // indirect github.com/google/go-github/v53 v53.0.0 // indirect diff --git a/tools/go.sum b/tools/go.sum index 0d402390..cfc168fa 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -97,8 +97,9 @@ github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr6 github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang-jwt/jwt/v4 v4.5.1 h1:JdqV9zKUdtaa9gdPlywC3aeoEsR681PlKC+4F5gQgeo= +github.com/golang-jwt/jwt/v4 v4.5.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= From 439e333bd023d01dbf4240178403078760f0e608 Mon Sep 17 00:00:00 2001 From: hc-github-team-tf-provider-devex Date: Wed, 6 Nov 2024 17:12:18 +0000 Subject: [PATCH 41/71] Update changelog --- .changes/0.20.0.md | 18 ++++++++++++++++++ .../unreleased/BUG FIXES-20241022-163805.yaml | 5 ----- .../unreleased/BUG FIXES-20241022-164013.yaml | 5 ----- .../unreleased/BUG FIXES-20241022-164107.yaml | 5 ----- .../unreleased/FEATURES-20241031-100833.yaml | 5 ----- .../unreleased/FEATURES-20241031-100904.yaml | 5 ----- .../unreleased/FEATURES-20241031-100919.yaml | 5 ----- .changes/unreleased/NOTES-20240909-102809.yaml | 7 ------- CHANGELOG.md | 18 ++++++++++++++++++ 9 files changed, 36 insertions(+), 37 deletions(-) create mode 100644 .changes/0.20.0.md delete mode 100644 .changes/unreleased/BUG FIXES-20241022-163805.yaml delete mode 100644 .changes/unreleased/BUG FIXES-20241022-164013.yaml delete mode 100644 .changes/unreleased/BUG FIXES-20241022-164107.yaml delete mode 100644 .changes/unreleased/FEATURES-20241031-100833.yaml delete mode 100644 .changes/unreleased/FEATURES-20241031-100904.yaml delete mode 100644 .changes/unreleased/FEATURES-20241031-100919.yaml delete mode 100644 .changes/unreleased/NOTES-20240909-102809.yaml diff --git a/.changes/0.20.0.md b/.changes/0.20.0.md new file mode 100644 index 00000000..42e2d498 --- /dev/null +++ b/.changes/0.20.0.md @@ -0,0 +1,18 @@ +## 0.20.0 (November 06, 2024) + +NOTES: + +* all: This Go module has been updated to Go 1.22 per the [Go support policy](https://go.dev/doc/devel/release#policy). It is recommended to review the [Go 1.22 release notes](https://go.dev/doc/go1.22) before upgrading. Any consumers building on earlier Go versions may experience errors. ([#400](https://github.com/hashicorp/terraform-plugin-docs/issues/400)) + +FEATURES: + +* generate: Add support for ephemeral resources ([#415](https://github.com/hashicorp/terraform-plugin-docs/issues/415)) +* migrate: Add support for ephemeral resources ([#415](https://github.com/hashicorp/terraform-plugin-docs/issues/415)) +* validate: Add support for ephemeral resources ([#415](https://github.com/hashicorp/terraform-plugin-docs/issues/415)) + +BUG FIXES: + +* validate: File extension check now runs on `index.*` files instead of just `index.md` files. ([#413](https://github.com/hashicorp/terraform-plugin-docs/issues/413)) +* validate: File extension check now specifies the correct valid extensions in the error message. ([#413](https://github.com/hashicorp/terraform-plugin-docs/issues/413)) +* validate: Front matter check now runs with the correct options on legacy index files. ([#413](https://github.com/hashicorp/terraform-plugin-docs/issues/413)) + diff --git a/.changes/unreleased/BUG FIXES-20241022-163805.yaml b/.changes/unreleased/BUG FIXES-20241022-163805.yaml deleted file mode 100644 index a35ff8bb..00000000 --- a/.changes/unreleased/BUG FIXES-20241022-163805.yaml +++ /dev/null @@ -1,5 +0,0 @@ -kind: BUG FIXES -body: 'validate: File extension check now runs on `index.*` files instead of just `index.md` files.' -time: 2024-10-22T16:38:05.530944-04:00 -custom: - Issue: "413" diff --git a/.changes/unreleased/BUG FIXES-20241022-164013.yaml b/.changes/unreleased/BUG FIXES-20241022-164013.yaml deleted file mode 100644 index 193336c8..00000000 --- a/.changes/unreleased/BUG FIXES-20241022-164013.yaml +++ /dev/null @@ -1,5 +0,0 @@ -kind: BUG FIXES -body: 'validate: File extension check now specifies the correct valid extensions in the error message.' -time: 2024-10-22T16:40:13.832638-04:00 -custom: - Issue: "413" diff --git a/.changes/unreleased/BUG FIXES-20241022-164107.yaml b/.changes/unreleased/BUG FIXES-20241022-164107.yaml deleted file mode 100644 index 584931b1..00000000 --- a/.changes/unreleased/BUG FIXES-20241022-164107.yaml +++ /dev/null @@ -1,5 +0,0 @@ -kind: BUG FIXES -body: 'validate: Front matter check now runs with the correct options on legacy index files.' -time: 2024-10-22T16:41:07.726856-04:00 -custom: - Issue: "413" diff --git a/.changes/unreleased/FEATURES-20241031-100833.yaml b/.changes/unreleased/FEATURES-20241031-100833.yaml deleted file mode 100644 index 0ef815b9..00000000 --- a/.changes/unreleased/FEATURES-20241031-100833.yaml +++ /dev/null @@ -1,5 +0,0 @@ -kind: FEATURES -body: 'generate: Add support for ephemeral resources' -time: 2024-10-31T10:08:33.606686-04:00 -custom: - Issue: "415" diff --git a/.changes/unreleased/FEATURES-20241031-100904.yaml b/.changes/unreleased/FEATURES-20241031-100904.yaml deleted file mode 100644 index 0d8a35e7..00000000 --- a/.changes/unreleased/FEATURES-20241031-100904.yaml +++ /dev/null @@ -1,5 +0,0 @@ -kind: FEATURES -body: 'migrate: Add support for ephemeral resources' -time: 2024-10-31T10:09:04.175251-04:00 -custom: - Issue: "415" diff --git a/.changes/unreleased/FEATURES-20241031-100919.yaml b/.changes/unreleased/FEATURES-20241031-100919.yaml deleted file mode 100644 index 6e2096ea..00000000 --- a/.changes/unreleased/FEATURES-20241031-100919.yaml +++ /dev/null @@ -1,5 +0,0 @@ -kind: FEATURES -body: 'validate: Add support for ephemeral resources' -time: 2024-10-31T10:09:19.716278-04:00 -custom: - Issue: "415" diff --git a/.changes/unreleased/NOTES-20240909-102809.yaml b/.changes/unreleased/NOTES-20240909-102809.yaml deleted file mode 100644 index df9a5848..00000000 --- a/.changes/unreleased/NOTES-20240909-102809.yaml +++ /dev/null @@ -1,7 +0,0 @@ -kind: NOTES -body: 'all: This Go module has been updated to Go 1.22 per the [Go support policy](https://go.dev/doc/devel/release#policy). - It is recommended to review the [Go 1.22 release notes](https://go.dev/doc/go1.22) - before upgrading. Any consumers building on earlier Go versions may experience errors.' -time: 2024-09-09T10:28:09.020608-04:00 -custom: - Issue: "400" diff --git a/CHANGELOG.md b/CHANGELOG.md index 28188581..52f01b97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,21 @@ +## 0.20.0 (November 06, 2024) + +NOTES: + +* all: This Go module has been updated to Go 1.22 per the [Go support policy](https://go.dev/doc/devel/release#policy). It is recommended to review the [Go 1.22 release notes](https://go.dev/doc/go1.22) before upgrading. Any consumers building on earlier Go versions may experience errors. ([#400](https://github.com/hashicorp/terraform-plugin-docs/issues/400)) + +FEATURES: + +* generate: Add support for ephemeral resources ([#415](https://github.com/hashicorp/terraform-plugin-docs/issues/415)) +* migrate: Add support for ephemeral resources ([#415](https://github.com/hashicorp/terraform-plugin-docs/issues/415)) +* validate: Add support for ephemeral resources ([#415](https://github.com/hashicorp/terraform-plugin-docs/issues/415)) + +BUG FIXES: + +* validate: File extension check now runs on `index.*` files instead of just `index.md` files. ([#413](https://github.com/hashicorp/terraform-plugin-docs/issues/413)) +* validate: File extension check now specifies the correct valid extensions in the error message. ([#413](https://github.com/hashicorp/terraform-plugin-docs/issues/413)) +* validate: Front matter check now runs with the correct options on legacy index files. ([#413](https://github.com/hashicorp/terraform-plugin-docs/issues/413)) + ## 0.19.4 (June 04, 2024) NOTES: From 2004e44ee970c07f78889f7525f794c8d3654dfc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Nov 2024 10:45:04 -0500 Subject: [PATCH 42/71] Bump golang.org/x/text from 0.19.0 to 0.20.0 (#418) Bumps [golang.org/x/text](https://github.com/golang/text) from 0.19.0 to 0.20.0. - [Release notes](https://github.com/golang/text/releases) - [Commits](https://github.com/golang/text/compare/v0.19.0...v0.20.0) --- updated-dependencies: - dependency-name: golang.org/x/text dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 57fd2989..7c6e43be 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/zclconf/go-cty v1.15.0 go.abhg.dev/goldmark/frontmatter v0.2.0 golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df - golang.org/x/text v0.19.0 + golang.org/x/text v0.20.0 gopkg.in/yaml.v3 v3.0.1 ) diff --git a/go.sum b/go.sum index 2b362738..701a8f58 100644 --- a/go.sum +++ b/go.sum @@ -155,8 +155,8 @@ golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= -golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= +golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -174,8 +174,8 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= -golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= +golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= From 420915364134482863a08c30d760b4e678b38767 Mon Sep 17 00:00:00 2001 From: "hashicorp-tsccr[bot]" <129506189+hashicorp-tsccr[bot]@users.noreply.github.com> Date: Tue, 19 Nov 2024 10:28:08 -0500 Subject: [PATCH 43/71] Result of tsccr-helper -log-level=info gha update -latest .github/ (#420) Co-authored-by: hashicorp-tsccr[bot] --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7520b64c..4899981c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -93,7 +93,7 @@ jobs: cd .changes sed -e "1{/# /d;}" -e "2{/^$/d;}" ${{ needs.changelog-version.outputs.version }}.md > /tmp/release-notes.txt - - uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0 + - uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6.1.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: From 11fcc790c6f15996e85d47113bff98fb9f39c6ad Mon Sep 17 00:00:00 2001 From: Austin Valle Date: Tue, 26 Nov 2024 09:34:42 -0500 Subject: [PATCH 44/71] all: Fix various bugs related to resource type names that match the provider type name (i.e. no resource type suffix) (#421) * remove launch.json file * bug: skip static files that already exist rather than returning an error * validate: Fixed bug where valid resource type names with the same name as the provider were flagged as invalid * generate: Fixed bug where resource type with same name as provider overwrites all other documentation files * added changelogs * add note to readme --- .../unreleased/BUG FIXES-20241118-125001.yaml | 6 +++ .../unreleased/BUG FIXES-20241118-125100.yaml | 7 +++ .../unreleased/BUG FIXES-20241118-125204.yaml | 6 +++ .gitignore | 3 ++ .vscode/launch.json | 17 ------- README.md | 5 ++ internal/check/file_mismatch.go | 25 ++++++++-- internal/check/file_mismatch_test.go | 47 ++++++++++++++++++- internal/provider/util.go | 14 ++++-- 9 files changed, 102 insertions(+), 28 deletions(-) create mode 100644 .changes/unreleased/BUG FIXES-20241118-125001.yaml create mode 100644 .changes/unreleased/BUG FIXES-20241118-125100.yaml create mode 100644 .changes/unreleased/BUG FIXES-20241118-125204.yaml delete mode 100644 .vscode/launch.json diff --git a/.changes/unreleased/BUG FIXES-20241118-125001.yaml b/.changes/unreleased/BUG FIXES-20241118-125001.yaml new file mode 100644 index 00000000..52155315 --- /dev/null +++ b/.changes/unreleased/BUG FIXES-20241118-125001.yaml @@ -0,0 +1,6 @@ +kind: BUG FIXES +body: 'validate: Fixed a bug that caused false positive validation errors for resource + types that have the same name as the provider.' +time: 2024-11-18T12:50:01.114497-05:00 +custom: + Issue: "419" diff --git a/.changes/unreleased/BUG FIXES-20241118-125100.yaml b/.changes/unreleased/BUG FIXES-20241118-125100.yaml new file mode 100644 index 00000000..0e1f7342 --- /dev/null +++ b/.changes/unreleased/BUG FIXES-20241118-125100.yaml @@ -0,0 +1,7 @@ +kind: BUG FIXES +body: 'generate: Fixed a bug that caused all generated resource documentation to have + the same content when the provider has a resource type with the same name as the + provider.' +time: 2024-11-18T12:51:00.736136-05:00 +custom: + Issue: "419" diff --git a/.changes/unreleased/BUG FIXES-20241118-125204.yaml b/.changes/unreleased/BUG FIXES-20241118-125204.yaml new file mode 100644 index 00000000..17cefc0d --- /dev/null +++ b/.changes/unreleased/BUG FIXES-20241118-125204.yaml @@ -0,0 +1,6 @@ +kind: BUG FIXES +body: 'generate: Fixed a bug that would return an error when a static file exists + in both `templates` and `docs`, which will now be ignored.' +time: 2024-11-18T12:52:04.748022-05:00 +custom: + Issue: "421" diff --git a/.gitignore b/.gitignore index 19e2604d..588539de 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,6 @@ tfproviderdocsgen # JetBrains IDEs files .idea/ *.iws + +# VSCode files +.vscode \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index 8ef33d91..00000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "version": "0.2.0", - "configurations": [ - { - "name": "Launch", - "type": "go", - "request": "launch", - "mode": "auto", - "program": "${workspaceFolder}/cmd/tfplugindocs/", - "env": {}, - "args": [], - // Set this to a directory with the provider source code you - // with which you want to test generation. - "cwd": "${workspaceFolder}/../../hashicorp/terraform-provider-null" - } - ] -} \ No newline at end of file diff --git a/README.md b/README.md index dc1edecc..b1e6d166 100644 --- a/README.md +++ b/README.md @@ -114,6 +114,11 @@ When you run `tfplugindocs`, by default from the root directory of a provider co * Generate function template files, if missing (Requires Terraform v1.8.0+) * Generate ephemeral resource template files, if missing (Requires Terraform v1.10.0+) * Copy all non-template files to the output website directory + +> [!NOTE] +> +> Non-template files that already exist in the output website directory will not be overwritten. + * Process all the remaining templates to generate files for the output website directory For inspiration, you can look at the templates and output of the diff --git a/internal/check/file_mismatch.go b/internal/check/file_mismatch.go index c53827d7..97d78d70 100644 --- a/internal/check/file_mismatch.go +++ b/internal/check/file_mismatch.go @@ -84,7 +84,7 @@ func (check *FileMismatchCheck) Run() error { return result } -// ResourceFileMismatchCheck checks for mismatched files, either missing or extraneous, against the resource/datasouce schema +// ResourceFileMismatchCheck checks for mismatched files, either missing or extraneous, against the resource/datasource schema func (check *FileMismatchCheck) ResourceFileMismatchCheck(files []os.DirEntry, resourceType string, schemas map[string]*tfjson.Schema) error { if len(files) == 0 { log.Printf("[DEBUG] Skipping %s file mismatch checks due to missing file list", resourceType) @@ -200,7 +200,11 @@ func (check *FileMismatchCheck) FunctionFileMismatchCheck(files []os.DirEntry, f func (check *FileMismatchCheck) IgnoreFileMismatch(file string) bool { for _, ignoreResourceName := range check.Options.IgnoreFileMismatch { - if ignoreResourceName == fileResourceName(check.Options.ProviderShortName, file) { + if ignoreResourceName == fileResourceNameWithProvider(check.Options.ProviderShortName, file) { + return true + } else if ignoreResourceName == TrimFileExtension(file) { + // While uncommon, it is valid for a resource type to be named the same as the provider itself. + // https://github.com/hashicorp/terraform-plugin-docs/issues/419 return true } } @@ -219,7 +223,13 @@ func (check *FileMismatchCheck) IgnoreFileMissing(resourceName string) bool { } func fileHasResource(schemaResources map[string]*tfjson.Schema, providerName, file string) bool { - if _, ok := schemaResources[fileResourceName(providerName, file)]; ok { + if _, ok := schemaResources[fileResourceNameWithProvider(providerName, file)]; ok { + return true + } + + // While uncommon, it is valid for a resource type to be named the same as the provider itself. + // https://github.com/hashicorp/terraform-plugin-docs/issues/419 + if _, ok := schemaResources[TrimFileExtension(file)]; ok { return true } @@ -234,7 +244,7 @@ func fileHasFunction(functions map[string]*tfjson.FunctionSignature, file string return false } -func fileResourceName(providerName, fileName string) string { +func fileResourceNameWithProvider(providerName, fileName string) string { resourceSuffix := TrimFileExtension(fileName) return fmt.Sprintf("%s_%s", providerName, resourceSuffix) @@ -244,7 +254,12 @@ func resourceHasFile(files []os.DirEntry, providerName, resourceName string) boo var found bool for _, file := range files { - if fileResourceName(providerName, file.Name()) == resourceName { + if fileResourceNameWithProvider(providerName, file.Name()) == resourceName { + found = true + break + } else if TrimFileExtension(file.Name()) == resourceName { + // While uncommon, it is valid for a resource type to be named the same as the provider itself. + // https://github.com/hashicorp/terraform-plugin-docs/issues/419 found = true break } diff --git a/internal/check/file_mismatch_test.go b/internal/check/file_mismatch_test.go index 50ef8dfc..67f7103d 100644 --- a/internal/check/file_mismatch_test.go +++ b/internal/check/file_mismatch_test.go @@ -82,7 +82,7 @@ func TestFileResourceName(t *testing.T) { testCase := testCase t.Run(name, func(t *testing.T) { t.Parallel() - got := fileResourceName("test", testCase.File) + got := fileResourceNameWithProvider("test", testCase.File) want := testCase.Expect if got != want { @@ -115,6 +115,19 @@ func TestFileMismatchCheck(t *testing.T) { }, }, }, + "all found - resource with no suffix": { + ResourceFiles: fstest.MapFS{ + "test.md": {}, + }, + Options: &FileMismatchOptions{ + ProviderShortName: "test", + Schema: &tfjson.ProviderSchema{ + ResourceSchemas: map[string]*tfjson.Schema{ + "test": {}, + }, + }, + }, + }, "all found - function": { FunctionFiles: fstest.MapFS{ "function1.md": {}, @@ -181,6 +194,23 @@ func TestFileMismatchCheck(t *testing.T) { }, }, }, + "ignore extra file - resource with no suffix": { + ResourceFiles: fstest.MapFS{ + "resource1.md": {}, + "resource2.md": {}, + "test.md": {}, + }, + Options: &FileMismatchOptions{ + IgnoreFileMismatch: []string{"test"}, + ProviderShortName: "test", + Schema: &tfjson.ProviderSchema{ + ResourceSchemas: map[string]*tfjson.Schema{ + "test_resource1": {}, + "test_resource2": {}, + }, + }, + }, + }, "ignore extra file - function": { FunctionFiles: fstest.MapFS{ "function1.md": {}, @@ -214,6 +244,21 @@ func TestFileMismatchCheck(t *testing.T) { }, ExpectError: true, }, + "missing file - resource with no suffix": { + ResourceFiles: fstest.MapFS{ + "resource1.md": {}, + }, + Options: &FileMismatchOptions{ + ProviderShortName: "test", + Schema: &tfjson.ProviderSchema{ + ResourceSchemas: map[string]*tfjson.Schema{ + "test_resource1": {}, + "test": {}, + }, + }, + }, + ExpectError: true, + }, "missing file - function": { FunctionFiles: fstest.MapFS{ "function1.md": {}, diff --git a/internal/provider/util.go b/internal/provider/util.go index 7a3ec336..9041cf01 100644 --- a/internal/provider/util.go +++ b/internal/provider/util.go @@ -4,6 +4,7 @@ package provider import ( + "errors" "fmt" "io" "log" @@ -45,6 +46,10 @@ func copyFile(srcPath, dstPath string, mode os.FileMode) error { // If the destination file already exists, we shouldn't blow it away dstFile, err := os.OpenFile(dstPath, os.O_WRONLY|os.O_CREATE|os.O_EXCL, mode) if err != nil { + // If the file already exists, we can skip it without returning an error. + if errors.Is(err, os.ErrExist) { + return nil + } return err } defer dstFile.Close() @@ -71,16 +76,15 @@ func removeAllExt(file string) string { // has either the providerShortName or the providerShortName concatenated with the // templateFileName (stripped of file extension. func resourceSchema(schemas map[string]*tfjson.Schema, providerShortName, templateFileName string) (*tfjson.Schema, string) { - if schema, ok := schemas[providerShortName]; ok { - return schema, providerShortName - } - resName := providerShortName + "_" + removeAllExt(templateFileName) - if schema, ok := schemas[resName]; ok { return schema, resName } + if schema, ok := schemas[providerShortName]; ok { + return schema, providerShortName + } + return nil, resName } From ac7d19a54ec8a524bb8ed280d6c83c60537e628a Mon Sep 17 00:00:00 2001 From: hc-github-team-tf-provider-devex Date: Tue, 26 Nov 2024 14:35:54 +0000 Subject: [PATCH 45/71] Update changelog --- .changes/0.20.1.md | 8 ++++++++ .changes/unreleased/BUG FIXES-20241118-125001.yaml | 6 ------ .changes/unreleased/BUG FIXES-20241118-125100.yaml | 7 ------- .changes/unreleased/BUG FIXES-20241118-125204.yaml | 6 ------ CHANGELOG.md | 8 ++++++++ 5 files changed, 16 insertions(+), 19 deletions(-) create mode 100644 .changes/0.20.1.md delete mode 100644 .changes/unreleased/BUG FIXES-20241118-125001.yaml delete mode 100644 .changes/unreleased/BUG FIXES-20241118-125100.yaml delete mode 100644 .changes/unreleased/BUG FIXES-20241118-125204.yaml diff --git a/.changes/0.20.1.md b/.changes/0.20.1.md new file mode 100644 index 00000000..dfe21ccb --- /dev/null +++ b/.changes/0.20.1.md @@ -0,0 +1,8 @@ +## 0.20.1 (November 26, 2024) + +BUG FIXES: + +* validate: Fixed a bug that caused false positive validation errors for resource types that have the same name as the provider. ([#419](https://github.com/hashicorp/terraform-plugin-docs/issues/419)) +* generate: Fixed a bug that caused all generated resource documentation to have the same content when the provider has a resource type with the same name as the provider. ([#419](https://github.com/hashicorp/terraform-plugin-docs/issues/419)) +* generate: Fixed a bug that would return an error when a static file exists in both `templates` and `docs`, which will now be ignored. ([#421](https://github.com/hashicorp/terraform-plugin-docs/issues/421)) + diff --git a/.changes/unreleased/BUG FIXES-20241118-125001.yaml b/.changes/unreleased/BUG FIXES-20241118-125001.yaml deleted file mode 100644 index 52155315..00000000 --- a/.changes/unreleased/BUG FIXES-20241118-125001.yaml +++ /dev/null @@ -1,6 +0,0 @@ -kind: BUG FIXES -body: 'validate: Fixed a bug that caused false positive validation errors for resource - types that have the same name as the provider.' -time: 2024-11-18T12:50:01.114497-05:00 -custom: - Issue: "419" diff --git a/.changes/unreleased/BUG FIXES-20241118-125100.yaml b/.changes/unreleased/BUG FIXES-20241118-125100.yaml deleted file mode 100644 index 0e1f7342..00000000 --- a/.changes/unreleased/BUG FIXES-20241118-125100.yaml +++ /dev/null @@ -1,7 +0,0 @@ -kind: BUG FIXES -body: 'generate: Fixed a bug that caused all generated resource documentation to have - the same content when the provider has a resource type with the same name as the - provider.' -time: 2024-11-18T12:51:00.736136-05:00 -custom: - Issue: "419" diff --git a/.changes/unreleased/BUG FIXES-20241118-125204.yaml b/.changes/unreleased/BUG FIXES-20241118-125204.yaml deleted file mode 100644 index 17cefc0d..00000000 --- a/.changes/unreleased/BUG FIXES-20241118-125204.yaml +++ /dev/null @@ -1,6 +0,0 @@ -kind: BUG FIXES -body: 'generate: Fixed a bug that would return an error when a static file exists - in both `templates` and `docs`, which will now be ignored.' -time: 2024-11-18T12:52:04.748022-05:00 -custom: - Issue: "421" diff --git a/CHANGELOG.md b/CHANGELOG.md index 52f01b97..2f9b32e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## 0.20.1 (November 26, 2024) + +BUG FIXES: + +* validate: Fixed a bug that caused false positive validation errors for resource types that have the same name as the provider. ([#419](https://github.com/hashicorp/terraform-plugin-docs/issues/419)) +* generate: Fixed a bug that caused all generated resource documentation to have the same content when the provider has a resource type with the same name as the provider. ([#419](https://github.com/hashicorp/terraform-plugin-docs/issues/419)) +* generate: Fixed a bug that would return an error when a static file exists in both `templates` and `docs`, which will now be ignored. ([#421](https://github.com/hashicorp/terraform-plugin-docs/issues/421)) + ## 0.20.0 (November 06, 2024) NOTES: From f242f7bbda1b5f7d1a447e6897e42da3fa50a4eb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Dec 2024 07:47:16 -0500 Subject: [PATCH 46/71] Bump github.com/zclconf/go-cty from 1.15.0 to 1.15.1 (#422) Bumps [github.com/zclconf/go-cty](https://github.com/zclconf/go-cty) from 1.15.0 to 1.15.1. - [Release notes](https://github.com/zclconf/go-cty/releases) - [Changelog](https://github.com/zclconf/go-cty/blob/main/CHANGELOG.md) - [Commits](https://github.com/zclconf/go-cty/compare/v1.15.0...v1.15.1) --- updated-dependencies: - dependency-name: github.com/zclconf/go-cty dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 7c6e43be..b0e1dc13 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/rogpeppe/go-internal v1.13.1 github.com/yuin/goldmark v1.7.7 github.com/yuin/goldmark-meta v1.1.0 - github.com/zclconf/go-cty v1.15.0 + github.com/zclconf/go-cty v1.15.1 go.abhg.dev/goldmark/frontmatter v0.2.0 golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df golang.org/x/text v0.20.0 diff --git a/go.sum b/go.sum index 701a8f58..00a8d1aa 100644 --- a/go.sum +++ b/go.sum @@ -133,8 +133,8 @@ github.com/yuin/goldmark v1.7.7 h1:5m9rrB1sW3JUMToKFQfb+FGt1U7r57IHu5GrYrG2nqU= github.com/yuin/goldmark v1.7.7/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= github.com/yuin/goldmark-meta v1.1.0 h1:pWw+JLHGZe8Rk0EGsMVssiNb/AaPMHfSRszZeUeiOUc= github.com/yuin/goldmark-meta v1.1.0/go.mod h1:U4spWENafuA7Zyg+Lj5RqK/MF+ovMYtBvXi1lBb2VP0= -github.com/zclconf/go-cty v1.15.0 h1:tTCRWxsexYUmtt/wVxgDClUe+uQusuI443uL6e+5sXQ= -github.com/zclconf/go-cty v1.15.0/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= +github.com/zclconf/go-cty v1.15.1 h1:RgQYm4j2EvoBRXOPxhUvxPzRrGDo1eCOhHXuGfrj5S0= +github.com/zclconf/go-cty v1.15.1/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= go.abhg.dev/goldmark/frontmatter v0.2.0 h1:P8kPG0YkL12+aYk2yU3xHv4tcXzeVnN+gU0tJ5JnxRw= go.abhg.dev/goldmark/frontmatter v0.2.0/go.mod h1:XqrEkZuM57djk7zrlRUB02x8I5J0px76YjkOzhB4YlU= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= From 02e035bfd1df5c97429fee749a75640a097e275f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 4 Dec 2024 13:05:29 -0500 Subject: [PATCH 47/71] Bump golang.org/x/text from 0.20.0 to 0.21.0 (#423) Bumps [golang.org/x/text](https://github.com/golang/text) from 0.20.0 to 0.21.0. - [Release notes](https://github.com/golang/text/releases) - [Commits](https://github.com/golang/text/compare/v0.20.0...v0.21.0) --- updated-dependencies: - dependency-name: golang.org/x/text dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index b0e1dc13..3296b92e 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/zclconf/go-cty v1.15.1 go.abhg.dev/goldmark/frontmatter v0.2.0 golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df - golang.org/x/text v0.20.0 + golang.org/x/text v0.21.0 gopkg.in/yaml.v3 v3.0.1 ) diff --git a/go.sum b/go.sum index 00a8d1aa..b0c94766 100644 --- a/go.sum +++ b/go.sum @@ -155,8 +155,8 @@ golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= -golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -174,8 +174,8 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= From 634a6d57d04c7dd3c0f527d27e2263a1ed498b22 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 15:54:06 -0500 Subject: [PATCH 48/71] Bump github.com/hashicorp/terraform-json from 0.23.0 to 0.24.0 (#425) Bumps [github.com/hashicorp/terraform-json](https://github.com/hashicorp/terraform-json) from 0.23.0 to 0.24.0. - [Release notes](https://github.com/hashicorp/terraform-json/releases) - [Commits](https://github.com/hashicorp/terraform-json/compare/v0.23.0...v0.24.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-json dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 3296b92e..8af44ad6 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/hashicorp/go-version v1.7.0 github.com/hashicorp/hc-install v0.9.0 github.com/hashicorp/terraform-exec v0.21.0 - github.com/hashicorp/terraform-json v0.23.0 + github.com/hashicorp/terraform-json v0.24.0 github.com/mattn/go-colorable v0.1.13 github.com/rogpeppe/go-internal v1.13.1 github.com/yuin/goldmark v1.7.7 diff --git a/go.sum b/go.sum index b0c94766..c9d30f2f 100644 --- a/go.sum +++ b/go.sum @@ -74,8 +74,8 @@ github.com/hashicorp/hc-install v0.9.0 h1:2dIk8LcvANwtv3QZLckxcjyF5w8KVtiMxu6G6e github.com/hashicorp/hc-install v0.9.0/go.mod h1:+6vOP+mf3tuGgMApVYtmsnDoKWMDcFXeTxCACYZ8SFg= github.com/hashicorp/terraform-exec v0.21.0 h1:uNkLAe95ey5Uux6KJdua6+cv8asgILFVWkd/RG0D2XQ= github.com/hashicorp/terraform-exec v0.21.0/go.mod h1:1PPeMYou+KDUSSeRE9szMZ/oHf4fYUmB923Wzbq1ICg= -github.com/hashicorp/terraform-json v0.23.0 h1:sniCkExU4iKtTADReHzACkk8fnpQXrdD2xoR+lppBkI= -github.com/hashicorp/terraform-json v0.23.0/go.mod h1:MHdXbBAbSg0GvzuWazEGKAn/cyNfIB7mN6y7KJN6y2c= +github.com/hashicorp/terraform-json v0.24.0 h1:rUiyF+x1kYawXeRth6fKFm/MdfBS6+lW4NbeATsYz8Q= +github.com/hashicorp/terraform-json v0.24.0/go.mod h1:Nfj5ubo9xbu9uiAoZVBsNOjvNKB66Oyrvtit74kC7ow= github.com/huandu/xstrings v1.3.3 h1:/Gcsuc1x8JVbJ9/rlye4xZnVAbEkGauT8lbebqcQws4= github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= From 68d389388192bb076daac3a168af1c9bbc5a1e93 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 16:42:08 -0500 Subject: [PATCH 49/71] Bump golang.org/x/crypto from 0.21.0 to 0.31.0 (#424) Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.21.0 to 0.31.0. - [Commits](https://github.com/golang/crypto/compare/v0.21.0...v0.31.0) --- updated-dependencies: - dependency-name: golang.org/x/crypto dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 8af44ad6..0cdb6699 100644 --- a/go.mod +++ b/go.mod @@ -49,9 +49,9 @@ require ( github.com/posener/complete v1.2.3 // indirect github.com/shopspring/decimal v1.3.1 // indirect github.com/spf13/cast v1.5.0 // indirect - golang.org/x/crypto v0.21.0 // indirect + golang.org/x/crypto v0.31.0 // indirect golang.org/x/mod v0.21.0 // indirect - golang.org/x/sys v0.21.0 // indirect + golang.org/x/sys v0.28.0 // indirect golang.org/x/tools v0.22.0 // indirect gopkg.in/yaml.v2 v2.3.0 // indirect ) diff --git a/go.sum b/go.sum index c9d30f2f..cf4167af 100644 --- a/go.sum +++ b/go.sum @@ -140,8 +140,8 @@ go.abhg.dev/goldmark/frontmatter v0.2.0/go.mod h1:XqrEkZuM57djk7zrlRUB02x8I5J0px golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= +golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df h1:UA2aFVmmsIlefxMk29Dp2juaUSth8Pyn3Tq5Y5mJGME= golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= @@ -165,8 +165,8 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= +golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= From c381ec795c33e612a6d219481dcfdaa0f1a2ce38 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 17:27:11 -0500 Subject: [PATCH 50/71] Bump golang.org/x/crypto from 0.21.0 to 0.31.0 in /tools (#426) Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.21.0 to 0.31.0. - [Commits](https://github.com/golang/crypto/compare/v0.21.0...v0.31.0) --- updated-dependencies: - dependency-name: golang.org/x/crypto dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- tools/go.mod | 10 +++++----- tools/go.sum | 19 ++++++++++--------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/tools/go.mod b/tools/go.mod index 738e2a3d..7b8b122b 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -52,14 +52,14 @@ require ( github.com/thanhpk/randstr v1.0.4 // indirect github.com/thlib/go-timezone-local v0.0.0-20210907160436-ef149e42d28e // indirect go.mongodb.org/mongo-driver v1.10.0 // indirect - golang.org/x/crypto v0.21.0 // indirect + golang.org/x/crypto v0.31.0 // indirect golang.org/x/exp v0.0.0-20220303212507-bbda1eaf7a17 // indirect golang.org/x/net v0.23.0 // indirect golang.org/x/oauth2 v0.8.0 // indirect - golang.org/x/sync v0.1.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/term v0.18.0 // indirect - golang.org/x/text v0.14.0 // indirect + golang.org/x/sync v0.10.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/term v0.27.0 // indirect + golang.org/x/text v0.21.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/tools/go.sum b/tools/go.sum index cfc168fa..cd15f5ed 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -384,8 +384,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= +golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20220303212507-bbda1eaf7a17 h1:3MTrJm4PyNL9NBqvYDSj3DHl46qQakyfqfWo4jgfaEM= golang.org/x/exp v0.0.0-20220303212507-bbda1eaf7a17/go.mod h1:lgLbSvA5ygNOMpwM/9anMpWVlVJ7Z+cHWq/eFuinpGE= @@ -441,8 +441,9 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -493,8 +494,8 @@ golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= +golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210503060354-a79de5458b56/go.mod h1:tfny5GFUkzUvx4ps4ajbZsCe5lw1metzhBm9T3x7oIY= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -502,8 +503,8 @@ golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= +golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= @@ -515,8 +516,8 @@ golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= From 4cbf9a2404c5efb6e5af7111c259484c2f209487 Mon Sep 17 00:00:00 2001 From: "hashicorp-tsccr[bot]" <129506189+hashicorp-tsccr[bot]@users.noreply.github.com> Date: Thu, 2 Jan 2025 09:47:36 -0500 Subject: [PATCH 51/71] Result of tsccr-helper -log-level=info gha update -latest .github/ (#428) Co-authored-by: hashicorp-tsccr[bot] --- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4899981c..da041590 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -84,7 +84,7 @@ jobs: ref: ${{ inputs.versionNumber }} fetch-depth: 0 - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 + - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0 with: go-version-file: 'go.mod' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f275ccac..812668f2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,7 +23,7 @@ jobs: - name: Check out code uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Setup Go - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 + uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0 with: go-version-file: 'go.mod' - name: Run linters From 28f7523c4f3e41a7ac3da6682b6984aff1f1a365 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Jan 2025 15:01:33 -0500 Subject: [PATCH 52/71] Bump github.com/hashicorp/hc-install from 0.9.0 to 0.9.1 (#429) Bumps [github.com/hashicorp/hc-install](https://github.com/hashicorp/hc-install) from 0.9.0 to 0.9.1. - [Release notes](https://github.com/hashicorp/hc-install/releases) - [Commits](https://github.com/hashicorp/hc-install/compare/v0.9.0...v0.9.1) --- updated-dependencies: - dependency-name: github.com/hashicorp/hc-install dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 6 +++--- go.sum | 32 ++++++++++++++++---------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/go.mod b/go.mod index 0cdb6699..a059c784 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/google/go-cmp v0.6.0 github.com/hashicorp/cli v1.1.6 github.com/hashicorp/go-version v1.7.0 - github.com/hashicorp/hc-install v0.9.0 + github.com/hashicorp/hc-install v0.9.1 github.com/hashicorp/terraform-exec v0.21.0 github.com/hashicorp/terraform-json v0.24.0 github.com/mattn/go-colorable v0.1.13 @@ -27,7 +27,7 @@ require ( github.com/Masterminds/goutils v1.1.1 // indirect github.com/Masterminds/semver/v3 v3.2.0 // indirect github.com/Masterminds/sprig/v3 v3.2.3 // indirect - github.com/ProtonMail/go-crypto v1.1.0-alpha.2 // indirect + github.com/ProtonMail/go-crypto v1.1.3 // indirect github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect github.com/armon/go-radix v1.0.0 // indirect github.com/bgentry/speakeasy v0.1.0 // indirect @@ -50,7 +50,7 @@ require ( github.com/shopspring/decimal v1.3.1 // indirect github.com/spf13/cast v1.5.0 // indirect golang.org/x/crypto v0.31.0 // indirect - golang.org/x/mod v0.21.0 // indirect + golang.org/x/mod v0.22.0 // indirect golang.org/x/sys v0.28.0 // indirect golang.org/x/tools v0.22.0 // indirect gopkg.in/yaml.v2 v2.3.0 // indirect diff --git a/go.sum b/go.sum index cf4167af..0ac81681 100644 --- a/go.sum +++ b/go.sum @@ -12,8 +12,8 @@ github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= -github.com/ProtonMail/go-crypto v1.1.0-alpha.2 h1:bkyFVUP+ROOARdgCiJzNQo2V2kiB97LyUpzH9P6Hrlg= -github.com/ProtonMail/go-crypto v1.1.0-alpha.2/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE= +github.com/ProtonMail/go-crypto v1.1.3 h1:nRBOetoydLeUb4nHajyO2bKqMLfWQ/ZPwkXqXxPxCFk= +github.com/ProtonMail/go-crypto v1.1.3/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE= github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew1u1fNQOlOtuGxQY= github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4= github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= @@ -24,8 +24,8 @@ github.com/bmatcuk/doublestar/v4 v4.7.1 h1:fdDeAqgT47acgwd9bd9HxJRDmc9UAmPpc+2m0 github.com/bmatcuk/doublestar/v4 v4.7.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= -github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= -github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= +github.com/cyphar/filepath-securejoin v0.2.5 h1:6iR5tXJ/e6tJZzzdMc1km3Sa7RRIVBKAK32O2s7AYfo= +github.com/cyphar/filepath-securejoin v0.2.5/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -37,10 +37,10 @@ github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3 github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= -github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU= -github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow= -github.com/go-git/go-git/v5 v5.12.0 h1:7Md+ndsjrzZxbddRDZjF14qK+NN56sy6wkqaVrjZtys= -github.com/go-git/go-git/v5 v5.12.0/go.mod h1:FTM9VKtnI2m65hNI/TenDDDnUf2Q9FHnXYjuz9i5OEY= +github.com/go-git/go-billy/v5 v5.6.0 h1:w2hPNtoehvJIxR00Vb4xX94qHQi/ApZfX+nBE2Cjio8= +github.com/go-git/go-billy/v5 v5.6.0/go.mod h1:sFDq7xD3fn3E0GOwUSZqHo9lrkmx8xJhA0ZrfvjBRGM= +github.com/go-git/go-git/v5 v5.13.0 h1:vLn5wlGIh/X78El6r3Jr+30W16Blk0CTcxTYcYPWi5E= +github.com/go-git/go-git/v5 v5.13.0/go.mod h1:Wjo7/JyVKtQgUNdXYXIepzWfJQkUEIGvkvVkiXRR/zw= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= @@ -70,8 +70,8 @@ github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/C github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/hc-install v0.9.0 h1:2dIk8LcvANwtv3QZLckxcjyF5w8KVtiMxu6G6eLhghE= -github.com/hashicorp/hc-install v0.9.0/go.mod h1:+6vOP+mf3tuGgMApVYtmsnDoKWMDcFXeTxCACYZ8SFg= +github.com/hashicorp/hc-install v0.9.1 h1:gkqTfE3vVbafGQo6VZXcy2v5yoz2bE0+nhZXruCuODQ= +github.com/hashicorp/hc-install v0.9.1/go.mod h1:pWWvN/IrfeBK4XPeXXYkL6EjMufHkCK5DvwxeLKuBf0= github.com/hashicorp/terraform-exec v0.21.0 h1:uNkLAe95ey5Uux6KJdua6+cv8asgILFVWkd/RG0D2XQ= github.com/hashicorp/terraform-exec v0.21.0/go.mod h1:1PPeMYou+KDUSSeRE9szMZ/oHf4fYUmB923Wzbq1ICg= github.com/hashicorp/terraform-json v0.24.0 h1:rUiyF+x1kYawXeRth6fKFm/MdfBS6+lW4NbeATsYz8Q= @@ -115,8 +115,8 @@ github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/skeema/knownhosts v1.2.2 h1:Iug2P4fLmDw9f41PB6thxUkNUkJzB5i+1/exaj40L3A= -github.com/skeema/knownhosts v1.2.2/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo= +github.com/skeema/knownhosts v1.3.0 h1:AM+y0rI04VksttfwjkSTNQorvGqmwATnvnAHpSgc0LY= +github.com/skeema/knownhosts v1.3.0/go.mod h1:sPINvnADmT/qYH1kfv+ePMmOBTH6Tbl7b5LvTDjFK7M= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= @@ -145,14 +145,14 @@ golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ss golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df h1:UA2aFVmmsIlefxMk29Dp2juaUSth8Pyn3Tq5Y5mJGME= golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= -golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= +golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4= +golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= From 0434f031a1f63cc02c5d7dd3dade0c49c800edc7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Jan 2025 15:07:39 -0500 Subject: [PATCH 53/71] Bump github.com/zclconf/go-cty from 1.15.1 to 1.16.0 (#430) Bumps [github.com/zclconf/go-cty](https://github.com/zclconf/go-cty) from 1.15.1 to 1.16.0. - [Release notes](https://github.com/zclconf/go-cty/releases) - [Changelog](https://github.com/zclconf/go-cty/blob/main/CHANGELOG.md) - [Commits](https://github.com/zclconf/go-cty/compare/v1.15.1...v1.16.0) --- updated-dependencies: - dependency-name: github.com/zclconf/go-cty dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index a059c784..ff5747d5 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/rogpeppe/go-internal v1.13.1 github.com/yuin/goldmark v1.7.7 github.com/yuin/goldmark-meta v1.1.0 - github.com/zclconf/go-cty v1.15.1 + github.com/zclconf/go-cty v1.16.0 go.abhg.dev/goldmark/frontmatter v0.2.0 golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df golang.org/x/text v0.21.0 diff --git a/go.sum b/go.sum index 0ac81681..e5b47060 100644 --- a/go.sum +++ b/go.sum @@ -133,8 +133,8 @@ github.com/yuin/goldmark v1.7.7 h1:5m9rrB1sW3JUMToKFQfb+FGt1U7r57IHu5GrYrG2nqU= github.com/yuin/goldmark v1.7.7/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= github.com/yuin/goldmark-meta v1.1.0 h1:pWw+JLHGZe8Rk0EGsMVssiNb/AaPMHfSRszZeUeiOUc= github.com/yuin/goldmark-meta v1.1.0/go.mod h1:U4spWENafuA7Zyg+Lj5RqK/MF+ovMYtBvXi1lBb2VP0= -github.com/zclconf/go-cty v1.15.1 h1:RgQYm4j2EvoBRXOPxhUvxPzRrGDo1eCOhHXuGfrj5S0= -github.com/zclconf/go-cty v1.15.1/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= +github.com/zclconf/go-cty v1.16.0 h1:xPKEhst+BW5D0wxebMZkxgapvOE/dw7bFTlgSc9nD6w= +github.com/zclconf/go-cty v1.16.0/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= go.abhg.dev/goldmark/frontmatter v0.2.0 h1:P8kPG0YkL12+aYk2yU3xHv4tcXzeVnN+gU0tJ5JnxRw= go.abhg.dev/goldmark/frontmatter v0.2.0/go.mod h1:XqrEkZuM57djk7zrlRUB02x8I5J0px76YjkOzhB4YlU= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= From a9c737d5accfd312e40b5d54fe2241405606697c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 Jan 2025 15:39:26 -0500 Subject: [PATCH 54/71] Bump github.com/mattn/go-colorable from 0.1.13 to 0.1.14 (#431) Bumps [github.com/mattn/go-colorable](https://github.com/mattn/go-colorable) from 0.1.13 to 0.1.14. - [Commits](https://github.com/mattn/go-colorable/compare/v0.1.13...v0.1.14) --- updated-dependencies: - dependency-name: github.com/mattn/go-colorable dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 4 ++-- go.sum | 10 ++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index ff5747d5..21cd5102 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/hashicorp/hc-install v0.9.1 github.com/hashicorp/terraform-exec v0.21.0 github.com/hashicorp/terraform-json v0.24.0 - github.com/mattn/go-colorable v0.1.13 + github.com/mattn/go-colorable v0.1.14 github.com/rogpeppe/go-internal v1.13.1 github.com/yuin/goldmark v1.7.7 github.com/yuin/goldmark-meta v1.1.0 @@ -51,7 +51,7 @@ require ( github.com/spf13/cast v1.5.0 // indirect golang.org/x/crypto v0.31.0 // indirect golang.org/x/mod v0.22.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/sys v0.29.0 // indirect golang.org/x/tools v0.22.0 // indirect gopkg.in/yaml.v2 v2.3.0 // indirect ) diff --git a/go.sum b/go.sum index e5b47060..206066e8 100644 --- a/go.sum +++ b/go.sum @@ -89,9 +89,8 @@ github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= -github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= -github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE= +github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= @@ -162,11 +161,10 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= From e788d16d191c1fbeb758646b5af9c54f00c76965 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 Jan 2025 10:10:44 -0500 Subject: [PATCH 55/71] Bump github.com/zclconf/go-cty from 1.16.0 to 1.16.1 (#433) Bumps [github.com/zclconf/go-cty](https://github.com/zclconf/go-cty) from 1.16.0 to 1.16.1. - [Release notes](https://github.com/zclconf/go-cty/releases) - [Changelog](https://github.com/zclconf/go-cty/blob/main/CHANGELOG.md) - [Commits](https://github.com/zclconf/go-cty/compare/v1.16.0...v1.16.1) --- updated-dependencies: - dependency-name: github.com/zclconf/go-cty dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 21cd5102..e954c6af 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/rogpeppe/go-internal v1.13.1 github.com/yuin/goldmark v1.7.7 github.com/yuin/goldmark-meta v1.1.0 - github.com/zclconf/go-cty v1.16.0 + github.com/zclconf/go-cty v1.16.1 go.abhg.dev/goldmark/frontmatter v0.2.0 golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df golang.org/x/text v0.21.0 diff --git a/go.sum b/go.sum index 206066e8..60144f69 100644 --- a/go.sum +++ b/go.sum @@ -132,8 +132,8 @@ github.com/yuin/goldmark v1.7.7 h1:5m9rrB1sW3JUMToKFQfb+FGt1U7r57IHu5GrYrG2nqU= github.com/yuin/goldmark v1.7.7/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= github.com/yuin/goldmark-meta v1.1.0 h1:pWw+JLHGZe8Rk0EGsMVssiNb/AaPMHfSRszZeUeiOUc= github.com/yuin/goldmark-meta v1.1.0/go.mod h1:U4spWENafuA7Zyg+Lj5RqK/MF+ovMYtBvXi1lBb2VP0= -github.com/zclconf/go-cty v1.16.0 h1:xPKEhst+BW5D0wxebMZkxgapvOE/dw7bFTlgSc9nD6w= -github.com/zclconf/go-cty v1.16.0/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= +github.com/zclconf/go-cty v1.16.1 h1:a5TZEPzBFFR53udlIKApXzj8JIF4ZNQ6abH79z5R1S0= +github.com/zclconf/go-cty v1.16.1/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= go.abhg.dev/goldmark/frontmatter v0.2.0 h1:P8kPG0YkL12+aYk2yU3xHv4tcXzeVnN+gU0tJ5JnxRw= go.abhg.dev/goldmark/frontmatter v0.2.0/go.mod h1:XqrEkZuM57djk7zrlRUB02x8I5J0px76YjkOzhB4YlU= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= From 1ab6ea52c79615d25c318e5e641bf00c8bc367d9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 Jan 2025 11:02:38 -0500 Subject: [PATCH 56/71] Bump github.com/bmatcuk/doublestar/v4 from 4.7.1 to 4.8.0 (#432) Bumps [github.com/bmatcuk/doublestar/v4](https://github.com/bmatcuk/doublestar) from 4.7.1 to 4.8.0. - [Release notes](https://github.com/bmatcuk/doublestar/releases) - [Commits](https://github.com/bmatcuk/doublestar/compare/v4.7.1...v4.8.0) --- updated-dependencies: - dependency-name: github.com/bmatcuk/doublestar/v4 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index e954c6af..be29e0c9 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.22.7 require ( github.com/Kunde21/markdownfmt/v3 v3.1.0 - github.com/bmatcuk/doublestar/v4 v4.7.1 + github.com/bmatcuk/doublestar/v4 v4.8.0 github.com/google/go-cmp v0.6.0 github.com/hashicorp/cli v1.1.6 github.com/hashicorp/go-version v1.7.0 diff --git a/go.sum b/go.sum index 60144f69..f19f7fd5 100644 --- a/go.sum +++ b/go.sum @@ -20,8 +20,8 @@ github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bmatcuk/doublestar/v4 v4.7.1 h1:fdDeAqgT47acgwd9bd9HxJRDmc9UAmPpc+2m0CXv75Q= -github.com/bmatcuk/doublestar/v4 v4.7.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= +github.com/bmatcuk/doublestar/v4 v4.8.0 h1:DSXtrypQddoug1459viM9X9D3dp1Z7993fw36I2kNcQ= +github.com/bmatcuk/doublestar/v4 v4.8.0/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= github.com/cyphar/filepath-securejoin v0.2.5 h1:6iR5tXJ/e6tJZzzdMc1km3Sa7RRIVBKAK32O2s7AYfo= From cdf93f32fd8c64fcd67a5d0d6275928dd9574222 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 24 Jan 2025 09:55:23 -0500 Subject: [PATCH 57/71] Bump github.com/hashicorp/terraform-exec from 0.21.0 to 0.22.0 (#435) Bumps [github.com/hashicorp/terraform-exec](https://github.com/hashicorp/terraform-exec) from 0.21.0 to 0.22.0. - [Release notes](https://github.com/hashicorp/terraform-exec/releases) - [Changelog](https://github.com/hashicorp/terraform-exec/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-exec/compare/v0.21.0...v0.22.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-exec dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index be29e0c9..37b01b29 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/hashicorp/cli v1.1.6 github.com/hashicorp/go-version v1.7.0 github.com/hashicorp/hc-install v0.9.1 - github.com/hashicorp/terraform-exec v0.21.0 + github.com/hashicorp/terraform-exec v0.22.0 github.com/hashicorp/terraform-json v0.24.0 github.com/mattn/go-colorable v0.1.14 github.com/rogpeppe/go-internal v1.13.1 diff --git a/go.sum b/go.sum index f19f7fd5..257d98c7 100644 --- a/go.sum +++ b/go.sum @@ -72,8 +72,8 @@ github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKe github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/hc-install v0.9.1 h1:gkqTfE3vVbafGQo6VZXcy2v5yoz2bE0+nhZXruCuODQ= github.com/hashicorp/hc-install v0.9.1/go.mod h1:pWWvN/IrfeBK4XPeXXYkL6EjMufHkCK5DvwxeLKuBf0= -github.com/hashicorp/terraform-exec v0.21.0 h1:uNkLAe95ey5Uux6KJdua6+cv8asgILFVWkd/RG0D2XQ= -github.com/hashicorp/terraform-exec v0.21.0/go.mod h1:1PPeMYou+KDUSSeRE9szMZ/oHf4fYUmB923Wzbq1ICg= +github.com/hashicorp/terraform-exec v0.22.0 h1:G5+4Sz6jYZfRYUCg6eQgDsqTzkNXV+fP8l+uRmZHj64= +github.com/hashicorp/terraform-exec v0.22.0/go.mod h1:bjVbsncaeh8jVdhttWYZuBGj21FcYw6Ia/XfHcNO7lQ= github.com/hashicorp/terraform-json v0.24.0 h1:rUiyF+x1kYawXeRth6fKFm/MdfBS6+lW4NbeATsYz8Q= github.com/hashicorp/terraform-json v0.24.0/go.mod h1:Nfj5ubo9xbu9uiAoZVBsNOjvNKB66Oyrvtit74kC7ow= github.com/huandu/xstrings v1.3.3 h1:/Gcsuc1x8JVbJ9/rlye4xZnVAbEkGauT8lbebqcQws4= From 11035d546d63727eac019c8de81231eb35dc9c42 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 24 Jan 2025 10:00:22 -0500 Subject: [PATCH 58/71] Bump github.com/zclconf/go-cty from 1.16.1 to 1.16.2 (#436) Bumps [github.com/zclconf/go-cty](https://github.com/zclconf/go-cty) from 1.16.1 to 1.16.2. - [Release notes](https://github.com/zclconf/go-cty/releases) - [Changelog](https://github.com/zclconf/go-cty/blob/main/CHANGELOG.md) - [Commits](https://github.com/zclconf/go-cty/compare/v1.16.1...v1.16.2) --- updated-dependencies: - dependency-name: github.com/zclconf/go-cty dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 37b01b29..74208408 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/rogpeppe/go-internal v1.13.1 github.com/yuin/goldmark v1.7.7 github.com/yuin/goldmark-meta v1.1.0 - github.com/zclconf/go-cty v1.16.1 + github.com/zclconf/go-cty v1.16.2 go.abhg.dev/goldmark/frontmatter v0.2.0 golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df golang.org/x/text v0.21.0 diff --git a/go.sum b/go.sum index 257d98c7..8977a427 100644 --- a/go.sum +++ b/go.sum @@ -132,8 +132,8 @@ github.com/yuin/goldmark v1.7.7 h1:5m9rrB1sW3JUMToKFQfb+FGt1U7r57IHu5GrYrG2nqU= github.com/yuin/goldmark v1.7.7/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= github.com/yuin/goldmark-meta v1.1.0 h1:pWw+JLHGZe8Rk0EGsMVssiNb/AaPMHfSRszZeUeiOUc= github.com/yuin/goldmark-meta v1.1.0/go.mod h1:U4spWENafuA7Zyg+Lj5RqK/MF+ovMYtBvXi1lBb2VP0= -github.com/zclconf/go-cty v1.16.1 h1:a5TZEPzBFFR53udlIKApXzj8JIF4ZNQ6abH79z5R1S0= -github.com/zclconf/go-cty v1.16.1/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= +github.com/zclconf/go-cty v1.16.2 h1:LAJSwc3v81IRBZyUVQDUdZ7hs3SYs9jv0eZJDWHD/70= +github.com/zclconf/go-cty v1.16.2/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= go.abhg.dev/goldmark/frontmatter v0.2.0 h1:P8kPG0YkL12+aYk2yU3xHv4tcXzeVnN+gU0tJ5JnxRw= go.abhg.dev/goldmark/frontmatter v0.2.0/go.mod h1:XqrEkZuM57djk7zrlRUB02x8I5J0px76YjkOzhB4YlU= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= From 8e0adff29fea0e5477a6d46d4a935befde58b255 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 24 Jan 2025 10:04:09 -0500 Subject: [PATCH 59/71] Bump golang.org/x/net from 0.23.0 to 0.33.0 in /tools (#437) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.23.0 to 0.33.0. - [Commits](https://github.com/golang/net/compare/v0.23.0...v0.33.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- tools/go.mod | 2 +- tools/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/go.mod b/tools/go.mod index 7b8b122b..796dfdcc 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -54,7 +54,7 @@ require ( go.mongodb.org/mongo-driver v1.10.0 // indirect golang.org/x/crypto v0.31.0 // indirect golang.org/x/exp v0.0.0-20220303212507-bbda1eaf7a17 // indirect - golang.org/x/net v0.23.0 // indirect + golang.org/x/net v0.33.0 // indirect golang.org/x/oauth2 v0.8.0 // indirect golang.org/x/sync v0.10.0 // indirect golang.org/x/sys v0.28.0 // indirect diff --git a/tools/go.sum b/tools/go.sum index cd15f5ed..b8017e0d 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -424,8 +424,8 @@ golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= -golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= From 2c9821ad26edbe301798336928d5e73e04fa2d23 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 24 Jan 2025 14:42:10 -0500 Subject: [PATCH 60/71] Bump github.com/hashicorp/copywrite from 0.19.0 to 0.20.0 in /tools (#438) Bumps [github.com/hashicorp/copywrite](https://github.com/hashicorp/copywrite) from 0.19.0 to 0.20.0. - [Release notes](https://github.com/hashicorp/copywrite/releases) - [Changelog](https://github.com/hashicorp/copywrite/blob/main/.goreleaser.yaml) - [Commits](https://github.com/hashicorp/copywrite/compare/v0.19.0...v0.20.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/copywrite dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- tools/go.mod | 17 ++++++----------- tools/go.sum | 44 ++++++++++++-------------------------------- 2 files changed, 18 insertions(+), 43 deletions(-) diff --git a/tools/go.mod b/tools/go.mod index 796dfdcc..4dbb34ee 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -2,17 +2,16 @@ module tools go 1.22.7 -require github.com/hashicorp/copywrite v0.19.0 +require github.com/hashicorp/copywrite v0.20.0 require ( - github.com/AlecAivazis/survey/v2 v2.3.6 // indirect + github.com/AlecAivazis/survey/v2 v2.3.7 // indirect github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 // indirect github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef // indirect github.com/bmatcuk/doublestar/v4 v4.6.0 // indirect github.com/bradleyfalzon/ghinstallation/v2 v2.5.0 // indirect - github.com/cli/go-gh v1.2.1 // indirect + github.com/cli/go-gh/v2 v2.11.2 // indirect github.com/cli/safeexec v1.0.0 // indirect - github.com/cli/shurcooL-graphql v0.0.2 // indirect github.com/cloudflare/circl v1.3.7 // indirect github.com/fatih/color v1.13.0 // indirect github.com/fsnotify/fsnotify v1.5.4 // indirect @@ -25,32 +24,28 @@ require ( github.com/google/go-querystring v1.1.0 // indirect github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect - github.com/henvic/httpretty v0.0.6 // indirect github.com/inconshreveable/mousetrap v1.0.1 // indirect github.com/jedib0t/go-pretty v4.3.0+incompatible // indirect github.com/jedib0t/go-pretty/v6 v6.4.6 // indirect github.com/joho/godotenv v1.3.0 // indirect github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect github.com/knadh/koanf v1.5.0 // indirect - github.com/lucasb-eyer/go-colorful v1.2.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.19 // indirect - github.com/mattn/go-runewidth v0.0.13 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mattn/go-runewidth v0.0.15 // indirect github.com/mergestat/timediff v0.0.3 // indirect github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect - github.com/muesli/termenv v0.12.0 // indirect github.com/oklog/ulid v1.3.1 // indirect - github.com/rivo/uniseg v0.2.0 // indirect + github.com/rivo/uniseg v0.4.7 // indirect github.com/rogpeppe/go-internal v1.10.0 // indirect github.com/samber/lo v1.37.0 // indirect github.com/spf13/cobra v1.6.1 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/thanhpk/randstr v1.0.4 // indirect - github.com/thlib/go-timezone-local v0.0.0-20210907160436-ef149e42d28e // indirect go.mongodb.org/mongo-driver v1.10.0 // indirect golang.org/x/crypto v0.31.0 // indirect golang.org/x/exp v0.0.0-20220303212507-bbda1eaf7a17 // indirect diff --git a/tools/go.sum b/tools/go.sum index b8017e0d..a889a22a 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -1,8 +1,8 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= -github.com/AlecAivazis/survey/v2 v2.3.6 h1:NvTuVHISgTHEHeBFqt6BHOe4Ny/NwGZr7w+F8S9ziyw= -github.com/AlecAivazis/survey/v2 v2.3.6/go.mod h1:4AuI9b7RjAR+G7v9+C4YSlX/YL3K3cWNXgWXOhllqvI= +github.com/AlecAivazis/survey/v2 v2.3.7 h1:6I/u8FvytdGsgonrYsVn2t8t4QiRnh6QSTqkkhIiSjQ= +github.com/AlecAivazis/survey/v2 v2.3.7/go.mod h1:xUTIdE4KCOIjsBAE1JYsUPoCqYdZ1reCfTwbto0Fduo= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ= github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE= @@ -44,12 +44,10 @@ github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7N github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cli/go-gh v1.2.1 h1:xFrjejSsgPiwXFP6VYynKWwxLQcNJy3Twbu82ZDlR/o= -github.com/cli/go-gh v1.2.1/go.mod h1:Jxk8X+TCO4Ui/GarwY9tByWm/8zp4jJktzVZNlTW5VM= +github.com/cli/go-gh/v2 v2.11.2 h1:oad1+sESTPNTiTvh3I3t8UmxuovNDxhwLzeMHk45Q9w= +github.com/cli/go-gh/v2 v2.11.2/go.mod h1:vVFhi3TfjseIW26ED9itAR8gQK0aVThTm8sYrsZ5QTI= github.com/cli/safeexec v1.0.0 h1:0VngyaIyqACHdcMNWfo6+KdUYnqEr2Sg+bSP1pdF+dI= github.com/cli/safeexec v1.0.0/go.mod h1:Z/D4tTN8Vs5gXYHDCbaM1S/anmEDnJb1iW0+EJ5zx3Q= -github.com/cli/shurcooL-graphql v0.0.2 h1:rwP5/qQQ2fM0TzkUTwtt6E2LbIYf6R+39cUXTa04NYk= -github.com/cli/shurcooL-graphql v0.0.2/go.mod h1:tlrLmw/n5Q/+4qSvosT+9/W5zc8ZMjnJeYBxSdb4nWA= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= @@ -144,12 +142,10 @@ github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslCrtky5vbi9dd7HrQPQIx6wqiw= -github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI= github.com/hashicorp/consul/api v1.13.0/go.mod h1:ZlVrynguJKcYr54zGaDbaL3fOvKC9m72FhPvA8T35KQ= github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= -github.com/hashicorp/copywrite v0.19.0 h1:f9LVxTDBfFYeQmdBpOsZ+HWknXonI8ZwubbO/RwyuCo= -github.com/hashicorp/copywrite v0.19.0/go.mod h1:6wvQH+ICDoD2bpjO1RJ6fi+h3aY5NeLEM12oTkEtFoc= +github.com/hashicorp/copywrite v0.20.0 h1:i+iNq4lWsGopKIhC0HfZjUvNAnXnU/Pc5e+4L5WF+1Y= +github.com/hashicorp/copywrite v0.20.0/go.mod h1:mu6DAyUI6m6vq8weoJn9a0HDuUUrV+0GQdRp4mD50yU= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= @@ -184,8 +180,6 @@ github.com/hashicorp/vault/api v1.0.4/go.mod h1:gDcqh3WGcR1cpF5AJz/B1UFheUEneMoI github.com/hashicorp/vault/sdk v0.1.13/go.mod h1:B+hVj7TpuQY1Y/GPbCpffmgd+tSEwvhkWnjtSYCaS2M= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= -github.com/henvic/httpretty v0.0.6 h1:JdzGzKZBajBfnvlMALXXMVQWxWMF/ofTy8C3/OSUTxs= -github.com/henvic/httpretty v0.0.6/go.mod h1:X38wLjWXHkXT7r2+uK8LjCMne9rsuNaBLJ+5cU2/Pmo= github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec h1:qv2VnGeEQHchGaZ/u7lxST/RaJw+cv273q79D81Xbog= github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec/go.mod h1:Q48J4R4DvxnHolD5P8pOtXigYlRuPLGl6moFx3ulM68= github.com/hjson/hjson-go/v4 v4.0.0 h1:wlm6IYYqHjOdXH1gHev4VoXCaW20HdQAGCxdOEEg2cs= @@ -224,8 +218,6 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= -github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= @@ -241,10 +233,11 @@ github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOA github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= -github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= +github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mergestat/timediff v0.0.3 h1:ucCNh4/ZrTPjFZ081PccNbhx9spymCJkFxSzgVuPU+Y= github.com/mergestat/timediff v0.0.3/go.mod h1:yvMUaRu2oetc+9IbPLYBJviz6sA7xz8OXMDfhBl7YSI= @@ -276,10 +269,6 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= -github.com/muesli/reflow v0.3.0 h1:IFsN6K9NfGtjeggFP+68I4chLZV2yIKsXJFNZ+eWh6s= -github.com/muesli/reflow v0.3.0/go.mod h1:pbwTDkVPibjO2kyvBQRBxTWEEGDGq0FlB1BIKtnHY/8= -github.com/muesli/termenv v0.12.0 h1:KuQRUE3PgxRFWhq4gHvZtPSLCGDqM5q/cYr1pZ39ytc= -github.com/muesli/termenv v0.12.0/go.mod h1:WCCv32tusQ/EEZ5S8oUIIrC/nIuBcxCVqlN4Xfkv+7A= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= @@ -317,8 +306,9 @@ github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsT github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/rhnvrm/simples3 v0.6.1/go.mod h1:Y+3vYm2V7Y4VijFoJHHTrja6OgPrJ2cBti8dPGkC3sA= -github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= +github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= @@ -355,8 +345,6 @@ github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/thanhpk/randstr v1.0.4 h1:IN78qu/bR+My+gHCvMEXhR/i5oriVHcTB/BJJIRTsNo= github.com/thanhpk/randstr v1.0.4/go.mod h1:M/H2P1eNLZzlDwAzpkkkUvoyNNMbzRGhESZuEQk3r0U= -github.com/thlib/go-timezone-local v0.0.0-20210907160436-ef149e42d28e h1:BuzhfgfWQbX0dWzYzT1zsORLnHRv3bcRcsaUk0VmXA8= -github.com/thlib/go-timezone-local v0.0.0-20210907160436-ef149e42d28e/go.mod h1:/Tnicc6m/lsJE0irFMA0LfIwTBo4QP7A8IfyIv4zZKI= github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= @@ -419,7 +407,6 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220923203811-8be639271d50/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= @@ -477,16 +464,12 @@ golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -497,7 +480,6 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210503060354-a79de5458b56/go.mod h1:tfny5GFUkzUvx4ps4ajbZsCe5lw1metzhBm9T3x7oIY= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= @@ -576,8 +558,6 @@ gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/h2non/gock.v1 v1.1.2 h1:jBbHXgGBK/AoPVfJh5x4r/WxIrElvbLel8TCZkkZJoY= -gopkg.in/h2non/gock.v1 v1.1.2/go.mod h1:n7UGz/ckNChHiK05rDoiC4MYSunEC/lyaUm2WWaDva0= gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= From 616b82108830bc5099d7c2d71391229b65533c44 Mon Sep 17 00:00:00 2001 From: "hashicorp-tsccr[bot]" <129506189+hashicorp-tsccr[bot]@users.noreply.github.com> Date: Mon, 27 Jan 2025 10:29:26 -0500 Subject: [PATCH 61/71] Result of tsccr-helper -log-level=info gha update -latest .github/ (#439) Co-authored-by: hashicorp-tsccr[bot] --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 812668f2..dd8c40b7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,7 +27,7 @@ jobs: with: go-version-file: 'go.mod' - name: Run linters - uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1 + uses: golangci/golangci-lint-action@ec5d18412c0aeab7936cb16880d708ba2a64e1ae # v6.2.0 with: version: latest args: --timeout=3m From 301169a1846a3775b2f338445b7d878d7d9234b4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Jan 2025 17:02:50 -0500 Subject: [PATCH 62/71] Bump github.com/bmatcuk/doublestar/v4 from 4.8.0 to 4.8.1 (#440) Bumps [github.com/bmatcuk/doublestar/v4](https://github.com/bmatcuk/doublestar) from 4.8.0 to 4.8.1. - [Release notes](https://github.com/bmatcuk/doublestar/releases) - [Commits](https://github.com/bmatcuk/doublestar/compare/v4.8.0...v4.8.1) --- updated-dependencies: - dependency-name: github.com/bmatcuk/doublestar/v4 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 74208408..1d78b7a0 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.22.7 require ( github.com/Kunde21/markdownfmt/v3 v3.1.0 - github.com/bmatcuk/doublestar/v4 v4.8.0 + github.com/bmatcuk/doublestar/v4 v4.8.1 github.com/google/go-cmp v0.6.0 github.com/hashicorp/cli v1.1.6 github.com/hashicorp/go-version v1.7.0 diff --git a/go.sum b/go.sum index 8977a427..a7a6278b 100644 --- a/go.sum +++ b/go.sum @@ -20,8 +20,8 @@ github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bmatcuk/doublestar/v4 v4.8.0 h1:DSXtrypQddoug1459viM9X9D3dp1Z7993fw36I2kNcQ= -github.com/bmatcuk/doublestar/v4 v4.8.0/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= +github.com/bmatcuk/doublestar/v4 v4.8.1 h1:54Bopc5c2cAvhLRAzqOGCYHYyhcDHsFF4wWIR5wKP38= +github.com/bmatcuk/doublestar/v4 v4.8.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= github.com/cyphar/filepath-securejoin v0.2.5 h1:6iR5tXJ/e6tJZzzdMc1km3Sa7RRIVBKAK32O2s7AYfo= From ecbdcf3a360c38bed6bad6fef9062e5c4598eece Mon Sep 17 00:00:00 2001 From: "hashicorp-tsccr[bot]" <129506189+hashicorp-tsccr[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 12:16:17 -0500 Subject: [PATCH 63/71] Result of tsccr-helper -log-level=info gha update -latest .github/ (#443) Co-authored-by: hashicorp-tsccr[bot] --- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index da041590..6e72b8fc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -84,7 +84,7 @@ jobs: ref: ${{ inputs.versionNumber }} fetch-depth: 0 - - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0 + - uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0 with: go-version-file: 'go.mod' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dd8c40b7..de0c8b29 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,7 +23,7 @@ jobs: - name: Check out code uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Setup Go - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0 + uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0 with: go-version-file: 'go.mod' - name: Run linters From e77d9f683692844067a4b197d2ac5177a0b18c60 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 16:52:20 -0500 Subject: [PATCH 64/71] Bump github.com/hashicorp/cli from 1.1.6 to 1.1.7 (#441) Bumps [github.com/hashicorp/cli](https://github.com/hashicorp/cli) from 1.1.6 to 1.1.7. - [Commits](https://github.com/hashicorp/cli/compare/v1.1.6...v1.1.7) --- updated-dependencies: - dependency-name: github.com/hashicorp/cli dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 1d78b7a0..e90e7c28 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/Kunde21/markdownfmt/v3 v3.1.0 github.com/bmatcuk/doublestar/v4 v4.8.1 github.com/google/go-cmp v0.6.0 - github.com/hashicorp/cli v1.1.6 + github.com/hashicorp/cli v1.1.7 github.com/hashicorp/go-version v1.7.0 github.com/hashicorp/hc-install v0.9.1 github.com/hashicorp/terraform-exec v0.22.0 @@ -49,7 +49,7 @@ require ( github.com/posener/complete v1.2.3 // indirect github.com/shopspring/decimal v1.3.1 // indirect github.com/spf13/cast v1.5.0 // indirect - golang.org/x/crypto v0.31.0 // indirect + golang.org/x/crypto v0.32.0 // indirect golang.org/x/mod v0.22.0 // indirect golang.org/x/sys v0.29.0 // indirect golang.org/x/tools v0.22.0 // indirect diff --git a/go.sum b/go.sum index a7a6278b..91d439da 100644 --- a/go.sum +++ b/go.sum @@ -48,8 +48,8 @@ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/hashicorp/cli v1.1.6 h1:CMOV+/LJfL1tXCOKrgAX0uRKnzjj/mpmqNXloRSy2K8= -github.com/hashicorp/cli v1.1.6/go.mod h1:MPon5QYlgjjo0BSoAiN0ESeT5fRzDjVRp+uioJ0piz4= +github.com/hashicorp/cli v1.1.7 h1:/fZJ+hNdwfTSfsxMBa9WWMlfjUZbX8/LnUxgAd7lCVU= +github.com/hashicorp/cli v1.1.7/go.mod h1:e6Mfpga9OCT1vqzFuoGZiiF/KaG9CbUfO5s3ghU3YgU= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -139,8 +139,8 @@ go.abhg.dev/goldmark/frontmatter v0.2.0/go.mod h1:XqrEkZuM57djk7zrlRUB02x8I5J0px golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= -golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= +golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= +golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df h1:UA2aFVmmsIlefxMk29Dp2juaUSth8Pyn3Tq5Y5mJGME= golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= From 40e402ff186f3018952555ce1ae5f2dc01a61163 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2025 07:46:41 -0500 Subject: [PATCH 65/71] Bump golang.org/x/text from 0.21.0 to 0.22.0 (#444) Bumps [golang.org/x/text](https://github.com/golang/text) from 0.21.0 to 0.22.0. - [Release notes](https://github.com/golang/text/releases) - [Commits](https://github.com/golang/text/compare/v0.21.0...v0.22.0) --- updated-dependencies: - dependency-name: golang.org/x/text dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index e90e7c28..9b2499fd 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/zclconf/go-cty v1.16.2 go.abhg.dev/goldmark/frontmatter v0.2.0 golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df - golang.org/x/text v0.21.0 + golang.org/x/text v0.22.0 gopkg.in/yaml.v3 v3.0.1 ) diff --git a/go.sum b/go.sum index 91d439da..00fc31f1 100644 --- a/go.sum +++ b/go.sum @@ -154,8 +154,8 @@ golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= -golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= +golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -172,8 +172,8 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= -golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= +golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= +golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= From 411d870f2c2dca955f66b6173fac5de612be2097 Mon Sep 17 00:00:00 2001 From: Rain Kwan <91649079+rainkwan@users.noreply.github.com> Date: Thu, 13 Feb 2025 12:20:39 -0500 Subject: [PATCH 66/71] Added write-only support to generate (#434) * Added write-only as a descriptor, handled similarly to "sensitive" * Added write-only tests to respective test files * Ran linter * Added more Write-Only unit tests for nested blocks and attributes * Added acceptance testing * Update internal/schemamd/render.go --------- --- .../unreleased/FEATURES-20250212-165819.yaml | 5 ++ .golangci.yml | 6 +- ...provider_success_all_framework_types.txtar | 8 ++ internal/check/directory_test.go | 2 - internal/check/file_extension_test.go | 2 - internal/check/file_mismatch_test.go | 12 --- internal/check/file_test.go | 4 - internal/check/frontmatter_test.go | 2 - internal/provider/util_test.go | 2 - internal/provider/validate_test.go | 14 --- internal/schemamd/behaviors.go | 2 +- internal/schemamd/behaviors_test.go | 12 +-- internal/schemamd/render_test.go | 6 +- .../deep_nested_write_only_attributes.md | 46 ++++++++++ ...p_nested_write_only_attributes.schema.json | 85 +++++++++++++++++++ internal/schemamd/testdata/framework_types.md | 5 +- .../testdata/framework_types.schema.json | 21 +++++ .../schemamd/write_attribute_description.go | 7 ++ .../write_attribute_description_test.go | 10 ++- .../write_block_type_description_test.go | 1 - ...write_nested_attribute_type_description.go | 7 ++ ..._nested_attribute_type_description_test.go | 19 ++++- internal/schemamd/write_type_test.go | 1 - 23 files changed, 225 insertions(+), 54 deletions(-) create mode 100644 .changes/unreleased/FEATURES-20250212-165819.yaml create mode 100644 internal/schemamd/testdata/deep_nested_write_only_attributes.md create mode 100644 internal/schemamd/testdata/deep_nested_write_only_attributes.schema.json diff --git a/.changes/unreleased/FEATURES-20250212-165819.yaml b/.changes/unreleased/FEATURES-20250212-165819.yaml new file mode 100644 index 00000000..83a5a601 --- /dev/null +++ b/.changes/unreleased/FEATURES-20250212-165819.yaml @@ -0,0 +1,5 @@ +kind: FEATURES +body: 'generate: Add support for write-only arguments' +time: 2025-02-12T16:58:19.098098-05:00 +custom: + Issue: "434" diff --git a/.golangci.yml b/.golangci.yml index 82a43ddd..1e7c56bf 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,13 +1,13 @@ issues: - max-per-linter: 0 + max-issues-per-linter: 0 max-same-issues: 0 linters: disable-all: true enable: + - copyloopvar - durationcheck - errcheck - - exportloopref - forcetypeassert - gofmt - gosimple @@ -19,10 +19,10 @@ linters: - paralleltest - predeclared - staticcheck - - tenv - unconvert - unparam - unused + - usetesting run: # Prevent false positive timeouts in CI diff --git a/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_all_framework_types.txtar b/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_all_framework_types.txtar index b58019ee..e98192bb 100644 --- a/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_all_framework_types.txtar +++ b/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_all_framework_types.txtar @@ -93,6 +93,7 @@ example resource - `single_nested_block` (Block, Optional) example single nested block (see [below for nested schema](#nestedblock--single_nested_block)) - `single_nested_block_sensitive_nested_attribute` (Block, Optional) example sensitive single nested block (see [below for nested schema](#nestedblock--single_nested_block_sensitive_nested_attribute)) - `string_attribute` (String) example string attribute +- `write_only_string_attribute` (String, Write-only) example write-only string attribute ### Read-Only @@ -418,6 +419,13 @@ scaffolding(stringInput string, boolInput bool, float64Input number, int64Input "description": "example string attribute", "description_kind": "markdown", "optional": true + }, + "write_only_string_attribute": { + "type": "string", + "description": "example write-only string attribute", + "description_kind": "markdown", + "optional": true, + "write_only": true } }, "block_types": { diff --git a/internal/check/directory_test.go b/internal/check/directory_test.go index b2432de5..274705c5 100644 --- a/internal/check/directory_test.go +++ b/internal/check/directory_test.go @@ -111,8 +111,6 @@ func TestMixedDirectoriesCheck(t *testing.T) { } for name, testCase := range testCases { - name := name - testCase := testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/internal/check/file_extension_test.go b/internal/check/file_extension_test.go index 15d756c4..e195c4f3 100644 --- a/internal/check/file_extension_test.go +++ b/internal/check/file_extension_test.go @@ -36,8 +36,6 @@ func TestTrimFileExtension(t *testing.T) { } for name, testCase := range testCases { - name := name - testCase := testCase t.Run(name, func(t *testing.T) { t.Parallel() got := TrimFileExtension(testCase.Path) diff --git a/internal/check/file_mismatch_test.go b/internal/check/file_mismatch_test.go index 67f7103d..4beecc5f 100644 --- a/internal/check/file_mismatch_test.go +++ b/internal/check/file_mismatch_test.go @@ -38,8 +38,6 @@ func TestFileHasResource(t *testing.T) { } for name, testCase := range testCases { - name := name - testCase := testCase t.Run(name, func(t *testing.T) { t.Parallel() @@ -78,8 +76,6 @@ func TestFileResourceName(t *testing.T) { } for name, testCase := range testCases { - name := name - testCase := testCase t.Run(name, func(t *testing.T) { t.Parallel() got := fileResourceNameWithProvider("test", testCase.File) @@ -333,8 +329,6 @@ func TestFileMismatchCheck(t *testing.T) { } for name, testCase := range testCases { - name := name - testCase := testCase t.Run(name, func(t *testing.T) { t.Parallel() @@ -381,8 +375,6 @@ func TestResourceHasFile(t *testing.T) { } for name, testCase := range testCases { - name := name - testCase := testCase t.Run(name, func(t *testing.T) { t.Parallel() @@ -424,8 +416,6 @@ func TestFunctionHasFile(t *testing.T) { } for name, testCase := range testCases { - name := name - testCase := testCase t.Run(name, func(t *testing.T) { t.Parallel() @@ -464,8 +454,6 @@ func TestResourceNames(t *testing.T) { } for name, testCase := range testCases { - name := name - testCase := testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/internal/check/file_test.go b/internal/check/file_test.go index d29a7e7f..8573b22c 100644 --- a/internal/check/file_test.go +++ b/internal/check/file_test.go @@ -43,8 +43,6 @@ func TestFileSizeCheck(t *testing.T) { } for name, testCase := range testCases { - name := name - testCase := testCase t.Run(name, func(t *testing.T) { t.Parallel() @@ -83,8 +81,6 @@ func TestFullPath(t *testing.T) { } for name, testCase := range testCases { - name := name - testCase := testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/internal/check/frontmatter_test.go b/internal/check/frontmatter_test.go index 9189b0de..b915eb98 100644 --- a/internal/check/frontmatter_test.go +++ b/internal/check/frontmatter_test.go @@ -141,8 +141,6 @@ subcategory: Example Subcategory } for name, testCase := range testCases { - name := name - testCase := testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/internal/provider/util_test.go b/internal/provider/util_test.go index 0e04f13e..8a1bc80c 100644 --- a/internal/provider/util_test.go +++ b/internal/provider/util_test.go @@ -68,8 +68,6 @@ func Test_resourceSchema(t *testing.T) { } for name, c := range cases { - name := name - c := c t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/internal/provider/validate_test.go b/internal/provider/validate_test.go index 03de43a3..3e092c51 100644 --- a/internal/provider/validate_test.go +++ b/internal/provider/validate_test.go @@ -183,8 +183,6 @@ func TestValidateStaticDocs_DirectoryChecks(t *testing.T) { } for name, testCase := range testCases { - name := name - testCase := testCase t.Run(name, func(t *testing.T) { t.Parallel() @@ -409,8 +407,6 @@ func TestValidateStaticDocs_FileChecks(t *testing.T) { } for name, testCase := range testCases { - name := name - testCase := testCase t.Run(name, func(t *testing.T) { t.Parallel() @@ -557,8 +553,6 @@ func TestValidateStaticDocs_FileMismatchCheck(t *testing.T) { } for name, testCase := range testCases { - name := name - testCase := testCase t.Run(name, func(t *testing.T) { t.Parallel() @@ -671,8 +665,6 @@ func TestValidateLegacyWebsite_DirectoryChecks(t *testing.T) { } for name, testCase := range testCases { - name := name - testCase := testCase t.Run(name, func(t *testing.T) { t.Parallel() @@ -905,8 +897,6 @@ func TestValidateLegacyWebsite_FileChecks(t *testing.T) { } for name, testCase := range testCases { - name := name - testCase := testCase t.Run(name, func(t *testing.T) { t.Parallel() @@ -1053,8 +1043,6 @@ func TestValidateLegacyWebsite_FileMismatchCheck(t *testing.T) { } for name, testCase := range testCases { - name := name - testCase := testCase t.Run(name, func(t *testing.T) { t.Parallel() @@ -1116,8 +1104,6 @@ func TestDocumentationDirGlobPattern(t *testing.T) { } for name, testCase := range testCases { - name := name - testCase := testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/internal/schemamd/behaviors.go b/internal/schemamd/behaviors.go index f0006ef2..561f34c1 100644 --- a/internal/schemamd/behaviors.go +++ b/internal/schemamd/behaviors.go @@ -19,7 +19,7 @@ func childAttributeIsOptional(att *tfjson.SchemaAttribute) bool { return att.Optional } -// childBlockIsOptional returns true for blocks with with min items 0 +// childBlockIsOptional returns true for blocks with min items 0 // which are either empty or have any required or optional children. func childBlockIsOptional(block *tfjson.SchemaBlockType) bool { if block.MinItems > 0 { diff --git a/internal/schemamd/behaviors_test.go b/internal/schemamd/behaviors_test.go index 48e03336..ed8bb333 100644 --- a/internal/schemamd/behaviors_test.go +++ b/internal/schemamd/behaviors_test.go @@ -37,7 +37,7 @@ func TestChildAttributeIsRequired(t *testing.T) { false, }, } { - c := c + t.Run(c.name, func(t *testing.T) { t.Parallel() @@ -76,7 +76,7 @@ func TestChildAttributeIsOptional(t *testing.T) { true, }, } { - c := c + t.Run(c.name, func(t *testing.T) { t.Parallel() @@ -133,7 +133,7 @@ func TestChildAttributeIsReadOnly(t *testing.T) { true, }, } { - c := c + t.Run(c.name, func(t *testing.T) { t.Parallel() @@ -189,7 +189,7 @@ func TestChildBlockIsRequired(t *testing.T) { false, }, } { - c := c + t.Run(c.name, func(t *testing.T) { t.Parallel() @@ -359,7 +359,7 @@ func TestChildBlockIsOptional(t *testing.T) { true, }, } { - c := c + t.Run(c.name, func(t *testing.T) { t.Parallel() @@ -519,7 +519,7 @@ func TestChildBlockIsReadOnly(t *testing.T) { true, }, } { - c := c + t.Run(c.name, func(t *testing.T) { t.Parallel() diff --git a/internal/schemamd/render_test.go b/internal/schemamd/render_test.go index 1770be42..2cf09eb1 100644 --- a/internal/schemamd/render_test.go +++ b/internal/schemamd/render_test.go @@ -54,8 +54,12 @@ func TestRender(t *testing.T) { "testdata/deep_nested_attributes.schema.json", "testdata/deep_nested_attributes.md", }, + { + "deep_nested_write_only_attributes", + "testdata/deep_nested_write_only_attributes.schema.json", + "testdata/deep_nested_write_only_attributes.md", + }, } { - c := c t.Run(c.name, func(t *testing.T) { t.Parallel() diff --git a/internal/schemamd/testdata/deep_nested_write_only_attributes.md b/internal/schemamd/testdata/deep_nested_write_only_attributes.md new file mode 100644 index 00000000..b421fad2 --- /dev/null +++ b/internal/schemamd/testdata/deep_nested_write_only_attributes.md @@ -0,0 +1,46 @@ +## Schema + +### Required + +- `level_one` (Attributes) (see [below for nested schema](#nestedatt--level_one)) + +### Read-Only + +- `id` (String) Example identifier + + +### Nested Schema for `level_one` + +Optional: + +- `level_two` (Attributes, Write-only) (see [below for nested schema](#nestedatt--level_one--level_two)) + + +### Nested Schema for `level_one.level_two` + +Optional: + +- `level_three` (Attributes, Write-only) (see [below for nested schema](#nestedatt--level_one--level_two--level_three)) + + +### Nested Schema for `level_one.level_two.level_three` + +Optional: + +- `level_four_primary` (Attributes, Write-only) (see [below for nested schema](#nestedatt--level_one--level_two--level_three--level_four_primary)) +- `level_four_secondary` (String, Write-only) + + +### Nested Schema for `level_one.level_two.level_three.level_four_primary` + +Optional: + +- `level_five` (Attributes, Write-only) Parent should be level_one.level_two.level_three.level_four_primary. (see [below for nested schema](#nestedatt--level_one--level_two--level_three--level_four_primary--level_five)) +- `level_four_primary_string` (String, Write-only) Parent should be level_one.level_two.level_three.level_four_primary. + + +### Nested Schema for `level_one.level_two.level_three.level_four_primary.level_five` + +Optional: + +- `level_five_string` (String, Write-only) Parent should be level_one.level_two.level_three.level_four_primary.level_five. diff --git a/internal/schemamd/testdata/deep_nested_write_only_attributes.schema.json b/internal/schemamd/testdata/deep_nested_write_only_attributes.schema.json new file mode 100644 index 00000000..5ba4fe27 --- /dev/null +++ b/internal/schemamd/testdata/deep_nested_write_only_attributes.schema.json @@ -0,0 +1,85 @@ +{ + "version": 0, + "block": { + "attributes": { + "id": { + "type": "string", + "description": "Example identifier", + "description_kind": "markdown", + "computed": true + }, + "level_one": { + "nested_type": { + "attributes": { + "level_two": { + "nested_type": { + "attributes": { + "level_three": { + "nested_type": { + "attributes": { + "level_four_primary": { + "nested_type": { + "attributes": { + "level_five": { + "nested_type": { + "attributes": { + "level_five_string": { + "type": "string", + "description": "Parent should be level_one.level_two.level_three.level_four_primary.level_five.", + "description_kind": "plain", + "optional": true, + "write_only": true + } + }, + "nesting_mode": "single" + }, + "description": "Parent should be level_one.level_two.level_three.level_four_primary.", + "description_kind": "plain", + "optional": true, + "write_only": true + }, + "level_four_primary_string": { + "type": "string", + "description": "Parent should be level_one.level_two.level_three.level_four_primary.", + "description_kind": "plain", + "optional": true, + "write_only": true + } + }, + "nesting_mode": "single" + }, + "description_kind": "plain", + "optional": true, + "write_only": true + }, + "level_four_secondary": { + "type": "string", + "description_kind": "plain", + "optional": true, + "write_only": true + } + }, + "nesting_mode": "single" + }, + "description_kind": "plain", + "optional": true, + "write_only": true + } + }, + "nesting_mode": "single" + }, + "description_kind": "plain", + "optional": true, + "write_only": true + } + }, + "nesting_mode": "single" + }, + "description_kind": "plain", + "required": true + } + }, + "description": "Example resource", + "description_kind": "markdown" + } +} \ No newline at end of file diff --git a/internal/schemamd/testdata/framework_types.md b/internal/schemamd/testdata/framework_types.md index 06c04261..781b5bd2 100644 --- a/internal/schemamd/testdata/framework_types.md +++ b/internal/schemamd/testdata/framework_types.md @@ -26,6 +26,7 @@ - `single_nested_block` (Block, Optional) example single nested block (see [below for nested schema](#nestedblock--single_nested_block)) - `single_nested_block_sensitive_nested_attribute` (Block, Optional) example sensitive single nested block (see [below for nested schema](#nestedblock--single_nested_block_sensitive_nested_attribute)) - `string_attribute` (String) example string attribute +- `write_only_string_attribute` (String, Write-only) example write only string attribute ### Read-Only @@ -39,6 +40,7 @@ Optional: - `list_nested_block_attribute` (String) example list nested block attribute - `list_nested_block_attribute_with_default` (String) example list nested block attribute with default +- `list_nested_block_write_only_attribute` (String, Write-only) example list nested block write-only attribute - `nested_list_block` (Block List) (see [below for nested schema](#nestedblock--list_nested_block--nested_list_block)) @@ -98,6 +100,7 @@ Optional: Optional: - `set_nested_block_attribute` (String) example set nested block attribute +- `set_nested_block_write_only_attribute` (String, Write-only) example set nested block write-only attribute @@ -123,4 +126,4 @@ Optional: Read-Only: - `set_nested_block_attribute` (String) example set nested block attribute -- `set_nested_block_sensitive_attribute` (String, Sensitive) example sensitive set nested block attribute +- `set_nested_block_sensitive_attribute` (String, Sensitive) example sensitive set nested block attribute \ No newline at end of file diff --git a/internal/schemamd/testdata/framework_types.schema.json b/internal/schemamd/testdata/framework_types.schema.json index 9aac7817..eb7d810a 100644 --- a/internal/schemamd/testdata/framework_types.schema.json +++ b/internal/schemamd/testdata/framework_types.schema.json @@ -168,6 +168,13 @@ "description": "example string attribute", "description_kind": "markdown", "optional": true + }, + "write_only_string_attribute": { + "type": "string", + "description": "example write only string attribute", + "description_kind": "markdown", + "optional": true, + "write_only": true } }, "block_types": { @@ -181,6 +188,13 @@ "description_kind": "markdown", "optional": true }, + "list_nested_block_write_only_attribute": { + "type": "string", + "description": "example list nested block write-only attribute", + "description_kind": "markdown", + "optional": true, + "write_only": true + }, "list_nested_block_attribute_with_default": { "type": "string", "description": "example list nested block attribute with default", @@ -239,6 +253,13 @@ "description": "example set nested block attribute", "description_kind": "markdown", "optional": true + }, + "set_nested_block_write_only_attribute": { + "type": "string", + "description": "example set nested block write-only attribute", + "description_kind": "markdown", + "optional": true, + "write_only": true } }, "description": "example set nested block", diff --git a/internal/schemamd/write_attribute_description.go b/internal/schemamd/write_attribute_description.go index a8aa45b9..f31cccfe 100644 --- a/internal/schemamd/write_attribute_description.go +++ b/internal/schemamd/write_attribute_description.go @@ -58,6 +58,13 @@ func WriteAttributeDescription(w io.Writer, att *tfjson.SchemaAttribute, include } } + if att.WriteOnly { + _, err := io.WriteString(w, ", Write-only") + if err != nil { + return err + } + } + _, err = io.WriteString(w, ")") if err != nil { return err diff --git a/internal/schemamd/write_attribute_description_test.go b/internal/schemamd/write_attribute_description_test.go index c1318425..ee09d4ca 100644 --- a/internal/schemamd/write_attribute_description_test.go +++ b/internal/schemamd/write_attribute_description_test.go @@ -30,6 +30,15 @@ func TestWriteAttributeDescription(t *testing.T) { Description: "This is an attribute.", }, }, + { + "(String, Required, Write-only) This is an attribute.", + &tfjson.SchemaAttribute{ + AttributeType: cty.String, + Required: true, + Description: "This is an attribute.", + WriteOnly: true, + }, + }, { "(String, Required, Deprecated) This is an attribute.", &tfjson.SchemaAttribute{ @@ -154,7 +163,6 @@ func TestWriteAttributeDescription(t *testing.T) { }, }, } { - c := c t.Run(c.expected, func(t *testing.T) { t.Parallel() diff --git a/internal/schemamd/write_block_type_description_test.go b/internal/schemamd/write_block_type_description_test.go index 0ee14a26..e6fa5023 100644 --- a/internal/schemamd/write_block_type_description_test.go +++ b/internal/schemamd/write_block_type_description_test.go @@ -219,7 +219,6 @@ func TestWriteBlockTypeDescription(t *testing.T) { }, }, } { - c := c t.Run(c.expected, func(t *testing.T) { t.Parallel() diff --git a/internal/schemamd/write_nested_attribute_type_description.go b/internal/schemamd/write_nested_attribute_type_description.go index c51be83c..c2f0c117 100644 --- a/internal/schemamd/write_nested_attribute_type_description.go +++ b/internal/schemamd/write_nested_attribute_type_description.go @@ -97,6 +97,13 @@ func WriteNestedAttributeTypeDescription(w io.Writer, att *tfjson.SchemaAttribut } } + if att.WriteOnly { + _, err := io.WriteString(w, ", Write-only") + if err != nil { + return err + } + } + _, err = io.WriteString(w, ")") if err != nil { return err diff --git a/internal/schemamd/write_nested_attribute_type_description_test.go b/internal/schemamd/write_nested_attribute_type_description_test.go index 170284c1..81a12bf4 100644 --- a/internal/schemamd/write_nested_attribute_type_description_test.go +++ b/internal/schemamd/write_nested_attribute_type_description_test.go @@ -38,6 +38,24 @@ func TestWriteNestedAttributeTypeDescription(t *testing.T) { Optional: true, }, }, + { + "(Attributes, Optional, Write-only) This is an attribute.", + &tfjson.SchemaAttribute{ + Description: "This is an attribute.", + AttributeNestedType: &tfjson.SchemaNestedAttributeType{ + NestingMode: tfjson.SchemaNestingModeSingle, + Attributes: map[string]*tfjson.SchemaAttribute{ + "foo": { + AttributeType: cty.String, + Required: true, + Description: "This is a nested attribute.", + }, + }, + }, + Optional: true, + WriteOnly: true, + }, + }, { "(Attributes List, Min: 2, Max: 3) This is an attribute.", &tfjson.SchemaAttribute{ @@ -91,7 +109,6 @@ func TestWriteNestedAttributeTypeDescription(t *testing.T) { }, }, } { - c := c t.Run(c.expected, func(t *testing.T) { t.Parallel() diff --git a/internal/schemamd/write_type_test.go b/internal/schemamd/write_type_test.go index 3def2586..62340ad3 100644 --- a/internal/schemamd/write_type_test.go +++ b/internal/schemamd/write_type_test.go @@ -49,7 +49,6 @@ func TestWriteType(t *testing.T) { "bool": cty.Bool, }))))}, } { - c := c t.Run(fmt.Sprintf("%s %s", c.ty.FriendlyName(), c.expected), func(t *testing.T) { t.Parallel() From 80d1c8eabd666d57d883131c4ef84e8c3eb474ed Mon Sep 17 00:00:00 2001 From: "hashicorp-tsccr[bot]" <129506189+hashicorp-tsccr[bot]@users.noreply.github.com> Date: Wed, 19 Feb 2025 08:26:15 -0500 Subject: [PATCH 67/71] Result of tsccr-helper -log-level=info gha update -latest .github/ (#449) Co-authored-by: hashicorp-tsccr[bot] --- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6e72b8fc..14c71529 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -93,7 +93,7 @@ jobs: cd .changes sed -e "1{/# /d;}" -e "2{/^$/d;}" ${{ needs.changelog-version.outputs.version }}.md > /tmp/release-notes.txt - - uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6.1.0 + - uses: goreleaser/goreleaser-action@026299872805cb2db698e02dd7fb506a4da5122d # v6.2.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index de0c8b29..6c5287de 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,7 +27,7 @@ jobs: with: go-version-file: 'go.mod' - name: Run linters - uses: golangci/golangci-lint-action@ec5d18412c0aeab7936cb16880d708ba2a64e1ae # v6.2.0 + uses: golangci/golangci-lint-action@2e788936b09dd82dc280e845628a40d2ba6b204c # v6.3.1 with: version: latest args: --timeout=3m From e36f96ddaf1f3640d49b708c770b78bcfe7048ad Mon Sep 17 00:00:00 2001 From: Selena Goods Date: Mon, 24 Feb 2025 10:50:32 -0500 Subject: [PATCH 68/71] generate: Add hyperlinks to user documentation and version callouts for write-only attribute documentation (#451) * Add link to write-only user documentation in markdown * Add write-only version callout to all relevant sections --- ...provider_success_all_framework_types.txtar | 17 +++++++++++++- internal/schemamd/behaviors.go | 21 ++++++++++++++++++ internal/schemamd/render.go | 22 +++++++++++++++++++ .../deep_nested_write_only_attributes.md | 14 ++++++------ internal/schemamd/testdata/framework_types.md | 18 ++++++++++++--- .../testdata/framework_types.schema.json | 7 ++++++ .../schemamd/write_attribute_description.go | 2 +- .../write_attribute_description_test.go | 2 +- ...write_nested_attribute_type_description.go | 2 +- ..._nested_attribute_type_description_test.go | 2 +- 10 files changed, 92 insertions(+), 15 deletions(-) diff --git a/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_all_framework_types.txtar b/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_all_framework_types.txtar index e98192bb..813b5c6f 100644 --- a/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_all_framework_types.txtar +++ b/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_all_framework_types.txtar @@ -67,8 +67,16 @@ example resource ## Schema +### Required + +> **NOTE**: [Write-only arguments](https://developer.hashicorp.com/terraform/language/resources/ephemeral#write-only-arguments) are supported in Terraform 1.11 and later. + +- `required_write_only_string_attribute` (String, [Write-only](https://developer.hashicorp.com/terraform/language/resources/ephemeral#write-only-arguments)) example required write-only string attribute + ### Optional +> **NOTE**: [Write-only arguments](https://developer.hashicorp.com/terraform/language/resources/ephemeral#write-only-arguments) are supported in Terraform 1.11 and later. + - `bool_attribute` (Boolean) example bool attribute - `float64_attribute` (Number) example float64 attribute - `int64_attribute` (Number) example int64 attribute @@ -93,7 +101,7 @@ example resource - `single_nested_block` (Block, Optional) example single nested block (see [below for nested schema](#nestedblock--single_nested_block)) - `single_nested_block_sensitive_nested_attribute` (Block, Optional) example sensitive single nested block (see [below for nested schema](#nestedblock--single_nested_block_sensitive_nested_attribute)) - `string_attribute` (String) example string attribute -- `write_only_string_attribute` (String, Write-only) example write-only string attribute +- `write_only_string_attribute` (String, [Write-only](https://developer.hashicorp.com/terraform/language/resources/ephemeral#write-only-arguments)) example write-only string attribute ### Read-Only @@ -426,6 +434,13 @@ scaffolding(stringInput string, boolInput bool, float64Input number, int64Input "description_kind": "markdown", "optional": true, "write_only": true + }, + "required_write_only_string_attribute": { + "type": "string", + "description": "example required write-only string attribute", + "description_kind": "markdown", + "required": true, + "write_only": true } }, "block_types": { diff --git a/internal/schemamd/behaviors.go b/internal/schemamd/behaviors.go index 561f34c1..969f1d40 100644 --- a/internal/schemamd/behaviors.go +++ b/internal/schemamd/behaviors.go @@ -11,6 +11,10 @@ func childAttributeIsRequired(att *tfjson.SchemaAttribute) bool { return att.Required } +func childAttributeIsWriteOnly(att *tfjson.SchemaAttribute) bool { + return att.WriteOnly +} + func childBlockIsRequired(block *tfjson.SchemaBlockType) bool { return block.MinItems > 0 } @@ -77,3 +81,20 @@ func childBlockIsReadOnly(block *tfjson.SchemaBlockType) bool { return true } + +// childBlockContainsWriteOnly returns true for blocks that contain any write-only attributes. +func childBlockContainsWriteOnly(block *tfjson.SchemaBlockType) bool { + for _, childBlock := range block.Block.NestedBlocks { + if childBlockContainsWriteOnly(childBlock) { + return true + } + } + + for _, childAtt := range block.Block.Attributes { + if childAttributeIsWriteOnly(childAtt) { + return true + } + } + + return false +} diff --git a/internal/schemamd/render.go b/internal/schemamd/render.go index a459d0ba..5033c6ac 100644 --- a/internal/schemamd/render.go +++ b/internal/schemamd/render.go @@ -304,6 +304,28 @@ nameLoop: return err } + for _, name := range sortedNames { + if childBlock, ok := block.NestedBlocks[name]; ok { + if childBlockContainsWriteOnly(childBlock) { + _, err := io.WriteString(w, + "> **NOTE**: [Write-only arguments](https://developer.hashicorp.com/terraform/language/resources/ephemeral#write-only-arguments) are supported in Terraform 1.11 and later.\n\n") + if err != nil { + return err + } + break + } + } else if childAtt, ok := block.Attributes[name]; ok { + if childAttributeIsWriteOnly(childAtt) { + _, err := io.WriteString(w, + "> **NOTE**: [Write-only arguments](https://developer.hashicorp.com/terraform/language/resources/ephemeral#write-only-arguments) are supported in Terraform 1.11 and later.\n\n") + if err != nil { + return err + } + break + } + } + } + for _, name := range sortedNames { path := make([]string, len(parents), len(parents)+1) copy(path, parents) diff --git a/internal/schemamd/testdata/deep_nested_write_only_attributes.md b/internal/schemamd/testdata/deep_nested_write_only_attributes.md index b421fad2..428fe7e5 100644 --- a/internal/schemamd/testdata/deep_nested_write_only_attributes.md +++ b/internal/schemamd/testdata/deep_nested_write_only_attributes.md @@ -13,34 +13,34 @@ Optional: -- `level_two` (Attributes, Write-only) (see [below for nested schema](#nestedatt--level_one--level_two)) +- `level_two` (Attributes, [Write-only](https://developer.hashicorp.com/terraform/language/resources/ephemeral#write-only-arguments)) (see [below for nested schema](#nestedatt--level_one--level_two)) ### Nested Schema for `level_one.level_two` Optional: -- `level_three` (Attributes, Write-only) (see [below for nested schema](#nestedatt--level_one--level_two--level_three)) +- `level_three` (Attributes, [Write-only](https://developer.hashicorp.com/terraform/language/resources/ephemeral#write-only-arguments)) (see [below for nested schema](#nestedatt--level_one--level_two--level_three)) ### Nested Schema for `level_one.level_two.level_three` Optional: -- `level_four_primary` (Attributes, Write-only) (see [below for nested schema](#nestedatt--level_one--level_two--level_three--level_four_primary)) -- `level_four_secondary` (String, Write-only) +- `level_four_primary` (Attributes, [Write-only](https://developer.hashicorp.com/terraform/language/resources/ephemeral#write-only-arguments)) (see [below for nested schema](#nestedatt--level_one--level_two--level_three--level_four_primary)) +- `level_four_secondary` (String, [Write-only](https://developer.hashicorp.com/terraform/language/resources/ephemeral#write-only-arguments)) ### Nested Schema for `level_one.level_two.level_three.level_four_primary` Optional: -- `level_five` (Attributes, Write-only) Parent should be level_one.level_two.level_three.level_four_primary. (see [below for nested schema](#nestedatt--level_one--level_two--level_three--level_four_primary--level_five)) -- `level_four_primary_string` (String, Write-only) Parent should be level_one.level_two.level_three.level_four_primary. +- `level_five` (Attributes, [Write-only](https://developer.hashicorp.com/terraform/language/resources/ephemeral#write-only-arguments)) Parent should be level_one.level_two.level_three.level_four_primary. (see [below for nested schema](#nestedatt--level_one--level_two--level_three--level_four_primary--level_five)) +- `level_four_primary_string` (String, [Write-only](https://developer.hashicorp.com/terraform/language/resources/ephemeral#write-only-arguments)) Parent should be level_one.level_two.level_three.level_four_primary. ### Nested Schema for `level_one.level_two.level_three.level_four_primary.level_five` Optional: -- `level_five_string` (String, Write-only) Parent should be level_one.level_two.level_three.level_four_primary.level_five. +- `level_five_string` (String, [Write-only](https://developer.hashicorp.com/terraform/language/resources/ephemeral#write-only-arguments)) Parent should be level_one.level_two.level_three.level_four_primary.level_five. diff --git a/internal/schemamd/testdata/framework_types.md b/internal/schemamd/testdata/framework_types.md index 781b5bd2..8607a931 100644 --- a/internal/schemamd/testdata/framework_types.md +++ b/internal/schemamd/testdata/framework_types.md @@ -1,7 +1,15 @@ ## Schema +### Required + +> **NOTE**: [Write-only arguments](https://developer.hashicorp.com/terraform/language/resources/ephemeral#write-only-arguments) are supported in Terraform 1.11 and later. + +- `required_write_only_string_attribute` (String, [Write-only](https://developer.hashicorp.com/terraform/language/resources/ephemeral#write-only-arguments)) example required write-only string attribute + ### Optional +> **NOTE**: [Write-only arguments](https://developer.hashicorp.com/terraform/language/resources/ephemeral#write-only-arguments) are supported in Terraform 1.11 and later. + - `bool_attribute` (Boolean) example bool attribute - `float64_attribute` (Number) example float64 attribute - `int64_attribute` (Number) example int64 attribute @@ -26,7 +34,7 @@ - `single_nested_block` (Block, Optional) example single nested block (see [below for nested schema](#nestedblock--single_nested_block)) - `single_nested_block_sensitive_nested_attribute` (Block, Optional) example sensitive single nested block (see [below for nested schema](#nestedblock--single_nested_block_sensitive_nested_attribute)) - `string_attribute` (String) example string attribute -- `write_only_string_attribute` (String, Write-only) example write only string attribute +- `write_only_string_attribute` (String, [Write-only](https://developer.hashicorp.com/terraform/language/resources/ephemeral#write-only-arguments)) example write only string attribute ### Read-Only @@ -38,9 +46,11 @@ Optional: +> **NOTE**: [Write-only arguments](https://developer.hashicorp.com/terraform/language/resources/ephemeral#write-only-arguments) are supported in Terraform 1.11 and later. + - `list_nested_block_attribute` (String) example list nested block attribute - `list_nested_block_attribute_with_default` (String) example list nested block attribute with default -- `list_nested_block_write_only_attribute` (String, Write-only) example list nested block write-only attribute +- `list_nested_block_write_only_attribute` (String, [Write-only](https://developer.hashicorp.com/terraform/language/resources/ephemeral#write-only-arguments)) example list nested block write-only attribute - `nested_list_block` (Block List) (see [below for nested schema](#nestedblock--list_nested_block--nested_list_block)) @@ -99,8 +109,10 @@ Optional: Optional: +> **NOTE**: [Write-only arguments](https://developer.hashicorp.com/terraform/language/resources/ephemeral#write-only-arguments) are supported in Terraform 1.11 and later. + - `set_nested_block_attribute` (String) example set nested block attribute -- `set_nested_block_write_only_attribute` (String, Write-only) example set nested block write-only attribute +- `set_nested_block_write_only_attribute` (String, [Write-only](https://developer.hashicorp.com/terraform/language/resources/ephemeral#write-only-arguments)) example set nested block write-only attribute diff --git a/internal/schemamd/testdata/framework_types.schema.json b/internal/schemamd/testdata/framework_types.schema.json index eb7d810a..91f73508 100644 --- a/internal/schemamd/testdata/framework_types.schema.json +++ b/internal/schemamd/testdata/framework_types.schema.json @@ -175,6 +175,13 @@ "description_kind": "markdown", "optional": true, "write_only": true + }, + "required_write_only_string_attribute": { + "type": "string", + "description": "example required write-only string attribute", + "description_kind": "markdown", + "required": true, + "write_only": true } }, "block_types": { diff --git a/internal/schemamd/write_attribute_description.go b/internal/schemamd/write_attribute_description.go index f31cccfe..26db2a8c 100644 --- a/internal/schemamd/write_attribute_description.go +++ b/internal/schemamd/write_attribute_description.go @@ -59,7 +59,7 @@ func WriteAttributeDescription(w io.Writer, att *tfjson.SchemaAttribute, include } if att.WriteOnly { - _, err := io.WriteString(w, ", Write-only") + _, err := io.WriteString(w, ", [Write-only](https://developer.hashicorp.com/terraform/language/resources/ephemeral#write-only-arguments)") if err != nil { return err } diff --git a/internal/schemamd/write_attribute_description_test.go b/internal/schemamd/write_attribute_description_test.go index ee09d4ca..34bade4e 100644 --- a/internal/schemamd/write_attribute_description_test.go +++ b/internal/schemamd/write_attribute_description_test.go @@ -31,7 +31,7 @@ func TestWriteAttributeDescription(t *testing.T) { }, }, { - "(String, Required, Write-only) This is an attribute.", + "(String, Required, [Write-only](https://developer.hashicorp.com/terraform/language/resources/ephemeral#write-only-arguments)) This is an attribute.", &tfjson.SchemaAttribute{ AttributeType: cty.String, Required: true, diff --git a/internal/schemamd/write_nested_attribute_type_description.go b/internal/schemamd/write_nested_attribute_type_description.go index c2f0c117..a45bdb1e 100644 --- a/internal/schemamd/write_nested_attribute_type_description.go +++ b/internal/schemamd/write_nested_attribute_type_description.go @@ -98,7 +98,7 @@ func WriteNestedAttributeTypeDescription(w io.Writer, att *tfjson.SchemaAttribut } if att.WriteOnly { - _, err := io.WriteString(w, ", Write-only") + _, err := io.WriteString(w, ", [Write-only](https://developer.hashicorp.com/terraform/language/resources/ephemeral#write-only-arguments)") if err != nil { return err } diff --git a/internal/schemamd/write_nested_attribute_type_description_test.go b/internal/schemamd/write_nested_attribute_type_description_test.go index 81a12bf4..9b48ea10 100644 --- a/internal/schemamd/write_nested_attribute_type_description_test.go +++ b/internal/schemamd/write_nested_attribute_type_description_test.go @@ -39,7 +39,7 @@ func TestWriteNestedAttributeTypeDescription(t *testing.T) { }, }, { - "(Attributes, Optional, Write-only) This is an attribute.", + "(Attributes, Optional, [Write-only](https://developer.hashicorp.com/terraform/language/resources/ephemeral#write-only-arguments)) This is an attribute.", &tfjson.SchemaAttribute{ Description: "This is an attribute.", AttributeNestedType: &tfjson.SchemaNestedAttributeType{ From 2ad3f4c6c98502b768954ae3b4675a09a5a42962 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2025 11:05:32 -0500 Subject: [PATCH 69/71] Bump github.com/hashicorp/copywrite from 0.20.0 to 0.21.0 in /tools (#450) Bumps [github.com/hashicorp/copywrite](https://github.com/hashicorp/copywrite) from 0.20.0 to 0.21.0. - [Release notes](https://github.com/hashicorp/copywrite/releases) - [Changelog](https://github.com/hashicorp/copywrite/blob/main/.goreleaser.yaml) - [Commits](https://github.com/hashicorp/copywrite/compare/v0.20.0...v0.21.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/copywrite dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- tools/go.mod | 2 +- tools/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/go.mod b/tools/go.mod index 4dbb34ee..1e0f5946 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -2,7 +2,7 @@ module tools go 1.22.7 -require github.com/hashicorp/copywrite v0.20.0 +require github.com/hashicorp/copywrite v0.21.0 require ( github.com/AlecAivazis/survey/v2 v2.3.7 // indirect diff --git a/tools/go.sum b/tools/go.sum index a889a22a..fcb73234 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -144,8 +144,8 @@ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgf github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/consul/api v1.13.0/go.mod h1:ZlVrynguJKcYr54zGaDbaL3fOvKC9m72FhPvA8T35KQ= github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= -github.com/hashicorp/copywrite v0.20.0 h1:i+iNq4lWsGopKIhC0HfZjUvNAnXnU/Pc5e+4L5WF+1Y= -github.com/hashicorp/copywrite v0.20.0/go.mod h1:mu6DAyUI6m6vq8weoJn9a0HDuUUrV+0GQdRp4mD50yU= +github.com/hashicorp/copywrite v0.21.0 h1:IE8uByQdos8s0uAyHF4O8RHV5cJEhmIc+Awk+wkKXKI= +github.com/hashicorp/copywrite v0.21.0/go.mod h1:mu6DAyUI6m6vq8weoJn9a0HDuUUrV+0GQdRp4mD50yU= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= From 660c8d8f54ab43a2e03d43b5654906f9939e24fa Mon Sep 17 00:00:00 2001 From: "hashicorp-tsccr[bot]" <129506189+hashicorp-tsccr[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2025 11:12:27 -0500 Subject: [PATCH 70/71] Result of tsccr-helper -log-level=info gha update -latest .github/ (#452) Co-authored-by: hashicorp-tsccr[bot] --- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 14c71529..eb7bc6ab 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -93,7 +93,7 @@ jobs: cd .changes sed -e "1{/# /d;}" -e "2{/^$/d;}" ${{ needs.changelog-version.outputs.version }}.md > /tmp/release-notes.txt - - uses: goreleaser/goreleaser-action@026299872805cb2db698e02dd7fb506a4da5122d # v6.2.0 + - uses: goreleaser/goreleaser-action@90a3faa9d0182683851fbfa97ca1a2cb983bfca3 # v6.2.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6c5287de..1a7a0ba1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,7 +27,7 @@ jobs: with: go-version-file: 'go.mod' - name: Run linters - uses: golangci/golangci-lint-action@2e788936b09dd82dc280e845628a40d2ba6b204c # v6.3.1 + uses: golangci/golangci-lint-action@2226d7cb06a077cd73e56eedd38eecad18e5d837 # v6.5.0 with: version: latest args: --timeout=3m From 34ba7c27e80af146542643757f11217467d12ca7 Mon Sep 17 00:00:00 2001 From: hc-github-team-tf-provider-devex Date: Thu, 27 Feb 2025 14:36:17 +0000 Subject: [PATCH 71/71] Update changelog --- .changes/0.21.0.md | 6 ++++++ .changes/unreleased/FEATURES-20250212-165819.yaml | 5 ----- CHANGELOG.md | 6 ++++++ 3 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 .changes/0.21.0.md delete mode 100644 .changes/unreleased/FEATURES-20250212-165819.yaml diff --git a/.changes/0.21.0.md b/.changes/0.21.0.md new file mode 100644 index 00000000..9707e6bb --- /dev/null +++ b/.changes/0.21.0.md @@ -0,0 +1,6 @@ +## 0.21.0 (February 27, 2025) + +FEATURES: + +* generate: Add support for write-only arguments ([#434](https://github.com/hashicorp/terraform-plugin-docs/issues/434)) + diff --git a/.changes/unreleased/FEATURES-20250212-165819.yaml b/.changes/unreleased/FEATURES-20250212-165819.yaml deleted file mode 100644 index 83a5a601..00000000 --- a/.changes/unreleased/FEATURES-20250212-165819.yaml +++ /dev/null @@ -1,5 +0,0 @@ -kind: FEATURES -body: 'generate: Add support for write-only arguments' -time: 2025-02-12T16:58:19.098098-05:00 -custom: - Issue: "434" diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f9b32e8..7de43e87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 0.21.0 (February 27, 2025) + +FEATURES: + +* generate: Add support for write-only arguments ([#434](https://github.com/hashicorp/terraform-plugin-docs/issues/434)) + ## 0.20.1 (November 26, 2024) BUG FIXES: