Skip to content

Commit ada1c68

Browse files
Merge branch 'main' into feature/oci-template
2 parents 0a78e2d + d9b223a commit ada1c68

File tree

124 files changed

+4167
-292
lines changed

Some content is hidden

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

124 files changed

+4167
-292
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
- name: Validate formatting
4949
run: bun fmt:ci
5050
- name: Check for typos
51-
uses: crate-ci/typos@v1.34.0
51+
uses: crate-ci/typos@v1.35.3
5252
with:
5353
config: .github/typos.toml
5454
validate-readme-files:

.github/workflows/deploy-registry.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: deploy-registry
22

33
on:
4+
schedule:
5+
# Runs at 02:30 UTC Monday through Friday
6+
- cron: "30 2 * * 1-5"
47
push:
58
tags:
69
# Matches release/<namespace>/<resource_name>/<semantic_version>
@@ -11,6 +14,7 @@ on:
1114
paths:
1215
- ".github/workflows/deploy-registry.yaml"
1316
- "registry/**/templates/**"
17+
- "registry/**/README.md"
1418
- ".icons/**"
1519

1620
jobs:
@@ -26,12 +30,12 @@ jobs:
2630
- name: Checkout code
2731
uses: actions/checkout@v4
2832
- name: Authenticate with Google Cloud
29-
uses: google-github-actions/auth@ba79af03959ebeac9769e648f473a284504d9193
33+
uses: google-github-actions/auth@b7593ed2efd1c1617e1b0254da33b86225adb2a5
3034
with:
3135
workload_identity_provider: projects/309789351055/locations/global/workloadIdentityPools/github-actions/providers/github
3236
service_account: [email protected]
3337
- name: Set up Google Cloud SDK
34-
uses: google-github-actions/setup-gcloud@77e7a554d41e2ee56fc945c52dfd3f33d12def9a
38+
uses: google-github-actions/setup-gcloud@cb1e50a9932213ecece00a606661ae9ca44f3397
3539
- name: Deploy to dev.registry.coder.com
3640
run: gcloud builds triggers run 29818181-126d-4f8a-a937-f228b27d3d34 --branch main
3741
- name: Deploy to registry.coder.com

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,3 +145,6 @@ dist
145145

146146
# Generated credentials from google-github-actions/auth
147147
gha-creds-*.json
148+
149+
# IDEs
150+
.idea

.icons/gemini.svg

Lines changed: 1 addition & 0 deletions
Loading

.icons/tmux.svg

Lines changed: 1 addition & 0 deletions
Loading

CONTRIBUTING.md

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ The Coder Registry is a collection of Terraform modules and templates for Coder
2424

2525
### Install Dependencies
2626

27-
Install Bun:
27+
Install Bun (for formatting and scripts):
2828

2929
```bash
3030
curl -fsSL https://bun.sh/install | bash
@@ -89,7 +89,7 @@ Create `registry/[your-username]/README.md`:
8989
---
9090
display_name: "Your Name"
9191
bio: "Brief description of who you are and what you do"
92-
avatar_url: "./.images/avatar.png"
92+
avatar: "./.images/avatar.png"
9393
github: "your-username"
9494
linkedin: "https://www.linkedin.com/in/your-username" # Optional
9595
website: "https://yourwebsite.com" # Optional
@@ -102,7 +102,7 @@ status: "community"
102102
Brief description of who you are and what you do.
103103
```
104104

105-
> **Note**: The `avatar_url` must point to `./.images/avatar.png` or `./.images/avatar.svg`.
105+
> **Note**: The `avatar` must point to `./.images/avatar.png` or `./.images/avatar.svg`.
106106
107107
### 2. Generate Module Files
108108

@@ -124,19 +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 `main.test.ts`** to test your module
127+
3. **Create at least one `.tftest.hcl`** to test your module with `terraform test`
128128
4. **Add any scripts** or additional files your module needs
129129

130130
### 4. Test and Submit
131131

132132
```bash
133-
# Test your module
134-
bun test -t 'module-name'
133+
# Test your module (from the module directory)
134+
terraform init -upgrade
135+
terraform test -verbose
136+
137+
# Or run all tests in the repo
138+
./scripts/terraform_test_all.sh
135139

136140
# Format code
137-
bun fmt
141+
bun run fmt
138142

139-
# Commit and create PR
143+
# Commit and create PR (do not push to main directly)
140144
git add .
141145
git commit -m "Add [module-name] module"
142146
git push origin your-branch
@@ -335,11 +339,12 @@ coder templates push test-[template-name] -d .
335339
### 2. Test Your Changes
336340

337341
```bash
338-
# Test a specific module
339-
bun test -t 'module-name'
342+
# Test a specific module (from the module directory)
343+
terraform init -upgrade
344+
terraform test -verbose
340345

341346
# Test all modules
342-
bun test
347+
./scripts/terraform_test_all.sh
343348
```
344349

345350
### 3. Maintain Backward Compatibility
@@ -388,7 +393,7 @@ Example: `https://github.com/coder/registry/compare/main...your-branch?template=
388393
### Every Module Must Have
389394

390395
- `main.tf` - Terraform code
391-
- `main.test.ts` - Working tests
396+
- One or more `.tftest.hcl` files - Working tests with `terraform test`
392397
- `README.md` - Documentation with frontmatter
393398

