You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+47-1Lines changed: 47 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,6 +66,48 @@ Thank you for contributing! Here you will find the information on what to includ
66
66
* For PRs that follow the guidelines, we expect to review and merge very quickly.
67
67
* PRs that do not follow the guidelines is annotated with what they are missing. A community or core team member may be able to swing around and help finish up the work, but these PRs generally hang out much longer until completed and merged.
68
68
69
+
---
70
+
71
+
# **Provider-wide Best Practices (Mandatory for all PRs)**
72
+
73
+
### Schema Rules
74
+
-**Required** fields must be supplied by the user; if changing them requires recreation, mark as **ForceNew**.
75
+
-**Optional** fields must not be sent when unset; avoid sending empty strings.
76
+
-**Computed** fields are assigned only in `Read`, never in Create/Update.
77
+
-**Optional + Computed** fields are used when APIs provide defaults or canonicalized values.
78
+
-**Sensitive** must be applied to passwords, tokens, and secret fields.
-**Create:** Only send meaningful values. Always return to `Read` afterwards.
86
+
-**Read:** Canonicalize; normalize sets/lists; clear ID on 404.
87
+
-**Update:** Only update attributes supported by API. Never simulate recreate inside Update.
88
+
-**Delete:** Treat 404 as success. Always clear ID.
89
+
90
+
### Diff & Normalization
91
+
- Avoid `DiffSuppressFunc` unless equivalence is provably correct.
92
+
- Normalize unordered results in **Read** using sorted lists/sets.
93
+
- Don’t ignore user changes unless API truly ignores them.
94
+
95
+
### Validation
96
+
- Always use validators for string length, patterns, enums.
97
+
- Fail early when invalid input is easier for user to correct.
98
+
99
+
### Acceptance Tests
100
+
- Include idempotency checks: second apply should produce **0 changes**.
101
+
- Always include a `CheckDestroy`.
102
+
- Never rely solely on state; verify against API responses.
103
+
- Randomize resource names to avoid collisions.
104
+
105
+
### Documentation
106
+
- Every schema change must update docs in the same PR.
107
+
- New resources require a complete doc page + examples.
108
+
109
+
---
110
+
69
111
### Checklists for contribution
70
112
71
113
There are different kinds of contribution, each of which has its own standards for a speedy review. The following sections describe the guidelines for each type of the contribution.
@@ -278,6 +320,7 @@ The `IBM Cloud Provider for Terraform` release can be mainly classified in to th
278
320
- Dev release
279
321
280
322
### Production release
323
+
281
324
Typically, the production release of the `IBM CloudProviderforTerraform` will be made, once in a month. The release can be major or minor based on the PR's commited. The production release is targetted from branch **release**. Once the release is published, users can download the binary from [Terraform registry](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest).
282
325
283
326
#### How to use this provider
@@ -306,6 +349,7 @@ Typically, the pre-production releases of the `IBM Cloud Provider for Terraform`
306
349
~> **Note** A pre-release version is a version number that contains a suffix introduced by a dash, such as **1.38.0-pre**. A pre-release version can be selected only by an exact version constraint (the = operator or no operator). Pre-release versions do not match inexact operators such as `>=`, `~>`, etc.
307
350
308
351
#### How to use this provider
352
+
309
353
To install Terraform 0.13 or higher version provider, copy and paste this code into your Terraform configuration. Then, run `terraform init`.
310
354
311
355
```terraform
@@ -325,7 +369,7 @@ provider "ibm" {
325
369
326
370
### Dev release
327
371
328
-
The individual developers or the IBM Cloud Service team can make their own `dev` releases, from their respective Git repository (forked from https://github.com/IBM-Cloud/terraform-provider-ibm).
372
+
The individual developers or the IBM Cloud Service team can make their own `dev` releases, from their respective Git repository (forked from [https://github.com/IBM-Cloud/terraform-provider-ibm](https://github.com/IBM-Cloud/terraform-provider-ibm)).
329
373
330
374
Note: You can use the existing GitHub actions to run the release workflows, in your forked repository. You can prepare a `dev` release by adding a new version tag in your repository.
331
375
@@ -347,6 +391,7 @@ Note: You can use the existing GitHub actions to run the release workflows, in y
347
391
- On Windows, the file must be named **terraform.rc** and placed in the relevant user's %APPDATA% directory.
348
392
- On all other systems, the file must be named **.terraformrc** (note the leading period) and placed directly in the home directory of the relevant user.
349
393
- Add below content to CLI configuration file
394
+
350
395
```terraform
351
396
provider_installation {
352
397
filesystem_mirror {
@@ -358,3 +403,4 @@ Note: You can use the existing GitHub actions to run the release workflows, in y
0 commit comments