Skip to content

Conversation

MarianMacik
Copy link
Member

@MarianMacik MarianMacik commented Aug 6, 2025

Description

This commit doesn't fix the issue but allows any NotFound error - e.g. when a namespace if a resource to be created is missing, to be displayed to users.

How Has This Been Tested?

Manually on a separate cluster all components were able to deploy, so there doesn't seem to be a reason for ignoring NotFound errors as with patch/apply operation they can only happen if something is wrong with the environment, e.g. a resource is to be created in a non-existing namespace, which users should be informed about.

Screenshot or short clip

N/A

Merge criteria

  • You have read the contributors guide.
  • Commit messages are meaningful - have a clear and concise summary and detailed explanation of what was changed and why.
  • Pull Request contains a description of the solution, a link to the JIRA issue, and to any dependent or related Pull Request.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

Summary by CodeRabbit

  • Bug Fixes
    • Improved error handling during deployment and resource application by ensuring all errors, including "NotFound" errors, are now reported to users rather than being silently ignored in most cases. This provides clearer feedback when deployment or resource operations encounter issues.

Copy link

coderabbitai bot commented Aug 6, 2025

Walkthrough

The changes update error handling within deployment and resource application logic. Specifically, "not found" errors are no longer ignored in the main deployment and resource apply paths, while the status application path retains its previous handling for such errors. No public interfaces or function signatures were modified.

Changes

Cohort / File(s) Change Summary
Deploy Action Error Handling
pkg/controller/actions/deploy/action_deploy.go
Updated error handling in the deploy method to return raw errors directly, no longer suppressing "not found" errors using client.IgnoreNotFound.
Resource Apply Error Handling
pkg/resources/resources.go
Simplified error handling in the Apply function to return all errors, including "NotFound", instead of ignoring them. The ApplyStatus function retains the logic to ignore "NotFound" errors.

Sequence Diagram(s)

sequenceDiagram
    participant Controller
    participant Resources

    Controller->>Resources: Apply(resource)
    alt Patch returns error
        alt Previous: NotFound error
            Resources-->>Controller: Return nil (ignore error)
        else Other error
            Resources-->>Controller: Return error with context
        end
    else No error
        Resources-->>Controller: Success
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested labels

lgtm, approved, component/codeflare

Suggested reviewers

  • kahowell
  • StevenTobin

Poem

A patch or apply, what’s a bunny to do?
With errors now honest, not hidden from view.
No more “not found” swept under the rug,
The code’s more transparent—give it a hug!
Hop along, reviewers, and see what’s anew!
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b372c53 and 77c7819.

📒 Files selected for processing (2)
  • pkg/controller/actions/deploy/action_deploy.go (1 hunks)
  • pkg/resources/resources.go (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • pkg/resources/resources.go
  • pkg/controller/actions/deploy/action_deploy.go
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@openshift-ci openshift-ci bot requested a review from lphiri August 6, 2025 08:59
@MarianMacik
Copy link
Member Author

/test opendatahub-operator-e2e

@MarianMacik
Copy link
Member Author

/test opendatahub-operator-e2e

@MarianMacik
Copy link
Member Author

/test opendatahub-operator-e2e

@MarianMacik MarianMacik removed the request for review from lphiri August 6, 2025 22:19
@MarianMacik
Copy link
Member Author

/test opendatahub-operator-e2e

@MarianMacik MarianMacik force-pushed the RHOAIENG-31497 branch 2 times, most recently from 2502066 to b372c53 Compare August 7, 2025 11:08
…clusters - display error

This commit doesn't fix the issue but allows any NotFound error - e.g. when a namespace if a resource to be created is missing, to be displayed to users.
@MarianMacik
Copy link
Member Author

/test image
/test opendatahub-operator-e2e

@MarianMacik
Copy link
Member Author

/test images
/test opendatahub-operator-e2e

Copy link

codecov bot commented Aug 7, 2025

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 41.92%. Comparing base (aa939fd) to head (77c7819).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
pkg/resources/resources.go 0.00% 2 Missing ⚠️
pkg/controller/actions/deploy/action_deploy.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2257   +/-   ##
=======================================
  Coverage   41.91%   41.92%           
=======================================
  Files         144      144           
  Lines       11389    11387    -2     
=======================================
  Hits         4774     4774           
+ Misses       6214     6212    -2     
  Partials      401      401           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

openshift-ci bot commented Aug 8, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lburgazzoli

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

The pull request process is described here

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-ci openshift-ci bot added the approved label Aug 8, 2025
@openshift-merge-bot openshift-merge-bot bot merged commit 52e03fe into opendatahub-io:main Aug 8, 2025
16 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in ODH Platform Planning Aug 8, 2025
MarianMacik added a commit to openshift-cherrypick-robot/opendatahub-operator that referenced this pull request Aug 8, 2025
…clusters - display error (opendatahub-io#2257)

This commit doesn't fix the issue but allows any NotFound error - e.g. when a namespace if a resource to be created is missing, to be displayed to users.
ugiordan pushed a commit to openshift-cherrypick-robot/opendatahub-operator that referenced this pull request Aug 9, 2025
…clusters - display error (opendatahub-io#2257)

This commit doesn't fix the issue but allows any NotFound error - e.g. when a namespace if a resource to be created is missing, to be displayed to users.
openshift-merge-bot bot pushed a commit that referenced this pull request Aug 9, 2025
…tors are required to be installed despite no observability configured (#2258)

* chore: Align otel condition with other observability operators

* chore: Align monitoring controller actions workflow

* RHOAIENG-31536 - OpenTelemetry and Cluster Observability operators are required to be installed despite no observability configured

* fix: enable monitoring namespace for other platform if monitoring is enabled (#2250)

* fix: enable moniotoring for other platform if monitoring is enabled

- ODH and self-managed : is monitoring is enabled
- managed : always

Signed-off-by: Wen Zhou <[email protected]>

* fix: wrong logic, the one should always create namespace is Managed

Signed-off-by: Wen Zhou <[email protected]>

---------

Signed-off-by: Wen Zhou <[email protected]>

* RHOAIENG-31643 - otel-collector is not deployed when only traces are enabled (#2262)

* RHOAIENG-31497 - Monitoring namespace is not created on self-managed clusters - display error (#2257)

This commit doesn't fix the issue but allows any NotFound error - e.g. when a namespace if a resource to be created is missing, to be displayed to users.

---------

Signed-off-by: Wen Zhou <[email protected]>
Co-authored-by: Marián Macik <[email protected]>
Co-authored-by: Wen Zhou <[email protected]>
Co-authored-by: Marián Macik <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants