Skip to content

Commit

Permalink
Merge pull request #802 from gitlabhq/gen-docs-2
Browse files Browse the repository at this point in the history
Auto Generate Docs
  • Loading branch information
armsnyder committed Jan 28, 2022
2 parents 4b7a08a + a49b3ad commit 9863a61
Show file tree
Hide file tree
Showing 208 changed files with 6,443 additions and 3,253 deletions.
5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ updates:
schedule:
interval: weekly

- package-ecosystem: gomod
directory: /tools
schedule:
interval: weekly

- package-ecosystem: github-actions
directory: /
schedule:
Expand Down
6 changes: 4 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
<!-- For a smooth review process, please run through this checklist before submitting a PR. -->

- [ ] Resource attributes match 1:1 the names and structure of the API resource in [the GitLab API documentation](https://docs.gitlab.com/ee/api/).
- [ ] Docs are updated with any new resources or attributes, including how to import the resource.
- [ ] New resources should have at minimum a basic test with three steps:
- [ ] [Examples](/examples) are updated with:
- A \*.tf file for the resource/s with at least one usage example
- A \*.sh file for the resource/s with an import example (if applicable)
- [ ] New resources have at minimum a basic test with three steps:
- Create the resource
- Update the attributes
- Import the resource
Expand Down
47 changes: 0 additions & 47 deletions .github/workflows/acceptance-tests.yml

This file was deleted.

12 changes: 0 additions & 12 deletions .github/workflows/golangci-lint.yml

This file was deleted.

12 changes: 0 additions & 12 deletions .github/workflows/markdown-lint.yml

This file was deleted.

25 changes: 10 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,22 @@ jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Unshallow
run: git fetch --prune --unshallow
-
name: Set up Go
uses: actions/setup-go@v2.1.3
- uses: actions/setup-go@v2
with:
go-version: 1.16
-
name: Import GPG key
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go${{ env.GO_VERSION }}-${{ hashFiles('go.sum') }}-no-tools
- name: Unshallow
run: git fetch --prune --unshallow
- uses: paultyng/ghaction-import-gpg@v2.1.0
id: import_gpg
uses: paultyng/ghaction-import-gpg@v2.1.0
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
PASSPHRASE: ${{ secrets.PASSPHRASE }}
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
- uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
Expand Down
96 changes: 96 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: test
on: [push,pull_request]

jobs:
lint:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target:
- lint-golangci
- lint-tfprovider
- lint-examples-tf
- lint-examples-sh
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.16
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/go/pkg/mod
bin
key: ${{ runner.os }}-go${{ env.GO_VERSION }}-${{ hashFiles('**/go.sum') }}-include-tools
- run: make ${{ matrix.target }}

unit-test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
go: [1.16]
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go${{ env.GO_VERSION }}-${{ hashFiles('go.sum') }}-no-tools
- run: make test

generate-check:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.16
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/go/pkg/mod
bin
key: ${{ runner.os }}-go${{ env.GO_VERSION }}-${{ hashFiles('**/go.sum') }}-include-tools
- run: make generate
- name: Check generated files
run: |
[ -z "$(git status --short)" ] || { echo "Error: Files should have been generated:"; git status --short; echo "Diff:"; git diff HEAD; exit 1; }
acceptance-ce:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.16
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go${{ env.GO_VERSION }}-${{ hashFiles('go.sum') }}-no-tools
- run: make testacc-up
- run: make testacc

acceptance-ee:
timeout-minutes: 60
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.repository_owner == 'gitlabhq'
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.16
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go${{ env.GO_VERSION }}-${{ hashFiles('go.sum') }}-no-tools
- run: |
openssl version
openssl enc -d -aes-256-cbc -pbkdf2 -iter 20000 -in Gitlab-license.encrypted -out Gitlab-license.txt -pass "pass:${{ secrets.LICENSE_ENCRYPTION_PASSWORD }}"
- run: make testacc-up SERVICE=gitlab-ee
- run: make testacc
14 changes: 0 additions & 14 deletions .github/workflows/tfproviderlint.yml

This file was deleted.

32 changes: 0 additions & 32 deletions .github/workflows/unit-tests.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ website/.vagrant
website/build
website/node_modules
website/vendor
/tmp
9 changes: 0 additions & 9 deletions .markdownlint.yml

This file was deleted.

20 changes: 14 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,25 @@ Use HashiCorp's [Plugin Development](https://www.terraform.io/plugin) guide as a

See the [Developing The Provider](#developing-the-provider) section below for specifics about this GitLab provider.

## PR Checklist
## Before Committing

Run `make reviewable` and include any generated files in your commit. This will help ensure your PR passes automated checks.

**Tip:** If you have issues passing the automated checks, try deleting your project-local `bin` directory and re-run `make reviewable`.

### PR Checklist

<!--
These are the most common issues in PRs which we have not automated.
-->

For a smooth review process, please run through this checklist before submitting a PR.
For a smooth review process, please run through this checklist before submitting a PR.

1. Resource attributes match 1:1 the names and structure of the API resource in the [GitLab API documentation](https://docs.gitlab.com/ee/api/api_resources.html).
1. [Docs](/docs) are updated with any new resources or attributes, including how to import the resource.
1. New resources should have at minimum a basic test with three steps:
1. [Examples](/examples) are updated with:
1. A \*.tf file for the resource/s with at least one usage example
1. A \*.sh file for the resource/s with an import example (if applicable)
1. New resources have at minimum a basic test with three steps:
1. Create the resource
1. Update the attributes
1. Import the resource
Expand Down Expand Up @@ -50,11 +58,11 @@ See the [importer state function docs](https://www.terraform.io/plugin/sdkv2/res

#### Documentation

At the moment, documentation is handcrafted. Doc pages are located in [/docs](/docs). Please follow the [Terraform doc formatting guidelines](https://www.terraform.io/registry/providers/docs#format) for these pages. The [Terraform doc preview tool](https://registry.terraform.io/tools/doc-preview) is very helpful for previewing the markdown.
Documentation in [/docs](/docs) is auto-generated by [terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) based on code descriptions and [examples](/examples). Generation runs during `make reviewable`. You can use the [Terraform doc preview tool](https://registry.terraform.io/tools/doc-preview) if you would like to preview the generated documentation.

## Developing The Provider

You'll first need [Go](http://www.golang.org) installed on your machine (version 1.14+ is *required*).
You'll first need [Go](http://www.golang.org) installed on your machine (version 1.16+ is *required*).

1. Clone the git repository.

Expand Down

0 comments on commit 9863a61

Please sign in to comment.