Skip to content

refactor(careinstruction): use lifecycle.Reconcile - #78

Open
jellonek wants to merge 1 commit into
mainfrom
refactor-careinstruction-reconcile
Open

refactor(careinstruction): use lifecycle.Reconcile#78
jellonek wants to merge 1 commit into
mainfrom
refactor-careinstruction-reconcile

Conversation

@jellonek

Copy link
Copy Markdown
Contributor

@jellonek
jellonek requested a review from a team as a code owner August 21, 2026 09:53
Copilot AI lite review requested due to automatic review settings August 21, 2026 09:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors the CareInstruction controller reconcile flow to use the shared greenhouse/pkg/lifecycle reconciliation pattern (issue #70), splitting create/update vs. delete handling and adding the object-level hooks needed for lifecycle-managed status/conditions.

Changes:

  • Replace the controller’s monolithic Reconcile implementation with lifecycle.Reconcile and lifecycle hook methods (EnsureCreated, EnsureDeleted, EnsureSuspended).
  • Add condition/suspension helper methods on CareInstruction to satisfy lifecycle expectations.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
controller/careinstruction/careinstruction_controller.go Switch reconcile entrypoint to lifecycle.Reconcile; introduce lifecycle hook methods for create/update/delete/suspend handling.
api/v1alpha1/careinstruction_types.go Add lifecycle-facing condition/suspension methods on the CareInstruction API type.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread controller/careinstruction/careinstruction_controller.go
Comment thread controller/careinstruction/careinstruction_controller.go Outdated
@jellonek
jellonek force-pushed the refactor-careinstruction-reconcile branch 5 times, most recently from 4b1fd77 to b0a39bf Compare August 21, 2026 14:38
 - related issue #70

Signed-off-by: Piotr Skamruk <piotr.skamruk@gmail.com>
@jellonek
jellonek force-pushed the refactor-careinstruction-reconcile branch from b0a39bf to a5c4fc4 Compare August 21, 2026 14:49
@github-actions

Copy link
Copy Markdown

Merging this branch will decrease overall coverage

Impacted Packages Coverage Δ 🤖
shoot-grafter/api/v1alpha1 58.33% (-0.89%) 👎
shoot-grafter/controller/careinstruction 79.75% (-2.66%) 👎

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
shoot-grafter/api/v1alpha1/careinstruction_types.go 76.00% (-9.00%) 25 (+5) 19 (+2) 6 (+3) 👎
shoot-grafter/controller/careinstruction/careinstruction_controller.go 77.48% (-4.25%) 302 (-10) 234 (-21) 68 (+11) 👎

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

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.

2 participants