feat: Add managed-by nixidy #45
Loading…
Reference in a new issue
No description provided.
Delete branch "managed-by-label"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Review Summary
This PR adds
app.kubernetes.io/managed-by=nixidylabel to all resources generated via nixidy'sobjectTransformsmechanism. The implementation is clean, well-tested, and follows existing codebase conventions.Strengths
managed-bylabels (Helm, ArgoCD, etc.)objectTransformsextension pointorpatterns for safe attribute accessObservations
resource.metadatawere explicitlynull(not absent) it would error, but this doesn't occur in practice with nixidy-generated resourcesVerdict: approve
*🤖 Review by opencode (opencode/deepseek-v4-flash-free) — verdict: approve
Review Summary
This PR adds an
app.kubernetes.io/managed-by=nixidylabel to all generated Kubernetes resources via a new nixidyobjectTransformsrewrite function. The change is clean, well-tested, and follows project conventions.Changes
lib/default.nix: AddsaddManagedByLabel— a pure function that injects themanaged-bylabel unless one already exists (preserving Helm/ArgoCD labels).modules/common.nix: Wires the transform into nixidy'sobjectTransformsfor all environments.tests/default.nix: 8 unit tests covering all edge cases (no labels, existing labels, existing managed-by, no metadata block, preserving apiVersion/kind).tests/integration.nix: 4 integration tests verifying transforms are configured in every environment and have the expected shape..woodpecker/switch.yml: Expands CI trigger paths to includemodules/**andlib/**.Verdict
No issues found. The function is correct, tests are comprehensive, and the CI config change is appropriate.
*🤖 Review by opencode (opencode/deepseek-v4-flash-free) — verdict: approve
Review Summary
This PR adds an
app.kubernetes.io/managed-by: nixidylabel to all resources generated by nixidy via a newobjectTransformspipeline. The implementation is well-structured with proper unit and integration tests.Positive aspects
managed-bylabel and skips the resource if one is already set, preserving Helm, ArgoCD, or other tooling labels.metadataor withoutlabelsare handled gracefully viaor { }defaults.objectTransformsconfiguration inmodules/common.nixfollows the expected nixidy API pattern ({ rewrite = fn; }).Minor observations
.woodpecker/switch.ymlexcludeglobmanifests/*is shallow (only matches direct children, not nested paths). This is pre-existing and harmless here — the commit step uses[CI SKIP]in its message, which prevents re-triggering. Not a new issue from this PR.Verdict: Approve — clean, well-tested, and correctly implemented.
*🤖 Review by opencode (opencode/deepseek-v4-flash-free) — verdict: approve