Skip to content

Commit

Permalink
Contributor docs: fix the build and use a stable tag for `mkdocs-depl…
Browse files Browse the repository at this point in the history
…oy-gh-pages` action (hashicorp#21580)
  • Loading branch information
manicminer authored Apr 28, 2023
1 parent f6dcbd9 commit 3a8a7de
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
branches:
- main
paths:
- '.github/workflows/mkdocs.yaml'
- 'contributing/**'
workflow_dispatch:

Expand All @@ -21,7 +22,7 @@ jobs:
uses: actions/checkout@v3

- name: Publish
uses: mhausenblas/mkdocs-deploy-gh-pages@master
uses: mhausenblas/mkdocs-deploy-gh-pages@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CONFIG_FILE: mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
pull_request:
types: ["opened", "synchronize"]
paths:
- ".github/workflows/provider-test.yml"
- '.github/workflows/provider-test.yaml'
- 'internal/**.go'
- 'vendor/github.com/hashicorp/go-azure-sdk/sdk/auth/**'
- 'vendor/github.com/hashicorp/go-azure-sdk/sdk/environments/**'
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ website/vendor

.vscode/

# mkdocs output
site/

# Test exclusions
!command/test-fixtures/**/*.tfstate
!command/test-fixtures/**/.terraform/
Expand Down
4 changes: 2 additions & 2 deletions contributing/topics/guide-new-data-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@ package resource

In this case, you need to specify the `name` the Resource (in this case `ResourceGroupExample`) and the `id` which is an example of this Resource ID (in this case `/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1`).

> The segments of the Resource ID should be camelCased (e.g. `resourceGroups` rather than `resourcegroups`) per the Azure API Specification - see [the Azure Resource ID reference](reference-azure-resource-ids.md) for more information.
> The segments of the Resource ID should be camelCased (e.g. `resourceGroups` rather than `resourcegroups`) per the Azure API Specification - see [Azure Resource IDs in the Glossary](reference-glossary.md#azure-resource-ids) for more information.
You can generate the Resource ID Struct, Parser and Validation functions by running `make generate` - which will output the following files:

* `./internal/service/resource/parse/resource_group_example.go` - contains the Resource ID Struct, Formatter and Parser.
* `./internal/service/resource/parse/resource_group_example_test.go` - contains tests for those ^.
* `./internal/service/resource/validate/resource_group_example_id.go` - contains Terraform validation functions for the Resource ID.

These types can then be used in the Data Source we're creating below, but [see this link for more information on how Azure Resource ID's are used in Terraform](reference-azure-resource-ids.md).
These types can then be used in the Data Source we're creating below.

### Step 4: Scaffold an empty/new Data Source

Expand Down
4 changes: 2 additions & 2 deletions contributing/topics/guide-new-resource.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,15 @@ package resource

In this case, you need to specify the `name` the Resource (in this case `ResourceGroupExample`) and the `id` which is an example of this Resource ID (in this case `/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1`).

> The segments of the Resource ID should be camelCased (e.g. `resourceGroups` rather than `resourcegroups`) per the Azure API Specification - see [the Azure Resource ID reference](reference-azure-resource-ids.md) for more information.
> The segments of the Resource ID should be camelCased (e.g. `resourceGroups` rather than `resourcegroups`) per the Azure API Specification - see [Azure Resource IDs in the Glossary](reference-glossary.md#azure-resource-ids) for more information.
You can generate the Resource ID Struct, Parser and Validation functions by running `make generate` - which will output the following files:

* `./internal/service/resource/parse/resource_group_example.go` - contains the Resource ID Struct, Formatter and Parser.
* `./internal/service/resource/parse/resource_group_example_test.go` - contains tests for those ^.
* `./internal/service/resource/validate/resource_group_example_id.go` - contains Terraform validation functions for the Resource ID.

These types can then be used in the Resource we're creating below, but [see this link for more information on how Azure Resource ID's are used in Terraform](reference-azure-resource-ids.md).
These types can then be used in the Resource we're creating below.

### Step 4: Scaffold an empty/new Resource

Expand Down
4 changes: 2 additions & 2 deletions contributing/topics/high-level-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Some Service Packages may also contain:

* `./migration` - any State Migrations used in Resources.
* `./sdk` - any Embedded SDK’s used to access the Azure API’s (either Resource Manager or Data Plane).
* `./resourceids.go` - used to generate Resource ID Formatters, Parsers and Validators, see [Resource ID Generation](resource-id-generation.md) for more information.
* `./resourceids.go` - used to generate Resource ID Formatters, Parsers and Validators.

—-

Expand Down Expand Up @@ -123,4 +123,4 @@ At this point in time, each of the SDKs mentioned above (excluding Hamilton) mak

Since the behaviour of the Azure API can change over time, the Provider leans on Acceptance Tests over Unit Tests for asserting that the Data Sources and Resources within the Provider work as expected.

More details and guidance on how to test Data Sources/Resources can be found in [the Acceptance Testing reference](reference-acceptance-testing.md).
More details and guidance on how to test Data Sources/Resources can be found in [the Acceptance Testing reference](reference-acceptance-testing.md).
4 changes: 2 additions & 2 deletions contributing/topics/reference-acceptance-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ At a minimum, a Resource requires:

* A `basic` test ([Example](#Example---Basic---Resource)) - this tests the minimum fields (e.g. all Required fields) for this Resource.

* A `requiresImport` test ([Example](#Example---Resource---Requires-Import)) - this test exercises the logic in the `create` function of a resource that checks for the prior existence of the resource and being created and expects an error. See [requires-import](requires-import.md). The acceptance test package provides a helper function is provided to be used in the test, called `RequiresImportErrorStep` for this purpose.
* A `requiresImport` test ([Example](#Example---Resource---Requires-Import)) - this test exercises the logic in the `create` function of a resource that checks for the prior existence of the resource and being created and expects an error. The acceptance test package provides a helper function is provided to be used in the test, called `RequiresImportErrorStep` for this purpose.

* A `complete` test ([Example](#Example---Resource---Complete)) - this tests all possible fields (e.g. all Required/Optional fields) for this Resource.

Expand Down Expand Up @@ -351,4 +351,4 @@ resource "azurerm_example_resource" "example" {
}
`, data.Locations.Primary)
}
```
```

0 comments on commit 3a8a7de

Please sign in to comment.