|
| 1 | +# Project Guidelines |
| 2 | + |
| 3 | +## What maintainers consistently push for |
| 4 | + |
| 5 | +- Keep changes tightly scoped. Prefer the smallest viable fix over broad cleanup or multi-issue refactors. |
| 6 | +- Match existing patterns in the surrounding file instead of introducing new abstractions unless there is a clear repeated need. |
| 7 | +- Favor readability and explicit behavior over cleverness; reviewers routinely call out structure, naming, and unnecessary complexity. |
| 8 | + |
| 9 | +## Provider implementation |
| 10 | + |
| 11 | +- Follow the modern Terraform Plugin SDK patterns already used in this repo, including `ReadContext`, `schema.ImportStatePassthroughContext`, and `ValidateDiagFunc`. |
| 12 | +- Avoid deprecated SDK APIs when an established replacement already exists in the codebase. |
| 13 | +- Preserve existing behavior unless the change is intentional and covered by tests. |
| 14 | +- Be careful with GitHub API updates: only send fields when they actually changed, avoid widening side effects, and handle expected `404`/not-found cases gracefully when the resource should disappear from state. |
| 15 | +- Keep helpers local and focused. Prefer a small helper in the same file over a sweeping refactor. |
| 16 | + |
| 17 | +## Tests |
| 18 | + |
| 19 | +- For bug fixes and features, add or update tests. Acceptance tests are the default for resource and data source behavior. |
| 20 | +- Reuse the acceptance-test harness in `github/acc_test.go`, especially helpers like `skipUnlessMode`, `skipUnlessEnterprise`, `skipUnlessHasOrgs`, and related mode gates. |
| 21 | +- When a resource supports import, add or preserve import verification coverage. |
| 22 | +- Keep test coverage close to the behavior change instead of relying on unrelated broad test rewrites. |
| 23 | + |
| 24 | +## Docs |
| 25 | + |
| 26 | +- Update docs whenever schema, import behavior, or user-visible behavior changes. |
| 27 | +- Check the pull request checklist in `.github/pull_request_template.md` and keep docs in sync with code. |
| 28 | +- Be concise but complete. Reviewers do flag wording, capitalization, headings, and missing examples in docs. |
| 29 | + |
| 30 | +## Build and validation |
| 31 | + |
| 32 | +- Use the repo commands from `GNUmakefile` when validating changes: `make lintcheck`, `make website-lint`, `make build`, and `make test`. |
| 33 | +- Follow the contribution workflow in `CONTRIBUTING.md` for local setup and acceptance-test expectations. |
| 34 | + |
| 35 | +## Pull request mindset |
| 36 | + |
| 37 | +- Assume maintainers will prefer a narrowly targeted PR with tests and docs over a larger “while I’m here” rewrite. |
| 38 | +- If a change touches a brittle or actively changing area, keep the implementation incremental and avoid mixing compatibility cleanups with behavior changes in the same patch. |
0 commit comments