Skip to content

Commit 38828b4

Browse files
Merge branch 'main' into add-devcontainer-template
2 parents d64024c + a1786a0 commit 38828b4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+5164
-327
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
Closes #
2-
31
## Description
42

53
<!-- Briefly describe what this PR does and why -->
64

75
## Type of Change
86

97
- [ ] New module
8+
- [ ] New template
109
- [ ] Bug fix
1110
- [ ] Feature/enhancement
1211
- [ ] Documentation
@@ -20,10 +19,16 @@ Closes #
2019
**New version:** `v1.0.0`
2120
**Breaking change:** [ ] Yes [ ] No
2221

22+
## Template Information
23+
24+
<!-- Delete this section if not applicable -->
25+
26+
**Path:** `registry/[namespace]/templates/[template-name]`
27+
2328
## Testing & Validation
2429

2530
- [ ] Tests pass (`bun test`)
26-
- [ ] Code formatted (`bun run fmt`)
31+
- [ ] Code formatted (`bun fmt`)
2732
- [ ] Changes tested locally
2833

2934
## Related Issues

.github/typos.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Hashi = "Hashi"
55
HashiCorp = "HashiCorp"
66
mavrickrishi = "mavrickrishi" # Username
77
mavrick = "mavrick" # Username
8+
inh = "inh" # Option in setpriv command
89

910
[files]
1011
extend-exclude = ["registry/coder/templates/aws-devcontainer/architecture.svg"] #False positive

.github/workflows/ci.yaml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,26 @@ jobs:
1313
steps:
1414
- name: Check out code
1515
uses: actions/checkout@v5
16+
- name: Detect changed files
17+
uses: dorny/paths-filter@v3
18+
id: filter
19+
with:
20+
list-files: shell
21+
filters: |
22+
shared:
23+
- 'test/**'
24+
- 'package.json'
25+
- 'bun.lock'
26+
- 'bunfig.toml'
27+
- 'tsconfig.json'
28+
- '.github/workflows/ci.yaml'
29+
- 'scripts/ts_test_auto.sh'
30+
- 'scripts/terraform_test_all.sh'
31+
- 'scripts/terraform_validate.sh'
32+
modules:
33+
- 'registry/**/modules/**'
34+
all:
35+
- '**'
1636
- name: Set up Terraform
1737
uses: coder/coder/.github/actions/setup-tf@main
1838
- name: Set up Bun
@@ -27,8 +47,22 @@ jobs:
2747
- name: Install dependencies
2848
run: bun install
2949
- name: Run TypeScript tests
30-
run: bun test
50+
env:
51+
ALL_CHANGED_FILES: ${{ steps.filter.outputs.all_files }}
52+
SHARED_CHANGED: ${{ steps.filter.outputs.shared }}
53+
MODULE_CHANGED_FILES: ${{ steps.filter.outputs.modules_files }}
54+
run: bun tstest
55+
- name: Run Terraform tests
56+
env:
57+
ALL_CHANGED_FILES: ${{ steps.filter.outputs.all_files }}
58+
SHARED_CHANGED: ${{ steps.filter.outputs.shared }}
59+
MODULE_CHANGED_FILES: ${{ steps.filter.outputs.modules_files }}
60+
run: bun tftest
3161
- name: Run Terraform Validate
62+
env:
63+
ALL_CHANGED_FILES: ${{ steps.filter.outputs.all_files }}
64+
SHARED_CHANGED: ${{ steps.filter.outputs.shared }}
65+
MODULE_CHANGED_FILES: ${{ steps.filter.outputs.modules_files }}
3266
run: bun terraform-validate
3367
validate-style:
3468
name: Check for typos and unformatted code
@@ -48,7 +82,7 @@ jobs:
4882
- name: Validate formatting
4983
run: bun fmt:ci
5084
- name: Check for typos
51-
uses: crate-ci/typos@v1.36.3
85+
uses: crate-ci/typos@v1.38.1
5286
with:
5387
config: .github/typos.toml
5488
validate-readme-files:

.icons/auto-dev-server.svg

Lines changed: 4 additions & 0 deletions
Loading

.icons/folder.svg

Lines changed: 1 addition & 0 deletions
Loading

.icons/nexus-repository.svg

Lines changed: 5 additions & 0 deletions
Loading