394399
### Every Template Must Have
@@ -488,6 +493,6 @@ When reporting bugs, include:
488493
2. **No tests** or broken tests
489494
3. **Hardcoded values** instead of variables
490495
4. **Breaking changes** without defaults
491-
5. **Not running** `bun fmt` before submitting
496+
5. **Not running** formatting (`bun run fmt`) and tests (`terraform test`) before submitting
492497

493498
Happy contributing! 🚀

MAINTAINER.md

Lines changed: 53 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ sudo apt install golang-go
1818

1919
Check that PRs have:
2020

21-
- [ ] All required files (`main.tf`, `main.test.ts`, `README.md`)
21+
- [ ] All required files (`main.tf`, `README.md`, at least one `.tftest.hcl`)
2222
- [ ] Proper frontmatter in README
23-
- [ ] Working tests (`bun test`)
23+
- [ ] Working tests (`terraform test`)
2424
- [ ] Formatted code (`bun run fmt`)
2525
- [ ] Avatar image for new namespaces (`avatar.png` or `avatar.svg` in `.images/`)
2626

@@ -42,12 +42,58 @@ go build ./cmd/readmevalidation && ./readmevalidation
4242

4343
## Making a Release
4444

45-
### Create Release Tags
45+
### Automated Tag and Release Process
4646

47-
After merging a PR:
47+
After merging a PR, use the automated script to create and push release tags:
4848

49-
1. Get the new version from the PR (shown as `old → new`)
50-
2. Checkout the merge commit and create the tag:
49+
**Prerequisites:**
50+
51+
- Ensure all module versions are updated in their respective README files (the script uses this as the source of truth)
52+
- Make sure you have the necessary permissions to push tags to the repository
53+
54+
**Steps:**
55+
56+
1. **Checkout the merge commit:**
57+
58+
```bash
59+
git checkout MERGE_COMMIT_ID
60+
```
61+
62+
2. **Run the tag release script:**
63+
64+
```bash
65+
./scripts/tag_release.sh
66+
```
67+
68+
3. **Review and confirm:**
69+
- The script will automatically scan all modules in the registry
70+
- It will detect which modules need version bumps by comparing README versions to existing tags
71+
- A summary will be displayed showing which modules need tagging
72+
- Confirm the list is correct when prompted
73+
74+
4. **Automatic tagging:**
75+
- After confirmation, the script will automatically create all necessary release tags
76+
- Tags will be pushed to the remote repository
77+
- The script operates on the current checked-out commit
78+
79+
**Example output:**
80+
81+
```text
82+
🔍 Scanning all modules for missing release tags...
83+
84+
📦 coder/code-server: v4.1.2 (needs tag)
85+
✅ coder/dotfiles: v1.0.5 (already tagged)
86+
87+
## Tags to be created:
88+
- `release/coder/code-server/v4.1.2`
89+
90+
❓ Do you want to proceed with creating and pushing these release tags?
91+
Continue? [y/N]: y
92+
```
93+
94+
### Manual Process (Fallback)
95+
96+
If the automated script fails, you can manually tag and release modules:
5197

5298
```bash
5399
# Checkout the merge commit
@@ -72,8 +118,6 @@ Changes are automatically published to [registry.coder.com](https://registry.cod
72118
display_name: "Module Name"
73119
description: "What it does"
74120
icon: "../../../../.icons/tool.svg"
75-
maintainer_github: "username"
76-
partner_github: "partner-name" # Optional - For official partner modules
77121
verified: false # Optional - Set by maintainers only
78122
tags: ["tag1", "tag2"]
79123
```
@@ -83,7 +127,7 @@ tags: ["tag1", "tag2"]
83127
```yaml
84128
display_name: "Your Name"
85129
bio: "Brief description of who you are and what you do"
86-
avatar_url: "./.images/avatar.png"
130+
avatar: "./.images/avatar.png"
87131
github: "username"
88132
linkedin: "https://www.linkedin.com/in/username" # Optional
89133
website: "https://yourwebsite.com" # Optional

cmd/readmevalidation/coderresources.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,12 +336,12 @@ func validateAllCoderResourceFilesOfType(resourceType string) error {
336336
return err
337337
}
338338

339-
logger.Info(context.Background(), "rocessing README files", "num_files", len(allReadmeFiles))
339+
logger.Info(context.Background(), "processing README files", "num_files", len(allReadmeFiles))
340340
resources, err := parseCoderResourceReadmeFiles(resourceType, allReadmeFiles)
341341
if err != nil {
342342
return err
343343
}
344-
logger.Info(context.Background(), "rocessed README files as valid Coder resources", "num_files", len(resources), "type", resourceType)
344+
logger.Info(context.Background(), "processed README files as valid Coder resources", "num_files", len(resources), "type", resourceType)
345345

346346
if err := validateCoderResourceRelativeURLs(resources); err != nil {
347347
return err
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
run "plan_with_required_vars" {
2+
command = plan
3+
4+
variables {
5+
agent_id = "example-agent-id"
6+
}
7+
}
8+
9+
run "app_url_uses_port" {
10+
command = plan
11+
12+
variables {
13+
agent_id = "example-agent-id"
14+
port = 19999
15+
}
16+
17+
assert {
18+
condition = resource.coder_app.MODULE_NAME.url == "http://localhost:19999"
19+
error_message = "Expected MODULE_NAME app URL to include configured port"
20+
}
21+
}

examples/modules/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
display_name: MODULE_NAME
33
description: Describe what this module does
44
icon: ../../../../.icons/<A_RELEVANT_ICON>.svg
5-
maintainer_github: GITHUB_USERNAME
65
verified: false
76
tags: [helper]
87
---

0 commit comments

Comments
 (0)