Bootstrap coder-k8s repository scaffolding#1
Merged
Conversation
Add initial Go module/app, vendoring workflow, Nix dev shell, Goreleaser config, GitHub Actions CI/release workflows, and vendored Kubernetes bootstrap dependencies.\n\n---\n_Generated with [`mux`](https://github.com/coder/mux) • Model: `openai:gpt-5.3-codex` • Thinking: `xhigh`_
Member
Author
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.
Bootstrap the repository with an initial Go/Kubernetes-oriented scaffold.
Summary
github.com/coder/coder-k8sas a Go module with a minimal executable and unit testMakefileworkflow (vendor,test,build,verify-vendor,codegen)Validation
make testmake buildmake verify-vendorgoreleaser check📋 Implementation Plan
Plan: Bootstrap
github.com/coder/coder-k8sContext / Why
You want a clean bootstrap for a single Go module that can later host three major pieces in one repo: a Kubernetes Operator, an aggregated API server, and an MCP server. The immediate goal is to establish a reproducible dev environment, CI/CD, and a minimal executable/testable baseline without Kubebuilder/Operator SDK.
This plan focuses on creating the smallest viable foundation that compiles, tests in CI, vendors dependencies, and produces release assets (binary + container image) via Goreleaser.
Evidence
README.md.gitworktree pointer fileREADME.mdcurrently has only:# coder-k8sWhy this is sufficient: there is no existing Go/Nix/CI scaffold to preserve, so we can define the bootstrap structure directly.
Implementation details
1) Initialize module + minimal app that compiles and is testable
Create a single module with one
go mod initand minimal source layout.Files to add/edit
go.mod(created viago mod init github.com/coder/coder-k8s)main.gomain_test.goShape of code
Notes:
2) Configure vendoring-first Go workflow (including future K8s codegen path)
Set project defaults and task automation around vendored deps and non-Kubebuilder code generation.
Files to add/edit
Makefile(chosen over Justfile for zero extra tool dependency).gitignoreMake targets
vendor/.modules.stamp: file target that depends ongo.mod(andgo.sum) and runsgo mod tidy && go mod vendorvendor: convenience target that depends on the stamptest: depends on the stamp, then runsGOFLAGS=-mod=vendor go test ./...build: depends on the stamp, then runsGOFLAGS=-mod=vendor go build ./...verify-vendor: rerun tidy/vendor and fail on dirty treecodegen: wrapper target for vendor-based Kubernetes code-generator scripts (placeholder args now, ready for real API groups later)This guarantees
go mod tidyandgo mod vendorare automatically re-run whengo.modchanges (and also whengo.sumchanges).Shape of Makefile core
Notes:
controller-runtime/client-goand vendor-hosted scripts rather than Kubebuilder/Operator SDK scaffolding.codegenwill call scripts likegenerate-groups.shfrom./vendor/k8s.io/code-generator/....3) Add Nix flake dev shell + direnv integration
Create a reproducible dev environment and auto-activation via nix-direnv.
Files to add/edit
flake.nix.envrcDev shell contents (minimum)
gnumakegitgoreleasergolangci-lint,docker,kubectl) can be added later as needs become concreteShape of
.envrcShape of
flake.nix(core, cross-platform viasupportedSystems)4) Add Goreleaser config for binary + OCI image
Define release packaging once, and let GitHub Actions invoke it.
Files to add/edit
.goreleaser.yamlDockerfile.goreleaser(minimal runtime image recipe)Key config points
ghcr.io/coder/coder-k8s{{ .Version }}to match release versionShape of goreleaser docker section
5) Add CI workflow for PR validation
Run minimal but meaningful checks on every pull request.
Files to add/edit
.github/workflows/ci.yamlWorkflow behavior
pull_requestgo mod tidy,go mod vendor, and fail if diff existsgo test ./...go build ./...This ensures the hello-world baseline remains compilable/tested and vendoring is enforced.
6) Add release workflow for Goreleaser publish
Run Goreleaser when a GitHub release is created and publish both binary artifacts and container image.
Files to add/edit
.github/workflows/release.yamlWorkflow behavior
releasewithtypes: [created]contents: write,packages: writefetch-depth: 0)${{ secrets.GITHUB_TOKEN }}goreleaser/goreleaser-action) withrelease --cleanCore image destination
ghcr.io/coder/coder-k8s:<release version>7) Initial dependency bootstrap to support future Operator/API work
Add (and vendor) baseline dependencies so future work can proceed without toolchain rework.
Commands/tasks to run during implementation
go get sigs.k8s.io/controller-runtimego get k8s.io/client-gogo get k8s.io/apimachinerygo get k8s.io/code-generatormake vendorThis keeps the bootstrap aligned with your explicit non-Kubebuilder direction and prepares vendor-based codegen scripts.
Validation checklist (implementation phase)
go test ./...passes locallygo build ./...succeedsgo mod vendorsucceeds andvendor/is committedgoreleaser checkpassesact/dry-run equivalent optional for workflow sanity (if available)Why Makefile (not Justfile) in this bootstrap
makeis typically already available (and will be provided in the Nix shell), so it reduces initial tooling friction. If you later want nicer ergonomics, converting targets tojustis straightforward once task surface area grows.Generated with
mux• Model:openai:gpt-5.3-codex• Thinking:xhigh