CONTRIBUTING.md

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -124,18 +124,23 @@ This script generates:
124124
- Accurate description and usage examples
125125
- Correct icon path (usually `../../../../.icons/your-icon.svg`)
126126
- Proper tags that describe your module
127-
3. **Create at least one `.tftest.hcl`** to test your module with `terraform test`
127+
3. **Create tests for your module:**
128+
- **Terraform tests**: Create a `*.tftest.hcl` file and test with `terraform test`
129+
- **TypeScript tests**: Create `main.test.ts` file if your module runs scripts or has business logic that Terraform tests can't cover
128130
4. **Add any scripts** or additional files your module needs
129131

130132
### 4. Test and Submit
131133

132134
```bash
133-
# Test your module (from the module directory)
135+
# Test your module
136+
cd registry/[namespace]/modules/[module-name]
137+
138+
# Required: Test Terraform functionality
134139
terraform init -upgrade
135140
terraform test -verbose
136141

137-
# Or run all tests in the repo
138-
./scripts/terraform_test_all.sh
142+
# Optional: Test TypeScript files if you have main.test.ts
143+
bun test main.test.ts
139144

140145
# Format code
141146
bun run fmt
@@ -343,8 +348,8 @@ coder templates push test-[template-name] -d .
343348
terraform init -upgrade
344349
terraform test -verbose
345350

346-
# Test all modules
347-
./scripts/terraform_test_all.sh
351+
# Optional: If you have TypeScript tests
352+
bun test main.test.ts
348353
```
349354

350355
### 3. Maintain Backward Compatibility
@@ -393,7 +398,9 @@ Example: `https://github.com/coder/registry/compare/main...your-branch?template=
393398
### Every Module Must Have
394399

395400
- `main.tf` - Terraform code
396-
- One or more `.tftest.hcl` files - Working tests with `terraform test`
401+
- **Tests**:
402+
- `*.tftest.hcl` files with `terraform test` (to test terraform specific logic)
403+
- `main.test.ts` file with `bun test` (to test business logic, i.e., `coder_script` to install a package.)
397404
- `README.md` - Documentation with frontmatter
398405

399406
### Every Template Must Have
@@ -493,6 +500,10 @@ When reporting bugs, include:
493500
2. **No tests** or broken tests
494501
3. **Hardcoded values** instead of variables
495502
4. **Breaking changes** without defaults
496-
5. **Not running** formatting (`bun run fmt`) and tests (`terraform test`) before submitting
503+
5. **Not running** formatting (`bun run fmt`) and tests (`terraform test`, and `bun test main.test.ts` if applicable) before submitting
504+
505+
## For Maintainers
506+
507+
Guidelines for reviewing PRs, managing releases, and maintaining the registry. [See the maintainer guide for detailed information.](./MAINTAINER.md)
497508

498509
Happy contributing! 🚀

MAINTAINER.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Check that PRs have:
2323
- [ ] Working tests (`terraform test`)
2424
- [ ] Formatted code (`bun run fmt`)
2525
- [ ] Avatar image for new namespaces (`avatar.png` or `avatar.svg` in `.images/`)
26+
- [ ] Version label: `version:patch`, `version:minor`, or `version:major`
2627

2728
### Version Guidelines
2829

@@ -32,7 +33,8 @@ When reviewing PRs, ensure the version change follows semantic versioning:
3233
- **Minor** (1.2.3 → 1.3.0): New features, adding inputs
3334
- **Major** (1.2.3 → 2.0.0): Breaking changes (removing inputs, changing types)
3435

35-
PRs should clearly indicate the version change (e.g., `v1.2.3 → v1.2.4`).
36+
PRs should clearly indicate the intended version change (e.g., `v1.2.3 → v1.2.4`) and include the appropriate label: `version:patch`, `version:minor`, or `version:major`.
37+
The “Version Bump” CI uses this label to validate required updates (README version refs, etc.).
3638

3739
### Validate READMEs
3840

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,7 @@ Simply include that snippet inside your Coder template, defining any data depend
4848
## Contributing
4949

5050
We are always accepting new contributions. [Please see our contributing guide for more information.](./CONTRIBUTING.md)
51+
52+
## For Maintainers
53+
54+
Guidelines for maintainers reviewing PRs and managing releases. [See the maintainer guide for more information.](./MAINTAINER.md)

examples/modules/MODULE_NAME.tftest.hcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ run "app_url_uses_port" {
1515
}
1616

1717
assert {
18-
condition = resource.coder_app.MODULE_NAME.url == "http://localhost:19999"
19-
error_message = "Expected MODULE_NAME app URL to include configured port"
18+
condition = resource.coder_app.module_name.url == "http://localhost:19999"
19+
error_message = "Expected module-name app URL to include configured port"
2020
}
2121
}

0 commit comments

Comments
 (0)