feat(scripts/modulegen): add generator for template builder module catalog#26193
Draft
jeremyruppel wants to merge 1 commit into
Conversation
Contributor
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced Jun 9, 2026
9b5edc9 to
b1e1078
Compare
jeremyruppel
commented
Jun 9, 2026
| // fetchLatestVersion resolves the latest semver for a module using the | ||
| // Terraform protocol versions endpoint. | ||
| func fetchLatestVersion(ctx context.Context, baseURL, namespace, slug string) (string, error) { | ||
| reqURL := fmt.Sprintf("%s/terraform_protocol/%s/%s/coder/versions", baseURL, namespace, slug) |
Contributor
Author
There was a problem hiding this comment.
@DevelopmentCats hey! is there another API endpoint I can use to get available module versions? or even better, the latest version? I found this info in this terraform endpoint but I am hoping there's a more obvious place
b1e1078 to
6a591ad
Compare
…talog Reusable Go script that reads the Coder registry repo and generates module.json and .tf.tmpl files for the template builder catalog. Parses variable declarations from main.tf, frontmatter from README.md, and pinned versions from git tags. Usage: go run ./scripts/modulegen/ -registry /path/to/registry -output coderd/templatebuilder/modules Handles escaped quotes and heredoc descriptions, skips variables with heredoc defaults (cannot be represented in the builder UI), uses numeric semver sorting for version tags, and exits non-zero on failures.
6a591ad to
e1dff0c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Note
This PR was authored by Coder Agents on behalf of @jeremyruppel.
Adds
scripts/modulegen/, a Go tool that fetches module metadata from the Coder registry HTTP API and generates themodule.jsonmanifests and.tf.tmplfiles used by the template builder catalog.The generator calls
GET /api/modules/{id}for per-module metadata (display name, description, icon, tags, variables) and the Terraform protocol versions endpoint for semver resolution. No git clone or HCL parsing required.Split into four files:
main.go: orchestration, module config map, CLI flagstypes.go: output types (ModuleManifest,ModuleVariable) and API response typesfetch.go: HTTP fetching, version resolution, variable conversion, icon normalizationwrite.go: JSON writer,.tf.tmplGo template and writer