Skip to content

Commit cc5b69e

Browse files
committed
Update CONTRIBUTING.md
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
1 parent 7afb7db commit cc5b69e

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

CONTRIBUTING.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ Before submitting an issue or a pull request, please search the repository for e
1313
1. Fork and clone the repository.
1414
2. Create a new branch: `git switch -c my-branch-name`.
1515
3. Make your change, add tests, and make sure the tests still pass.
16-
4. Push to your fork and submit a pull request.
17-
5. Pat yourself on the back and wait for your pull request to be reviewed and merged.
16+
4. Update or add documentation to reflect your changes.
17+
5. Ensure formatting and linting are passing.
18+
6. Push to your fork and submit a pull request.
19+
7. Pat yourself on the back and wait for your pull request to be reviewed and merged.
1820

1921
Here are a few things you can do that will increase the likelihood of your pull request being accepted:
2022

@@ -47,21 +49,21 @@ Once you have the repository cloned, there's a couple of additional steps you'll
4749
```
4850

4951
- Build the project with `make build`
50-
- Try an example test run from the default (`main`) branch, like `TF_LOG=DEBUG TF_ACC=1 go test -v ./... -run ^TestAccGithubRepositories`. All those tests should pass.
52+
- Try an example test run from the default (`main`) branch, like `TF_LOG=DEBUG make testacc T=TestAccGithubRepositories`. All those tests should pass.
5153

5254
### Local Development Iteration
5355

5456
1. Write a test describing what you will fix. See [`github_label`](./github/resource_github_issue_label_test.go) for an example format.
5557
2. Run your test and observe it fail. Enabling debug output allows for observing the underlying requests and responses made as well as viewing state (search `STATE:`) generated during the acceptance test run.
5658

5759
```sh
58-
TF_LOG=DEBUG TF_ACC=1 go test -v ./... -run ^TestAccGithubIssueLabel
60+
TF_LOG=DEBUG make testacc T=TestAccGithubIssueLabel
5961
```
6062

6163
1. Align the resource's implementation to your test case and observe it pass:
6264

6365
```sh
64-
TF_ACC=1 go test -v ./... -run ^TestAccGithubIssueLabel
66+
make testacc T=TestAccGithubIssueLabel
6567
```
6668

6769
Note that some resources still use a previous format that is incompatible with automated test runs, which depend on using the `skipUnlessMode` helper. When encountering these resources, tests should be rewritten to the latest format.
@@ -70,7 +72,7 @@ Also note that there is no build / `terraform init` / `terraform plan` sequence
7072

7173
### Debugging the terraform provider
7274

73-
Println debugging can easily be used to obtain information about how code changes perform. If the `TF_LOG=DEBUG` level is set, calls to `log.Printf("[DEBUG] your message here")` will be printed in the program's output.
75+
Println debugging can easily be used to obtain information about how code changes perform. If the `TF_LOG=DEBUG` level is set, debug messages will be printed. Use `tflog.Debug(ctx, "your message here", map[string]any{...})` for new code. Some existing code still uses `log.Printf("[DEBUG] ...")` — see [ARCHITECTURE.md](ARCHITECTURE.md#logging) for the migration pattern.
7476

7577
If a full debugger is desired, VSCode may be used. In order to do so,
7678

@@ -88,7 +90,7 @@ If a full debugger is desired, VSCode may be used. In order to do so,
8890

8991
Setting a `processId` of 0 allows a dropdown to select the process of the provider.
9092

91-
1. Add a sleep call (e.g. `time.Sleep(10 * time.Second)`) in the [`func providerConfigure(p *schema.Provider) schema.ConfigureFunc`](https://github.com/integrations/terraform-provider-github/blob/cec7e175c50bb091feecdc96ba117067c35ee351/github/provider.go#L274C1-L274C64) before the immediate `return` call. This will allow time to connect the debugger while the provider is initializing, before any critical logic happens.
93+
1. Add a sleep call (e.g. `time.Sleep(10 * time.Second)`) in `providerConfigure` (in `github/provider.go`) before the immediate `return` call. This will allow time to connect the debugger while the provider is initializing, before any critical logic happens.
9294

9395
2. Build the terraform provider with debug flags enabled and copy it to the appropriate bin folder with a command like `go build -gcflags="all=-N -l" -o ~/go/bin/`.
9496

@@ -104,7 +106,7 @@ Manual testing should be performed on each PR opened in order to validate the pr
104106

105107
### Using a local version of the provider
106108

107-
Build the provider and specify the output directory:
109+
Build the provider with debug flags for attaching a debugger:
108110

109111
```sh
110112
go build -gcflags="all=-N -l" -o ~/go/bin/
@@ -179,6 +181,7 @@ export GH_TEST_EXTERNAL_USER2=
179181

180182
# Configure values for the enterprise under test
181183
export GH_TEST_ENTERPRISE_EMU_GROUP_ID=
184+
export GITHUB_ENTERPRISE_SLUG=
182185

183186
# Configure test options
184187
export GH_TEST_ADVANCED_SECURITY=

0 commit comments

Comments
 (0)