Skip to content

Commit 7ea3133

Browse files
trouzeclaude
andcommitted
docs: update CONTRIBUTING and PR template for act + pre-commit workflow
Replace Makefile-based dev instructions with pre-commit hooks, pre-push hooks, and act for local CI parity; add new prerequisites and one-time setup command. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent 09f0aa4 commit 7ea3133

2 files changed

Lines changed: 46 additions & 21 deletions

File tree

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717

1818
## Checklist
1919

20-
- [ ] `make fmt` passes
21-
- [ ] `make test` passes
22-
- [ ] `make lint` passes
20+
- [ ] pre-commit hooks pass (`git commit` triggers fmt, validate, lint, docs)
21+
- [ ] pre-push hooks pass (`git push` triggers terraform test + YAML schema self-tests)
22+
- [ ] `act` passes locally (or `act -j <job>` for the jobs you touched)
2323
- [ ] `CHANGELOG.md` updated under `[Unreleased]`
2424
- [ ] Docs updated if behavior changed

CONTRIBUTING.md

Lines changed: 43 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,18 @@ Feature requests are welcome! Please include:
4545
- Update documentation as needed
4646

4747
3. **Test your changes**
48+
49+
Pre-commit hooks run automatically on `git commit` (fmt, validate, lint, docs) and pre-push hooks run on `git push` (terraform test + YAML schema self-tests). To run all hooks manually without committing:
50+
51+
```bash
52+
pre-commit run --all-files
53+
```
54+
55+
To check CI parity before opening a PR:
56+
4857
```bash
49-
make fmt # auto-format
50-
make test # run tests with mock providers (no credentials needed)
51-
make lint # run tflint
58+
act
59+
act -j <jobname>
5260
```
5361

5462
4. **Commit with clear messages**
@@ -68,6 +76,11 @@ Feature requests are welcome! Please include:
6876
- Terraform >= 1.7 (use [tfenv](https://github.com/tfutils/tfenv) or [asdf](https://asdf-vm.com/)`.terraform-version` is provided)
6977
- [tflint](https://github.com/terraform-linters/tflint)
7078
- Git
79+
- [pre-commit](https://pre-commit.com/#install)
80+
- [uv](https://docs.astral.sh/uv/getting-started/installation/)
81+
- Docker (required by `act`)
82+
- [act](https://github.com/nektos/act)
83+
- [terraform-docs](https://terraform-docs.io/user-guide/installation/) v0.20.0
7184

7285
### Local Development
7386

@@ -78,30 +91,42 @@ cd terraform-dbtcloud-as-yaml
7891
terraform init -backend=false
7992
```
8093

81-
### Available Make Targets
94+
One-time setup after cloning:
8295

83-
Run `make help` to see all targets:
84-
85-
```
86-
make fmt # Auto-format all Terraform files
87-
make fmt-check # Check formatting without modifying (used in CI)
88-
make lint # Run tflint on all modules
89-
make validate # Run terraform validate
90-
make test # Run terraform test with mock providers (no credentials needed)
91-
make docs # Regenerate terraform-docs for all modules
92-
make pre-commit # Run all pre-commit hooks on staged files
96+
```bash
97+
pre-commit install --hook-type pre-commit --hook-type pre-push
9398
```
9499

100+
### Developer workflow
101+
102+
| Action | What runs |
103+
|---|---|
104+
| `git commit` | fmt, validate, lint, docs, schema-drift (pre-commit hooks) |
105+
| `git push` | `terraform test` (root + all 5 modules), YAML schema self-tests (pre-push hooks) |
106+
| `pre-commit run --all-files` | All pre-commit hooks on every file |
107+
| `bash scripts/gen-docs.sh` | Regenerate terraform-docs manually |
108+
| `act` | Full CI parity — all jobs |
109+
| `act -j <jobname>` | Single CI job (`validate`, `module-tests`, `docs`, `schema-drift`, `yaml-validate`, `mkdocs-build`) |
110+
| `cd test && RUN_INTEGRATION_TESTS=1 DBT_CLOUD_ACCOUNT_ID=... DBT_CLOUD_TOKEN=... go test -v -timeout 30m -run Integration ./...` | Integration tests (requires dbt Cloud credentials) |
111+
95112
## Testing
96113

97-
Before submitting a PR:
114+
Before submitting a PR, verify that all hooks pass and CI is green locally:
115+
116+
```bash
117+
pre-commit run --all-files
118+
act
119+
```
120+
121+
For integration tests (requires dbt Cloud credentials):
98122

99123
```bash
100-
make fmt-check # verify formatting
101-
make test # runs all tests against mock providers — no dbt Cloud credentials needed
102-
make lint # check for linting issues
124+
cd test && RUN_INTEGRATION_TESTS=1 DBT_CLOUD_ACCOUNT_ID=<id> DBT_CLOUD_TOKEN=<token> \
125+
go test -v -timeout 30m -run Integration ./...
103126
```
104127

128+
You can also trigger the `integration.yml` workflow from the GitHub Actions UI.
129+
105130
## Documentation
106131

107132
- Update `README.md` for user-facing changes

0 commit comments

Comments
 (0)