Skip to content

perf(api): optimize redfish action device lookup#1049

Merged
sudhir-intc merged 2 commits into
redfishfrom
redfish-optimization
Jun 4, 2026
Merged

perf(api): optimize redfish action device lookup#1049
sudhir-intc merged 2 commits into
redfishfrom
redfish-optimization

Conversation

@sudhir-intc
Copy link
Copy Markdown
Contributor

The PR introduces an optimization w.r.t device lookup where instead of query for the validate device-id (UUID) through WS-MAN API's we query with the local device repo.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR optimizes Redfish system-action flows by validating system existence through the local devices repository (when available) instead of triggering WS-MAN hydration via the ComputerSystem repository.

Changes:

  • Added a DeviceLookupRepository dependency and EnsureSystemExists helper to ComputerSystemUseCase to support lightweight existence checks.
  • Updated multiple Redfish action handlers (Reset / KVM consent actions) to pre-validate system existence before executing the action.
  • Wired the device-lookup dependency during Redfish component initialization and updated action-handler tests to provide a lookup repo.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
redfish/internal/usecase/computer_system.go Introduces DeviceLookupRepository, adapter, and EnsureSystemExists; token generation now uses the new existence-check path.
redfish/internal/controller/http/v1/handler/systems_actions.go Adds EnsureSystemExists checks before executing several system action endpoints.
redfish/internal/controller/http/v1/handler/systems_actions_test.go Updates tests to provide a device lookup repo to the use case so action endpoints can validate existence.
redfish/component.go Wires DeviceRepo (devices use case in real mode; adapter in mock mode) into ComputerSystemUseCase.

Comment thread redfish/internal/usecase/computer_system.go
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 4, 2026

Codecov Report

❌ Patch coverage is 86.53846% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 42.98%. Comparing base (912deeb) to head (19541ae).

Files with missing lines Patch % Lines
redfish/component.go 0.00% 7 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           redfish    #1049      +/-   ##
===========================================
+ Coverage    42.79%   42.98%   +0.19%     
===========================================
  Files          153      153              
  Lines        14804    14853      +49     
===========================================
+ Hits          6335     6385      +50     
+ Misses        7890     7888       -2     
- Partials       579      580       +1     

☔ View full report in Codecov by Harness.
📢 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.

@sudhir-intc sudhir-intc force-pushed the redfish-optimization branch from 09a0c99 to f5312f0 Compare June 4, 2026 04:01
@sudhir-intc sudhir-intc force-pushed the redfish-optimization branch from f5312f0 to f168de8 Compare June 4, 2026 04:22
Copy link
Copy Markdown
Contributor

@amarnath-ac amarnath-ac left a comment

Choose a reason for hiding this comment

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

LGTM, tested changes, no delay in fetching redirection token.

@sudhir-intc sudhir-intc merged commit 7f7e804 into redfish Jun 4, 2026
21 checks passed
@sudhir-intc sudhir-intc deleted the redfish-optimization branch June 4, 2026 05:33
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.

3 participants