Skip to content

fix: add logging to MarkAsDeleting idempotency early-returns - #575

Open
ciaranRoche wants to merge 1 commit into
openshift-online:mainfrom
ciaranRoche:HYPERFLEET-1496-mark-as-deleting-logging
Open

fix: add logging to MarkAsDeleting idempotency early-returns#575
ciaranRoche wants to merge 1 commit into
openshift-online:mainfrom
ciaranRoche:HYPERFLEET-1496-mark-as-deleting-logging

Conversation

@ciaranRoche

@ciaranRoche ciaranRoche commented Aug 12, 2026

Copy link
Copy Markdown

Summary

  • Adds klog.Info log lines to the two silent early-return paths in MarkAsDeleting (pkg/services/resource.go)
  • When a resource is already fully deleted (404): logs "skipping delete for resource as it is already fully deleted"
  • When deletion is already in flight (DeletedAt.Valid): logs "skipping delete for resource as deletion is already in flight"

Previously these paths returned nil with zero logging, making it appear Maestro was ignoring repeated delete requests from CS.

Ref: HYPERFLEET-1496

Test plan

  • Verify go build ./pkg/services/ compiles cleanly
  • Verify unit tests pass (make test)
  • Confirm log messages appear in server output when duplicate delete requests are received

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved deletion handling by recording when deletion is skipped for resources that are already deleted or soft-deleted.
    • Preserved existing idempotent deletion behavior.

The two early-return paths in MarkAsDeleting (resource already fully
deleted, and deletion already in flight) were completely silent. When
CS retried delete requests, the server logged "receive the event from
client" but nothing else, making it appear Maestro was ignoring deletes.

Ref: HYPERFLEET-1496

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: openshift-online/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 13ac4aa1-408d-4335-98de-49c705f81125

📥 Commits

Reviewing files that changed from the base of the PR and between ab480c6 and b4a6b1d.

📒 Files selected for processing (1)
  • pkg/services/resource.go

Walkthrough

MarkAsDeleting now creates a resource-scoped logger and records informational messages when deletion is skipped for already deleted resources or resources already undergoing deletion. Early-return behavior remains unchanged.

Changes

Deletion logging

Layer / File(s) Summary
Log skipped deletion states
pkg/services/resource.go
MarkAsDeleting creates a resource-scoped logger and logs both existing deletion states before returning.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 5 | ❌ 6

❌ Failed checks (6 inconclusive)

Check name Status Explanation Resolution
No-Weak-Crypto ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Container-Privileges ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
No-Sensitive-Data-In-Logs ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
No-Hardcoded-Secrets ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
No-Injection-Vectors ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Ai-Attribution ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the added logging for MarkAsDeleting idempotency early returns.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

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

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.

1 participant