validate os updates and os profiles on dry-run for empty setup#47408
validate os updates and os profiles on dry-run for empty setup#47408MagnusHJensen wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThis PR implements parse-time validation in GitOps file handling to detect and reject configurations where both managed OS updates and configuration profiles enforcing OS updates are simultaneously specified. The change adds a new 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR fixes a GitOps validation gap where fleetctl gitops --dry-run could succeed even when the YAML defines both managed OS-update settings and a conflicting OS-update configuration profile/declaration for the same fleet (a conflict that the server correctly rejects on non-dry-run apply). The change adds equivalent conflict detection during spec parsing so dry-runs fail early with the same underlying error message.
Changes:
- Add dry-run-time validation to reject OS-update settings + OS-update profile/declaration conflicts for Apple and Windows controls.
- Introduce helper functions to detect whether OS updates are configured and whether profile files contain OS-update enforcement markers.
- Add unit tests covering failing and allowed combinations for Apple and Windows.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| pkg/spec/gitops.go | Adds validateOSUpdatesProfileConflict plus helpers to detect OS-update settings and OS-update profiles during GitOps parsing (so dry-runs fail). |
| pkg/spec/gitops_test.go | Adds tests that assert conflicts are rejected and non-conflicting cases remain allowed. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #47408 +/- ##
=======================================
Coverage 67.19% 67.19%
=======================================
Files 3273 3273
Lines 227905 227946 +41
Branches 11746 11746
=======================================
+ Hits 153137 153178 +41
+ Misses 60956 60955 -1
- Partials 13812 13813 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Related issue: Resolves #47364
Unreleased bug for 4.87
Summary by CodeRabbit