Skip to content

feat: add @constructive-io/yamlize — typed K8s manifest builders#93

Open
pyramation wants to merge 1 commit into
mainfrom
feat/yamlize-k8s-builders
Open

feat: add @constructive-io/yamlize — typed K8s manifest builders#93
pyramation wants to merge 1 commit into
mainfrom
feat/yamlize-k8s-builders

Conversation

@pyramation

Copy link
Copy Markdown
Contributor

Summary

New @constructive-io/yamlize package providing typed, composable K8s manifest builders with merge/override semantics and zero runtime dependencies.

Builders: deployment(), statefulSet(), service(), ingress(), certificate(), configMap(), secret(), namespace(), job() — each returns a typed K8sManifest object matching the K8s API structure.

Helpers for config_secrets_module integration:

  • namespaceEnvFrom(namespaceName) — returns the standard envFrom array (secrets + configMap) that all workloads in a namespace should mount
  • mergeNullable(base, overrides) — shallow merge where null/undefined override values are skipped (inherit from base), implementing the server_definitions → server_deployments config override pattern

Deep merge: merge(base, overrides) — recursive object merge with null-means-inherit for full manifest overlays.

YAML serialization: Custom toYaml(), toYamlMulti(), fromYaml() — no external yaml dependency.

Validation: validate(manifest) — checks apiVersion/kind/metadata presence, kind-apiVersion compatibility, DNS name format.

44 unit tests passing across builders, merge, yaml serialization, helpers, and validation.

Companion PR in constructive-db refactors existing K8s handlers to use this builder pattern.

Link to Devin session: https://app.devin.ai/sessions/560b356ee4174a3d9776babf0c99ecee
Requested by: @pyramation

…erride semantics

Adds @constructive-io/yamlize with:
- Builder functions: deployment, statefulSet, service, ingress, certificate,
  configMap, secret, namespace, job
- namespaceEnvFrom() helper for standard config_secrets_module integration
- mergeNullable() for server_definitions → server_deployments inheritance
- merge() for deep manifest merging with null-means-inherit semantics
- Custom YAML serialization: toYaml, toYamlMulti, fromYaml (zero deps)
- validate() for basic K8s manifest structure checks
- Comprehensive unit tests (44 passing)
@pyramation pyramation self-assigned this Jul 1, 2026
@devin-ai-integration

Copy link
Copy Markdown

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant