feat: add @constructive-io/yamlize — typed K8s manifest builders#93
Open
pyramation wants to merge 1 commit into
Open
feat: add @constructive-io/yamlize — typed K8s manifest builders#93pyramation wants to merge 1 commit into
pyramation wants to merge 1 commit into
Conversation
…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)
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
Summary
New
@constructive-io/yamlizepackage 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 typedK8sManifestobject matching the K8s API structure.Helpers for config_secrets_module integration:
namespaceEnvFrom(namespaceName)— returns the standardenvFromarray (secrets + configMap) that all workloads in a namespace should mountmergeNullable(base, overrides)— shallow merge wherenull/undefinedoverride values are skipped (inherit from base), implementing theserver_definitions → server_deploymentsconfig override patternDeep 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-dbrefactors existing K8s handlers to use this builder pattern.Link to Devin session: https://app.devin.ai/sessions/560b356ee4174a3d9776babf0c99ecee
Requested by: @pyramation