Skip to content

docs: add contribution documentation for modules and templates #18820

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Jul 17, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
fb1d650
docs: add contributing guideline docs for modules and templates
DevelopmentCats Jul 8, 2025
5238467
docs: move and update detailed contributing guidelines for modules an…
DevelopmentCats Jul 10, 2025
c692a8a
docs: update module contribution guidelines and remove redundant content
DevelopmentCats Jul 10, 2025
bd1df6b
docs: remove redundant label from registry description
DevelopmentCats Jul 11, 2025
a3bd628
docs: add new sections for contributing modules and templates in the …
DevelopmentCats Jul 11, 2025
5a74ceb
docs: remove unnecessary whitespace in module contribution guidelines
DevelopmentCats Jul 11, 2025
fbc9837
Merge branch 'main' into cat/contrib-docs
DevelopmentCats Jul 11, 2025
aaa5fe1
Update docs/about/contributing/modules.md
DevelopmentCats Jul 12, 2025
df66bf2
docs(modules): split ide's into web and desktop with examples
DevelopmentCats Jul 12, 2025
38db529
docs(modules): update examples for development tools and workspace ut…
DevelopmentCats Jul 12, 2025
a78c04f
docs(modules): update alerts to all match GFM style
DevelopmentCats Jul 12, 2025
e280608
docs(modules): simplify version bump instructions in contribution gui…
DevelopmentCats Jul 12, 2025
867c60d
docs(modules): remove outdated troubleshooting tips from contribution…
DevelopmentCats Jul 12, 2025
7cb96d8
docs(modules): remove redundant common issues
DevelopmentCats Jul 12, 2025
d274157
docs(modules): update reference module links in contribution guidelines
DevelopmentCats Jul 12, 2025
c9ddb08
docs(contributing): update all frontmatter fields in both docs and ad…
DevelopmentCats Jul 12, 2025
132d499
docs(contributing): remove redundant template issues and remove over …
DevelopmentCats Jul 12, 2025
b9b548d
docs(contributing): update examples section with links to official Co…
DevelopmentCats Jul 12, 2025
6099665
docs(contributing): update issue reporting instructions to include di…
DevelopmentCats Jul 12, 2025
d998ba4
Merge branch 'main' into cat/contrib-docs
DevelopmentCats Jul 12, 2025
2ec825a
docs(contributing): update module examples with new versions agent ID…
DevelopmentCats Jul 15, 2025
ca4654f
docs(contributing): update module examples section to replace 'Develo…
DevelopmentCats Jul 15, 2025
b730042
Merge branch 'main' into cat/contrib-docs
DevelopmentCats Jul 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs: move and update detailed contributing guidelines for modules an…
…d templates
  • Loading branch information
DevelopmentCats committed Jul 10, 2025
commit 5238467c6111e87bee95f6807bc8dde1f99bdd9a
112 changes: 30 additions & 82 deletions docs/contributing/modules.md → docs/about/contributing/modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,10 @@ Create your namespace README at `registry/[your-username]/README.md`:
---
display_name: "Your Name"
bio: "Brief description of what you do"
avatar_url: "./.images/avatar.png"
github: "your-username"
avatar: "./.images/avatar.png"
linkedin: "https://www.linkedin.com/in/your-username"
website: "https://your-website.com"
status: "community"
---

Expand All @@ -78,6 +80,8 @@ status: "community"
Brief description of who you are and what you do.
```

**Note**: The `linkedin` and `website` fields are optional and can be omitted or left empty if not applicable.

### 2. Generate module scaffolding

Use the provided script to generate your module structure:
Expand Down Expand Up @@ -215,22 +219,7 @@ module "git_clone" {
base_dir = "/home/coder/projects"
}
```

## Variables

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|----------|
| `agent_id` | The ID of a Coder agent | `string` | n/a | yes |
| `url` | Git repository URL to clone | `string` | n/a | yes |
| `base_dir` | Directory to clone the repository into | `string` | `"~"` | no |

## Outputs

| Name | Description |
|------|-------------|
| `repo_dir` | Path to the cloned repository |

```markdown
```

## Module best practices

Expand All @@ -249,54 +238,13 @@ module "git_clone" {
- Use proper resource dependencies with `depends_on` when needed
- Follow [Terraform style conventions](https://developer.hashicorp.com/terraform/language/syntax/style)

### Testing requirements

Every module must include complete tests:

```typescript
import { runTerraformApply, runTerraformInit, testRequiredVariables } from "~test"

describe("code-server", async () => {
// Test required variables
await testRequiredVariables("registry/coder/modules/code-server")

// Test successful installation
it("should install code-server successfully", async () => {
await runTerraformInit("registry/coder/modules/code-server")
await runTerraformApply("registry/coder/modules/code-server", {
agent_id: "test-agent-id"
})
})

// Test with custom folder
it("should work with custom folder", async () => {
await runTerraformInit("registry/coder/modules/code-server")
await runTerraformApply("registry/coder/modules/code-server", {
agent_id: "test-agent-id",
folder: "/workspace/project"
})
})

// Test with auto-install extensions
it("should support auto-install extensions", async () => {
await runTerraformInit("registry/coder/modules/code-server")
await runTerraformApply("registry/coder/modules/code-server", {
agent_id: "test-agent-id",
auto_install_extensions: true
})
})
})
```

### Documentation standards

Your module README must include:
Your module README should include:

- **Frontmatter**: Required metadata for the registry
- **Description**: Clear explanation of what the module does
- **Usage example**: Working Terraform code snippet
- **Variables table**: All input variables with descriptions
- **Outputs table**: All outputs with descriptions
- **Additional context**: Setup requirements, known limitations, etc.

## Test your module
Expand Down Expand Up @@ -355,12 +303,33 @@ When modifying existing modules:
- Don't change variable types or meanings
- Test that basic configurations still work

## Versioning

When you modify a module, update its version following semantic versioning:

- **Patch** (1.0.0 → 1.0.1): Bug fixes, documentation updates
- **Minor** (1.0.0 → 1.1.0): New features, new variables
- **Major** (1.0.0 → 2.0.0): Breaking changes, removing variables

Use the version bump script to update versions:

```bash
# For bug fixes
./.github/scripts/version-bump.sh patch

# For new features
./.github/scripts/version-bump.sh minor

# For breaking changes
./.github/scripts/version-bump.sh major
```

## Submit your contribution

1. **Create a feature branch**:

```bash
git checkout -b feat/add-git-clone-module
git checkout -b feat/modify-git-clone-module
```

2. **Test thoroughly**:
Expand All @@ -374,7 +343,7 @@ When modifying existing modules:

```bash
git add .
git commit -m "Add git-clone module for repository cloning"
git commit -m "feat(git-clone):modify git-clone module"
```

4. **Open a pull request**:
Expand All @@ -383,27 +352,6 @@ When modifying existing modules:
- Include testing instructions
- Reference any related issues

## Versioning

When you modify a module, update its version following semantic versioning:

- **Patch** (1.0.0 → 1.0.1): Bug fixes, documentation updates
- **Minor** (1.0.0 → 1.1.0): New features, new variables
- **Major** (1.0.0 → 2.0.0): Breaking changes, removing variables

Use the version bump script to update versions:

```bash
# For bug fixes
./.github/scripts/version-bump.sh patch

# For new features
./.github/scripts/version-bump.sh minor

# For breaking changes
./.github/scripts/version-bump.sh major
```

## Common issues and solutions

### Testing problems
Expand Down
File renamed without changes.
Loading