Skip to content

HYPERFLEET-630 - fix: consolidate duplicate resource operation logs#84

Open
xueli181114 wants to merge 1 commit intoopenshift-hyperfleet:mainfrom
xueli181114:HYPERFLEET-630
Open

HYPERFLEET-630 - fix: consolidate duplicate resource operation logs#84
xueli181114 wants to merge 1 commit intoopenshift-hyperfleet:mainfrom
xueli181114:HYPERFLEET-630

Conversation

@xueli181114
Copy link
Contributor

@xueli181114 xueli181114 commented Mar 19, 2026

Summary

  • Remove redundant pre/post operation logs from k8s_client and maestro_client CRUD methods (25 log lines removed)
  • Consolidate to a single authoritative INFO log per resource operation at the executor layer
  • Retain apply-layer decision log (operation + reason) at DEBUG level for troubleshooting
  • Handle "already exists" errors from concurrent creates gracefully as a skip instead of ERROR

Test plan

  • make test-all passes (lint + unit + integration tests)
  • Deploy to dev and verify log output shows single INFO line per resource operation
  • Verify DEBUG level still shows apply decision details when enabled
  • Verify concurrent create race condition produces skip instead of ERROR

Relates to: HYPERFLEET-630

Summary by CodeRabbit

  • Bug Fixes

    • Concurrent resource creation operations no longer fail when resources already exist; operations are now skipped gracefully.
  • Chores

    • Removed verbose logging statements from resource operations and ManifestWork lifecycle management.

Remove redundant pre/post operation logs from k8s_client and
maestro_client CRUD methods. The executor layer provides a single
authoritative INFO log per resource operation. The apply-layer
decision log (operation + reason) is retained at DEBUG level.

Handle "already exists" errors from concurrent creates gracefully
by treating them as a successful skip instead of an ERROR.
@openshift-ci
Copy link

openshift-ci bot commented Mar 19, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign tirthct for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai
Copy link

coderabbitai bot commented Mar 19, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d921e471-185c-4a30-ba8c-cf571ec973cd

📥 Commits

Reviewing files that changed from the base of the PR and between 333054e and 1dbb531.

📒 Files selected for processing (4)
  • internal/k8s_client/apply.go
  • internal/k8s_client/client.go
  • internal/maestro_client/client.go
  • internal/maestro_client/operations.go
💤 Files with no reviewable changes (3)
  • internal/maestro_client/client.go
  • internal/maestro_client/operations.go
  • internal/k8s_client/client.go

Walkthrough

This pull request enhances the reliability of concurrent resource creation and reduces logging verbosity. In the Kubernetes client, the ApplyManifest method now gracefully handles race conditions where a resource already exists after a concurrent create operation by converting the result to skip rather than failing. Additionally, informational and debug logging statements are removed across multiple client methods in both the Kubernetes and Maestro clients, including pre/post-operation messages and status updates. Control flow and error handling behavior remain unchanged except for the concurrent create handling.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: consolidating duplicate resource operation logs across k8s_client and maestro_client by removing redundant pre/post operation logging statements.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

result.Reason = "already exists (concurrent create)"
applyErr = nil
}

Choose a reason for hiding this comment

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

Missing test coverage for this change

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