Skip to content

Remove forcibly deleting resources that cannot be patched - #1515

Merged
openshift-merge-bot[bot] merged 1 commit into
redhat-developer:mainfrom
gazarenkov:remove-deleting-on-error
Aug 18, 2025
Merged

Remove forcibly deleting resources that cannot be patched#1515
openshift-merge-bot[bot] merged 1 commit into
redhat-developer:mainfrom
gazarenkov:remove-deleting-on-error

Conversation

@gazarenkov

@gazarenkov gazarenkov commented Aug 18, 2025

Copy link
Copy Markdown
Member

Description

Remove forcibly deleting resources that cannot be patched

Which issue(s) does this PR fix or relate to

https://issues.redhat.com/browse/RHDHBUGS-1898

PR acceptance criteria

  • Tests

Summary by Sourcery

Remove force-deletion fallback for unpatchable resources and clean up related logic

Bug Fixes:

  • Prevent forcible deletion of resources on patch failures by removing the upgrade glitch workaround

Enhancements:

  • Simplify applyPayload to directly return patch errors instead of deleting resources
  • Streamline monitoring log output when ServiceMonitor is disabled

CI:

  • Update Renovate workflow to always use the latest version and clarify the step name

Tests:

  • Add missing newline at end of the cr-compatibility integration test

Chores:

  • Regenerate deepcopy functions across all API versions

@sourcery-ai

sourcery-ai Bot commented Aug 18, 2025

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Removed forced deletion fallback for unpatchable resources by simplifying patch error handling and deleting the tryToFixUpgradeGlitch method; refined monitoring logs; updated Renovate CI step; added missing newline in test; regenerated deepcopy files.

Sequence diagram for simplified patch error handling in BackstageReconciler

sequenceDiagram
participant BackstageReconciler
participant KubernetesAPI
BackstageReconciler->>KubernetesAPI: Patch resource (Apply)
KubernetesAPI-->>BackstageReconciler: Error (patch failed)
BackstageReconciler-->>BackstageReconciler: Return error (no forced delete fallback)
Loading

Class diagram for BackstageReconciler after removal of tryToFixUpgradeGlitch

classDiagram
class BackstageReconciler {
  +applyPayload(ctx, obj)
  +applyServiceMonitor(ctx, backstage)
  +SetupWithManager(mgr)
  -tryToFixUpgradeGlitch(ctx, obj, inError) [REMOVED]
}
Loading

File-Level Changes

Change Details Files
Simplify patch error handling and remove fallback deletion logic
  • Replace tryToFixUpgradeGlitch call with direct error return
  • Remove tryToFixUpgradeGlitch method including orphan deletion and log messages
  • Wrap patch errors with descriptive message
internal/controller/backstage_controller.go
Refine monitoring log messages
  • Remove 'Checking monitoring status' log
  • Lowercase and adjust disabled monitoring log message
internal/controller/monitor.go
Update Renovate CI version print step
  • Rename step to 'Print actual renovate version'
  • Add comment to enforce using latest renovate version
.github/workflows/renovate-checks.yaml
Add missing newline at end of test file
  • Add trailing newline
integration_tests/cr-compatibility_test.go
Regenerate deepcopy files
  • Regenerate zz_generated.deepcopy.go for API versions
api/v1alpha1/zz_generated.deepcopy.go
api/v1alpha2/zz_generated.deepcopy.go
api/v1alpha3/zz_generated.deepcopy.go
api/v1alpha4/zz_generated.deepcopy.go

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot 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.

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread .github/workflows/renovate-checks.yaml
@openshift-ci

openshift-ci Bot commented Aug 18, 2025

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rm3l

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

The pull request process is described 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

@openshift-merge-bot
openshift-merge-bot Bot merged commit 5ee4ba2 into redhat-developer:main Aug 18, 2025
7 checks passed
Fortune-Ndlovu pushed a commit to Fortune-Ndlovu/rhdh-operator that referenced this pull request Sep 6, 2025
@rhdh-qodo-merge rhdh-qodo-merge Bot mentioned this pull request May 19, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants