Skip to content

Commit a70ecc9

Browse files
authored
Add dev process and rc docs (#1138)
1 parent 3343210 commit a70ecc9

3 files changed

Lines changed: 94 additions & 5 deletions

File tree

README.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,33 +61,43 @@ $ terraform plan
6161
$ terraform apply
6262
```
6363

64+
See [development process](docs/development-process.md) for more details.
65+
6466
Testing the Provider
6567
---------------------------
6668

67-
In order to test the provider, you can simply run `make test`.
69+
In order to test the provider, simply run `make test`.
6870

6971
```sh
7072
$ make test
7173
```
7274

73-
In order to run the full suite of Acceptance tests, a running rancher system, a rancher API key and a working k8s cluster imported are needed. Also, acceptance tests are covering Rancher server upgrade, v2.3.6 and v2.4.2
75+
In order to run the full suite of Acceptance tests, a running rancher system, a rancher API key and a working k8s cluster imported are needed. Acceptance tests cover a Rancher server upgrade, v2.3.6 and v2.4.2.
7476

75-
To run acceptance tests, you can simply run `make testacc`. `scripts/gotestacc.sh` will be run, deploying all needed requirements, running acceptance tests and cleanup.
77+
To run the Acceptance tests, simply run `make testacc`. `scripts/gotestacc.sh` will be run, deploying all needed requirements, running tests and cleanup.
7678

7779
```sh
7880
$ make testacc
7981
```
8082

81-
Due to [network limitation](https://docs.docker.com/docker-for-mac/networking/#known-limitations-use-cases-and-workarounds) on docker for osx and/or windows, there is a way to run dockerized acceptance test.
83+
Due to [network limitations](https://docs.docker.com/docker-for-mac/networking/#known-limitations-use-cases-and-workarounds) on Docker for osx and/or windows, there is a way to run dockerized acceptance test.
8284

8385
```sh
8486
$ EXPOSE_HOST_PORTS=true make docker-testacc
8587
```
8688

89+
To run the structure tests, run
90+
91+
```sh
92+
$ go clean --testcache && go test -v ./rancher2
93+
```
94+
95+
See [test process](docs/test-process.md) for details on release testing (_Terraform Maintainers Only_).
96+
8797
Branching the Provider
8898
---------------------------
8999

90-
The provider is branched into two release lines that have major version alignment with Rancher 2.6 and 2.7. The `release/v2` branch with 2.0.0+ is aligned with Rancher 2.6 and `master` with 3.0.0+ is aligned with Rancher 2.7. Terraform provider fixes and new features will be available on `master` but only bug fixes will be backported to `release/v2` as necessary.
100+
The provider is branched into two release lines that have major version alignment with Rancher 2.6 and 2.7. The `release/v2` branch with 2.0.0+ is aligned with Rancher 2.6 and `master` with 3.0.0+ is aligned with Rancher 2.7. Terraform provider fixes and new features will be available on `master` but only critical bug fixes will be backported to `release/v2`.
91101

92102
Aligning major provider releases with minor Rancher releases means,
93103

docs/development-process.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Rancher2 Provider
2+
3+
Terraform has recently evolved into a spotlight infrastructure provisioning tool that is maintained by Rancher engineering. As its popularity grows, so will its open source development.
4+
5+
Improvements to note since Jan 2023
6+
* Rancher2 Provider docs
7+
* Branching into `master 3.x.x` for Rancher 2.7 clusters and `release/v2 2.x.x` for Rancher 2.6 clusters
8+
* Scripts to test Terraform RCs locally on unix and windows
9+
10+
### Development Process
11+
12+
If you are an open source contributor,
13+
14+
1. Add a feature / bug fix and smoke test it
15+
2. Add or update tests
16+
3. Open a PR! Add detailed test steps to **Testing** on the [PR template](.github/pull_request_template.md) so Terraform maintainers know how to test your solution.
17+
4. Get 2 PR reviews (at least 1 from a Terraform maintainer)
18+
5. Merge your PR (a Terraform maintainer will do this if you do not have repo access)

docs/test-process.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Rancher2 Provider
2+
3+
_For Terraform Maintainers Only_
4+
5+
QA has a new process to test Terraform using RCs which will enable us to better test this tool before a release is published.
6+
7+
### Test Process
8+
9+
1. Cut a Terraform RC.
10+
11+
Terraform RCs enable QA to test features and bug fixes _before_ the next Terraform version is released. This process is also how Rancher is tested and released. Terraform is expected to mirror Rancher's functionality and use of third party packages because it uses the Rancher API, so it's ideal and best practice to test the provider in the same way.
12+
13+
To cut an RC, tag the latest commit. Bump the minor version for new features and the patch version for bug fixes only.
14+
15+
For example, if the latest tag on `master` is `v3.0.0` and the commits since that tag contain a new feature,
16+
17+
```sh
18+
$ git tag v3.1.0-rc1
19+
$ git push upstream v3.1.0-rc1
20+
```
21+
22+
If all commits since the latest tag are only bug fixes,
23+
24+
```sh
25+
$ git tag v3.0.1-rc1
26+
$ git push upstream v3.0.1-rc1
27+
```
28+
29+
If the latest tag is already an RC, say `v3.0.1-rc1`,
30+
31+
```sh
32+
$ git tag v3.0.1-rc2
33+
$ git push upstream v3.0.1-rc2
34+
```
35+
36+
2. Move the issue To Test
37+
3. QA uses the test plan and the Terraform RC to test the feature or bug fix using [this script](https://github.com/rancher/terraform-provider-rancher2/blob/master/setup-provider.sh). How to instructions are included in the script.
38+
39+
QA will test using a downloaded binary from the RC. Using an RC asset enables us to quickly test features and bugs without waiting for Hashicorp to publish a pre-release. This script sets up the correct binary using a defined `<provider> <version>` to test updates locally.
40+
41+
```sh
42+
$ ./setup-provider.sh <provider> <version>
43+
```
44+
45+
Example
46+
```sh
47+
$ ./setup-provider.sh rancher2 v3.0.0-rc1
48+
```
49+
50+
There is also a [windows script](https://github.com/rancher/terraform-provider-rancher2/blob/master/setup-provider-windows.ps1) for cross-platform support.
51+
52+
```powershell
53+
PS /> ./setup-provider-windows.ps1 <provider> <version>
54+
```
55+
56+
Example
57+
```powershell
58+
PS /> ./setup-provider-windows.ps1 rancher2 v3.0.0-rc1
59+
```
60+
61+
4. If test validation passes, issue is closed. If not, it is reopened.

0 commit comments

Comments
 (0)