Skip to content

Chore: Doc, README fixes, Doc Automation #107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Mar 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions .all-contributorsrc

This file was deleted.

3 changes: 1 addition & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
## Notes
<!-- Add any notes here -->

## PR Checklist
## Checklist

* [ ] _I have read [CONTRIBUTING.md](https://github.com/codefresh-io/terraform-provider-codefresh/blob/master/README.md)._
* [ ] _I have [allowed changes to my fork to be made](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork)._
* [ ] _I have added tests, assuming new tests are warranted_.
* [ ] _I have updated the Terraform docs in this repo, assuming any changes to the schema of Resources or Data Sources have been made._
* [ ] _I understand that the `/test` comment will be ignored by the CI trigger [unless it is made by a repo admin or collaborator](https://codefresh.io/docs/docs/pipelines/triggers/git-triggers/#support-for-building-pull-requests-from-forks)._
6 changes: 2 additions & 4 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ jobs:
export PATH=$PATH:/home/runner/go/bin
make docs-prepare
tfplugindocs generate
- id: docs-need-updating
name: Validate No Changes
- name: Validate No Changes
run: |
git diff --exit-code
gofmt:
Expand All @@ -30,7 +29,6 @@ jobs:
- name: Run gofmt
run: |
go fmt
- id: go-needs-formatting
name: Validate No Changes
- name: Validate No Changes
run: |
git diff --exit-code
13 changes: 4 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

The documentation is generated using [tfplugindocs](https://github.com/hashicorp/terraform-plugin-docs).

`docs/` should never be edited by hand. Instead, update the documentation via updating `Description` fields within the `schema` blocks of the provider's resources and data sources. And if needed, update the templates in `templates/`. Finally, you can run the following command to re-generate the documentation:
`docs/` should never be edited by hand. Instead, update the documentation via updating `Description` fields within the `schema` blocks of the provider's resources and data sources. And if needed, update the templates in `templates/`.

You can always run the following command locally to re-generate the documentation:

```bash
make docs
Expand All @@ -19,11 +21,4 @@ make docs
### PR Requirements

1. Ensure that all tests pass (via commenting `/test` if you are an admin or a contributor with write access on this repo, otherwise wait for a maintainer to submit the comment. The comment will be ignored if you are not an admin or a contributor with write access on this repo. See: https://codefresh.io/docs/docs/pipelines/triggers/git-triggers/#support-for-building-pull-requests-from-forks)
2. Ensure that `make docs` has been run and the changes have been committed.
3. Ensure that `make fmt` has been run and the changes have been committed.

### Adding Yourself to the Contributors List

Comment on the PR with `@all-contributors please add @<username> for <contributions>` and the bot will add you to the contributors list. See: [All Contributors](https://allcontributors.org/docs/en/bot/usage).

For example: `@all-contributors please add @mitchellh for code`.
4. Ensure `make docs` and `make fmt` have been run and the changes have been committed. Otherwise, you will have failing status checks.
11 changes: 3 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,9 @@ make testacc

## Contributors

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->
<a href="https://github.com/codefresh-io/terraform-provider-codefresh/graphs/contributors">
<img src="https://contrib.rocks/image?repo=codefresh-io/terraform-provider-codefresh" />
</a>

## Acknowledgements

Expand Down
21 changes: 10 additions & 11 deletions codefresh.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,39 @@
version: '1.0'
version: "1.0"
stages:
- clone
- test
- pakcages
- release
steps:
main_clone:
title: 'Cloning main repository...'
title: "Cloning main repository..."
stage: clone
type: git-clone
repo: "${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}"
revision: "${{CF_REVISION}}"
git: cf_github

go_fmt:
title: 'Formatting'
title: "Formatting"
stage: test
image: goreleaser/goreleaser:v1.11.3
image: goreleaser/goreleaser:v1.15.2
commands:
- go fmt

go_test:
title: 'Run tests'
title: "Run tests"
stage: test
image: goreleaser/goreleaser:v1.11.3
image: goreleaser/goreleaser:v1.15.2
environment:
- TF_ACC="test"
commands:
- go test -v ./...
- go test -v ./...
retry:
maxAttempts: 3
delay: 5
exponentialFactor: 2

prepare_env_vars:
title: 'Preparing environment variables...'
title: "Preparing environment variables..."
stage: release
image: codefreshio/ci-helpers
environment:
Expand All @@ -53,7 +52,7 @@ steps:

release_binaries:
title: Create release in Github
image: goreleaser/goreleaser:v1.11.3
image: goreleaser/goreleaser:v1.15.2
stage: release
environment:
- GPG_FINGERPRINT=${{GPG_FINGERPRINT}}
Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/current_account.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ output "current_ac" {
```

The output example:
```
```hcl
Outputs:

current_ac = {
Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/idps.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This data source retrieves all Identity Providers (IdPs) in the system.

## Example Usage

```
```hcl
data "codefresh_idps" "idp_azure" {
display_name = "codefresh-onprem-tst-2"
# client_name = "2222"
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ It is possible that we will switch to the [Terraform Plugin Framework](https://g
### Prerequisites (other than Terraform)

- GNU Make
- [Go](https://golang.org/doc/install) `1.(n-2).x` (minimum supported Go version required to build the provider; n is the latest minor version listed [here](https://go.dev/dl/)).
- [Go](https://golang.org/doc/install) `1.18.x` (minimum supported Go version required to build the provider).

### Building and Running a Local Build of the Provider

Expand Down
3 changes: 1 addition & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ For example:
provider "codefresh" {
api_key = "..."
}

provider "codefresh" {
api_key = "..."
alias = "acme-dev"
Expand All @@ -49,4 +48,4 @@ resource "codefresh_pipeline" "pipeline-dev" {
provider = codefresh.acme-dev
... # Omited for brevity
}
```
```
1 change: 0 additions & 1 deletion docs/resources/step_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ resource "codefresh_step_types_versions" "my-custom-step" {
}
....
}
}
```

<!-- schema generated by tfplugindocs -->
Expand Down
2 changes: 1 addition & 1 deletion templates/data-sources/current_account.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ output "current_ac" {
```

The output example:
```
```hcl
Outputs:

current_ac = {
Expand Down
2 changes: 1 addition & 1 deletion templates/data-sources/idps.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ description: |-

## Example Usage

```
```hcl
data "codefresh_idps" "idp_azure" {
display_name = "codefresh-onprem-tst-2"
# client_name = "2222"
Expand Down
2 changes: 1 addition & 1 deletion templates/guides/development.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ It is possible that we will switch to the [Terraform Plugin Framework](https://g
### Prerequisites (other than Terraform)

- GNU Make
- [Go](https://golang.org/doc/install) `1.(n-2).x` (minimum supported Go version required to build the provider; n is the latest minor version listed [here](https://go.dev/dl/)).
- [Go](https://golang.org/doc/install) `1.18.x` (minimum supported Go version required to build the provider).

### Building and Running a Local Build of the Provider

Expand Down
1 change: 0 additions & 1 deletion templates/resources/step_types.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ resource "codefresh_step_types_versions" "my-custom-step" {
}
....
}
}
```

{{ .SchemaMarkdown | trimspace }}