Skip to content

Fix/backup graceful degradation - #1496

Merged
akurinnoy merged 4 commits into
mainfrom
fix/backup-graceful-degradation
Mar 31, 2026
Merged

Fix/backup graceful degradation#1496
akurinnoy merged 4 commits into
mainfrom
fix/backup-graceful-degradation

Conversation

@akurinnoy

Copy link
Copy Markdown
Contributor

What does this PR do?

This PR fixes 500/403 errors on the Workspaces page when backup is not configured. The backend part catches the DWOC is not found or backup is not configured and returns {enabled: false} silently.

Requires eclipse-che/che-operator#2099 for the dashboard SA to read the DWOC.

Screenshot/screencast of this PR

What issues does this PR fix or reference?

fixes eclipse-che/che#23777

Is it tested? How?

Manually verified on ROSA cluster:

  • No DWOC: no Backup Status column, no console errors, pod logs show 403 warning
  • DWOC configured & enabled: Backup Status column visible, real-time updates via WebSocket
  • DWOC configured & disabled: Backup Status column visible with last-known status

Release Notes

Docs PR

akurinnoy and others added 2 commits March 25, 2026 13:07
Prohibit using or casting to `any` type in TypeScript code.
Use proper types, type guards, `unknown`, or specific interfaces.

Assisted-by: Claude Opus 4.6

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Oleksii Kurinnyi <okurinny@redhat.com>
When the DevWorkspaceOperatorConfig (DWOC) is missing, inaccessible,
or has no backup configuration, the dashboard now returns valid
responses instead of 500/403 errors.

Backend:
- getClusterBackupConfig() catches 403/404 and returns
  { enabled: false, schedule: "", registry: "" }
- getWorkspaceBackupStatus() returns { status: "never" } early
  when registry is empty, skipping DevWorkspace/Job queries
- Uses isKubeClientError() type guard instead of casting to any

Frontend:
- WorkspacesListContainer gates backup-status calls on non-empty
  backupConfig.registry
- Backup Status column only renders when backup is configured
- fetchBackupConfig deduplicates in-flight requests and uses
  TTL cache instead of force-refreshing on every tab switch

Fixes: eclipse-che/che#23777
Assisted-by: Claude Opus 4.6

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Oleksii Kurinnyi <okurinny@redhat.com>
@akurinnoy
akurinnoy requested review from dkwon17 and svor March 25, 2026 14:01
@akurinnoy akurinnoy self-assigned this Mar 25, 2026
@che-bot

che-bot commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

Click here to review and test in web IDE: Contribute

Signed-off-by: Oleksii Kurinnyi <okurinny@redhat.com>
@github-actions

Copy link
Copy Markdown

Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1496

kubectl patch command
kubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1496", name: che-dashboard}]}}]"

@codecov

codecov Bot commented Mar 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.30894% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.25%. Comparing base (cb663b2) to head (fdad7ce).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
.../src/pages/WorkspacesList/WorkspacesView/index.tsx 89.65% 3 Missing ⚠️
...pacesList/WorkspacesView/WorkspacesTable/index.tsx 33.33% 2 Missing ⚠️
...end/src/pages/WorkspacesList/BackupsView/index.tsx 50.00% 1 Missing ⚠️
...shboard-frontend/src/pages/WorkspacesList/Rows.tsx 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1496      +/-   ##
==========================================
+ Coverage   92.22%   92.25%   +0.02%     
==========================================
  Files         561      562       +1     
  Lines       54692    55000     +308     
  Branches     4064     4102      +38     
==========================================
+ Hits        50442    50742     +300     
- Misses       4203     4211       +8     
  Partials       47       47              

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@olexii4 olexii4 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.

LGTM

@olexii4

olexii4 commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

@akurinnoy Patch coverage is 76.42276% with 29 lines in your changes missing coverage. Can you fix this?

@svor svor 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.

lgtm

Image

@openshift-ci

openshift-ci Bot commented Mar 30, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: akurinnoy, olexii4, svor

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

Add tests for backup config fetching on mount, backup status fetching
with registry guard, WebSocket backup annotation change detection,
and in-flight request deduplication.

Assisted-by: Claude Opus 4.6

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Oleksii Kurinnyi <okurinny@redhat.com>
@openshift-ci

openshift-ci Bot commented Mar 30, 2026

Copy link
Copy Markdown

New changes are detected. LGTM label has been removed.

@openshift-ci openshift-ci Bot removed the lgtm label Mar 30, 2026
@github-actions

Copy link
Copy Markdown

Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1496 (linux/amd64, linux/arm64)

kubectl patch command
kubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1496", name: che-dashboard}]}}]"

@akurinnoy
akurinnoy merged commit 060a24a into main Mar 31, 2026
18 of 21 checks passed
@akurinnoy
akurinnoy deleted the fix/backup-graceful-degradation branch March 31, 2026 12:58
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.

Dashboard returns 500 when querying backup status if backup/restore is not configured

4 participants