Skip to content

Commit 4751739

Browse files
author
iru
authored
docs: enhance contribution guidelines (#214)
1 parent c56e349 commit 4751739

File tree

2 files changed

+63
-39
lines changed

2 files changed

+63
-39
lines changed

.github/pull_request_template.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!--
2+
Thank you for your contribution!
3+
4+
For a cleaner PR make sure you follow these recommendations:
5+
- Add the **scope** of the affected area in the PR name, following [Conventional Commit](https://www.conventionalcommits.
6+
org/en/v1.0.0/) format
7+
ex.: feat(secure-policy): Add runbook to policy resources
8+
- If not there yet, add yourself and/or your team as the **Codeowners** of the affected area
9+
- Make sure to modify the respective **tests**
10+
- Make sure to modify the respective **documentation**
11+
-->

README.md

Lines changed: 52 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -6,40 +6,40 @@
66
Terraform Provider for Sysdig
77
=============================
88

9-
- Website: https://www.terraform.io
10-
- [![Gitter chat](https://badges.gitter.im/hashicorp-terraform/Lobby.png)](https://gitter.im/hashicorp-terraform/Lobby)
11-
- Mailing list: [Google Groups](http://groups.google.com/group/terraform-tool)
9+
- **[Terraform Registry - Sysdig Provider Docs](https://registry.terraform.io/providers/sysdiglabs/sysdig/latest/docs)**
1210
- [Blog on how to use this provider with Sysdig Secure](https://sysdig.com/blog/using-terraform-for-container-security-as-code/)
11+
- Terraform
12+
- Website: https://www.terraform.io
13+
- Mailing list on [Google Groups](http://groups.google.com/group/terraform-tool)
14+
- [![Gitter chat](https://badges.gitter.im/hashicorp-terraform/Lobby.png)](https://gitter.im/hashicorp-terraform/Lobby)
1315

1416

15-
Requirements
16-
------------
1717

18-
- [Terraform](https://www.terraform.io/downloads.html) > 0.12.x
19-
- [Go](https://golang.org/doc/install) > 1.15 (to build the provider plugin)
18+
Contribute
19+
---------------------------
20+
21+
22+
### - Building
23+
24+
#### Requirements
2025

21-
Building The Provider
22-
---------------------
26+
- [Terraform](https://www.terraform.io/downloads.html) > 0.12.x
27+
- [Go](https://golang.org/doc/install) > 1.15 (to build the provider plugin)
28+
- If you wish to work on the provider, you'll first need [Go](http://www.golang.org) installed on your machine
29+
(version 1.15+ is *required*). You'll also need to correctly setup a [GOPATH](http://golang.org/doc/code.html#GOPATH), as well as adding `$GOPATH/bin` to your `$PATH`.
2330

24-
Clone repository to: `$GOPATH/src/github.com/draios/terraform-provider-sysdig`
31+
#### - Developing
32+
33+
First **clone** source repository to: `$GOPATH/src/github.com/draios/terraform-provider-sysdig`
2534

2635
```sh
2736
$ git clone [email protected]:draios/terraform-provider-sysdig
2837
$ cd terraform-provider-sysdig
2938
$ make build
3039
```
3140

32-
Using the provider
33-
----------------------
34-
If you're building the provider, follow the instructions to [install it as a plugin.](https://www.terraform.io/docs/plugins/basics.html#installing-a-plugin) After placing it into your plugins directory, run `terraform init` to initialize it.
35-
36-
37-
Contribute
38-
---------------------------
39-
40-
If you wish to work on the provider, you'll first need [Go](http://www.golang.org) installed on your machine (version 1.13+ is *required*). You'll also need to correctly setup a [GOPATH](http://golang.org/doc/code.html#GOPATH), as well as adding `$GOPATH/bin` to your `$PATH`.
4141

42-
To compile the provider, run `make build`. This will build the provider and put the provider binary in the `$GOPATH/bin` directory.
42+
To **compile** the provider, run `make build`. This will build the provider and put the provider binary in the `$GOPATH/bin` directory.
4343

4444
```sh
4545
$ make build
@@ -48,27 +48,27 @@ $ $GOPATH/bin/terraform-provider-sysdig
4848
...
4949
```
5050

51-
In order to test the provider, you can simply run `make test`.
51+
In order to **test** the provider, you can simply run `make test`.
5252

5353
```sh
5454
$ make test
5555
```
5656

57-
If you want to execute the acceptance tests, you can run `make testacc`.
57+
If you want to execute the **acceptance tests**, you can run `make testacc`.
5858

5959
```sh
6060
$ make testacc
6161
```
6262

63-
To use the local provider you just built, get it installed in your machine with:
63+
To use the local provider you just built, follow the instructions to [**install** it as a plugin.](https://www.terraform.io/docs/plugins/basics.html#installing-a-plugin) in your machine with:
6464

6565
```sh
6666
$ make install
6767
```
6868

69-
That will add the provider to the terraform plugins dir. Then just set `source` and `version` values appropiately:
69+
That will add the provider to the terraform plugins dir. Then just set `source` and `version` values appropriately:
7070

71-
```
71+
```terraform
7272
provider "aws" {
7373
region = my_region
7474
}
@@ -85,39 +85,52 @@ terraform {
8585

8686
To uninstall the plugin:
8787

88-
```
88+
```sh
8989
$ make uninstall
9090
```
9191

92-
9392
<br/>:warning:Please note that you need a token for Monitor and Secure, and since the **acceptance tests create real infrastructure**
9493
you should execute them in an environment where you can remove the resorces easily.
9594

9695

9796

98-
### Creating new resource / data sources
97+
### - Creating new resource / data sources
9998

10099
TL;DR;
101100
- Create the resource/data source item
102101
- Add the created item into the `provider.go` resource or datasource map with its wiring
103-
- With its [acceptance test](https://www.terraform.io/plugin/sdkv2/testing/acceptance-tests)
104-
- Add its documentation page on `./website/docs/`
102+
- With its [acceptance **test**](https://www.terraform.io/plugin/sdkv2/testing/acceptance-tests)
103+
- Add its **documentation** page on `./website/docs/`
105104

106105

107-
https://www.terraform.io/plugin
108-
https://www.hashicorp.com/blog/testing-hashicorp-terraform
106+
Interesting resources
107+
- https://www.terraform.io/plugin
108+
- https://www.hashicorp.com/blog/testing-hashicorp-terraform
109109

110110

111-
### Proposing PR's
111+
### - Proposing PR's
112112

113+
* if it's your first time, validate you're taking into account every aspect of the [`./github/pull_request_template`](.github/pull_request_template.md)
113114
* on pull-requests some validations are enforced.
114-
this can be prevented using [**pre-commit**](https://pre-commit.com)
115-
* Defined in [`/.pre-commit-config.yaml`](https://github.com/sysdiglabs/terraform-provider-sysdig/blob/master/.pre-commit-config.yaml)
116-
* for `testacc` some credentials are required, check [`/.envrc.template`](https://github.com/sysdiglabs/terraform-provider-sysdig/blob/master/.envrc.template)
115+
- Defined in [`/.pre-commit-config.yaml`](https://github.com/sysdiglabs/terraform-provider-sysdig/blob/master/.pre-commit-config.yaml)
116+
- You can work on this before even pushing to remote, using [**pre-commit**](https://pre-commit.com) plugin
117+
118+
* for Acceptance Tests `testacc` some credentials are required, check [`/.envrc.template`](https://github.com/sysdiglabs/terraform-provider-sysdig/blob/master/.envrc.template)
117119

118120

119-
### Release
121+
### - Release
120122

121-
* Use **semver** for releases https://semver.org
122-
* To create a new release, create and push a new tag and it will be released by [`/.github/workflows/release.yml`](https://github.com/sysdiglabs/terraform-provider-sysdig/blob/master/.github/workflows/release.yml)
123+
To create a new release, create and push a new **tag**, and it will be released following [`/.
124+
github/workflows/release.yml`](https://github.com/sysdiglabs/terraform-provider-sysdig/blob/master/.github/workflows/release.yml).
125+
126+
* Before releasing check the **diff** between previous tag and master branch, to spot major changes
127+
* For **tag**, use **[semver](https://semver.org)**
128+
* Review Released Draft Note, and make it as clear as possible.
123129
* Notify Sysdig teams on our internal #release-announcements slack channel and optionally in #terraform-provider
130+
131+
Mange takk!
132+
133+
![giphy](https://user-images.githubusercontent.com/1073243/200767344-7435f322-24c0-44d2-ac56-468791c84ca5.gif)
134+
135+
136+

0 commit comments

Comments
 (0)