feat: Add managed-by nixidy #45

Merged
martin merged 3 commits from managed-by-label into main 2026-07-29 19:44:57 +00:00
Owner
No description provided.
martin self-assigned this 2026-07-29 19:25:04 +00:00
feat: Add managed-by nixidy
All checks were successful
ci/woodpecker/pr/pr-review Pipeline was successful
5a61f9a862
Collaborator

Review Summary

This PR adds app.kubernetes.io/managed-by=nixidy label to all resources generated via nixidy's objectTransforms mechanism. The implementation is clean, well-tested, and follows existing codebase conventions.

Strengths

  • Idempotent: respects existing managed-by labels (Helm, ArgoCD, etc.)
  • Well-tested: 9 unit tests + 4 integration tests covering edge cases (no metadata, no labels, existing labels, different resource kinds)
  • Correct architecture: uses nixidy's supported objectTransforms extension point
  • Clean Nix: uses idiomatic or patterns for safe attribute access

Observations

  • Minor: if resource.metadata were explicitly null (not absent) it would error, but this doesn't occur in practice with nixidy-generated resources

Verdict: approve


*🤖 Review by opencode (opencode/deepseek-v4-flash-free) — verdict: approve

# Review Summary This PR adds `app.kubernetes.io/managed-by=nixidy` label to all resources generated via nixidy's `objectTransforms` mechanism. The implementation is clean, well-tested, and follows existing codebase conventions. ## Strengths - **Idempotent**: respects existing `managed-by` labels (Helm, ArgoCD, etc.) - **Well-tested**: 9 unit tests + 4 integration tests covering edge cases (no metadata, no labels, existing labels, different resource kinds) - **Correct architecture**: uses nixidy's supported `objectTransforms` extension point - **Clean Nix**: uses idiomatic `or` patterns for safe attribute access ## Observations - Minor: if `resource.metadata` were explicitly `null` (not absent) it would error, but this doesn't occur in practice with nixidy-generated resources **Verdict: approve** --- *🤖 Review by opencode (opencode/deepseek-v4-flash-free) — verdict: **approve**
ci: Run switch when modules or lib change
All checks were successful
ci/woodpecker/pr/pr-review Pipeline was successful
ci/woodpecker/pr/switch Pipeline was successful
adf959df98
Collaborator

Review Summary

This PR adds an app.kubernetes.io/managed-by=nixidy label to all generated Kubernetes resources via a new nixidy objectTransforms rewrite function. The change is clean, well-tested, and follows project conventions.

Changes

  • lib/default.nix: Adds addManagedByLabel — a pure function that injects the managed-by label unless one already exists (preserving Helm/ArgoCD labels).
  • modules/common.nix: Wires the transform into nixidy's objectTransforms for 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 include modules/** and lib/**.

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=nixidy` label to all generated Kubernetes resources via a new nixidy `objectTransforms` rewrite function. The change is clean, well-tested, and follows project conventions. ## Changes - **`lib/default.nix`**: Adds `addManagedByLabel` — a pure function that injects the `managed-by` label unless one already exists (preserving Helm/ArgoCD labels). - **`modules/common.nix`**: Wires the transform into nixidy's `objectTransforms` for 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 include `modules/**` and `lib/**`. ## 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**
chore: update manifests/ [CI SKIP]
All checks were successful
ci/woodpecker/pr/pr-review Pipeline was successful
ci/woodpecker/pr/switch Pipeline was successful
c9dcbb08d1
Collaborator

Review Summary

This PR adds an app.kubernetes.io/managed-by: nixidy label to all resources generated by nixidy via a new objectTransforms pipeline. The implementation is well-structured with proper unit and integration tests.

Positive aspects

  • Preserves existing labels: The function correctly checks for an existing managed-by label and skips the resource if one is already set, preserving Helm, ArgoCD, or other tooling labels.
  • Edge cases handled: Resources without metadata or without labels are handled gracefully via or { } defaults.
  • Comprehensive tests: 8 unit tests cover all edge cases (no metadata, existing labels, existing managed-by, various resource types), and 4 integration tests verify the transform is configured across all environments.
  • Nixidy integration: The objectTransforms configuration in modules/common.nix follows the expected nixidy API pattern ({ rewrite = fn; }).

Minor observations

  • The .woodpecker/switch.yml exclude glob manifests/* 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

# Review Summary This PR adds an `app.kubernetes.io/managed-by: nixidy` label to all resources generated by nixidy via a new `objectTransforms` pipeline. The implementation is well-structured with proper unit and integration tests. ## Positive aspects - **Preserves existing labels**: The function correctly checks for an existing `managed-by` label and skips the resource if one is already set, preserving Helm, ArgoCD, or other tooling labels. - **Edge cases handled**: Resources without `metadata` or without `labels` are handled gracefully via `or { }` defaults. - **Comprehensive tests**: 8 unit tests cover all edge cases (no metadata, existing labels, existing managed-by, various resource types), and 4 integration tests verify the transform is configured across all environments. - **Nixidy integration**: The `objectTransforms` configuration in `modules/common.nix` follows the expected nixidy API pattern (`{ rewrite = fn; }`). ## Minor observations - The `.woodpecker/switch.yml` `exclude` glob `manifests/*` 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**
martin merged commit 5da39e0bf2 into main 2026-07-29 19:44:57 +00:00
martin deleted branch managed-by-label 2026-07-29 19:44:57 +00:00
martin referenced this pull request from a commit 2026-07-29 19:44:58 +00:00
Sign in to join this conversation.
No reviewers
No labels
automerge
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
martin/cluster!45
No description provided.