Skip to content

add debug logs - #52

Merged
adziauho merged 2 commits into
masterfrom
add-debug-logs
Sep 3, 2026
Merged

adziauho merged 2 commits into
masterfrom
add-debug-logs

Conversation

@adziauho

@adziauho adziauho commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI lite review requested due to automatic review settings September 3, 2026 15:16
Signed-off-by: Aliaksei Dziauho <a.dziauho@sap.com>
anton-paulovich
anton-paulovich previously approved these changes Sep 3, 2026

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.

🟡 Changes recommended

The newly added CloudProfile operation log is currently emitted at Info level (potentially noisy) and the “skipping retry” wording is misleading given the controller’s scheduled requeue behavior.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR adds additional controller logging to improve observability of the ManagedCloudProfile reconcile flow and the underlying CloudProfile apply/patch behavior.

Changes:

  • Add verbose (V=1) log when reconcile is triggered, including generation and resourceVersion.
  • Add verbose (V=1) logs around status patching to indicate when status updates are skipped vs patched.
  • Capture and log the controllerutil.CreateOrPatch operation result for CloudProfile, and log when an invalid CloudProfile leads to skipping error-based retries.
File summaries
File Description
controllers/managedcloudprofile_controller.go Adds V(1) debug logs for reconcile entry and status patch skip/issue paths.
controllers/cloud_profile.go Logs CreateOrPatch operation result and adds an explicit log when invalid CloudProfile errors avoid error-based retries.
Review details

Suppressed comments (1)

controllers/cloud_profile.go:77

  • The message skipping retry is inaccurate here: Reconcile always returns RequeueAfter: 5 * time.Minute, so this will still retry on the next scheduled reconcile (it only skips returning an error/backoff). Consider updating the log message to reflect that behavior (and include the operation result for debugging).
		if apierrors.IsInvalid(err) {
			log.Error(err, "CloudProfile is invalid, skipping retry")
			return nil
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

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

Comment thread controllers/cloud_profile.go Outdated
Signed-off-by: Aliaksei Dziauho <a.dziauho@sap.com>
Copilot AI review requested due to automatic review settings September 3, 2026 15:20

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.

🟢 Approval recommended

The changes are limited to additional debug logging and do not alter reconciliation control flow or external behavior.

Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@adziauho
adziauho merged commit ed16195 into master Sep 3, 2026
8 checks passed
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

Merging this branch will increase overall coverage

Impacted Packages Coverage Δ 🤖
github.com/cobaltcore-dev/cloud-profile-sync/controllers 74.53% (+15.42%) 🎉

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/cobaltcore-dev/cloud-profile-sync/controllers/cloud_profile.go 59.17% (+10.19%) 120 (+22) 71 (+23) 49 (-1) 🎉
github.com/cobaltcore-dev/cloud-profile-sync/controllers/managedcloudprofile_controller.go 100.00% (ø) 42 (+10) 42 (+10) 0

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.

@adziauho
adziauho deleted the add-debug-logs branch September 3, 2026 15:23
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.

3 participants