Skip to content

adjust getting computation status - #4068

Open
EtienneLt wants to merge 7 commits into
mainfrom
adjust-get-computation-status
Open

adjust getting computation status#4068
EtienneLt wants to merge 7 commits into
mainfrom
adjust-get-computation-status

Conversation

@EtienneLt

Copy link
Copy Markdown
Contributor

PR Summary

Signed-off-by: Etienne LESOT <etienne.lesot@rte-france.com>
@EtienneLt EtienneLt self-assigned this Jun 29, 2026
@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d1e027d2-271a-4b34-902b-bc9ebcdaa5ac

📥 Commits

Reviewing files that changed from the base of the PR and between 31494ea and 3dcbaef.

📒 Files selected for processing (3)
  • src/components/computing-status/use-all-computing-status.ts
  • src/components/computing-status/use-computing-status-at-once.ts
  • src/components/study-container.jsx
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/components/study-container.jsx
  • src/components/computing-status/use-all-computing-status.ts
  • src/components/computing-status/use-computing-status-at-once.ts

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

StudyContainer now passes the current node build status through the computing status hooks. NOT_BUILT nodes reset computation statuses to IDLE, and notifications for other nodes are ignored.

Changes

Build Status Guard for Computing Status

Layer / File(s) Summary
Core update logic in useAllComputingStatusAtOnce
src/components/computing-status/use-computing-status-at-once.ts
Adds the BuildStatus input, filters notifications for other nodes, resets statuses to IDLE for NOT_BUILT nodes, and updates callback dependencies.
Propagation through hooks and container
src/components/computing-status/use-all-computing-status.ts, src/components/study-container.jsx
useAllComputingStatus accepts and forwards the current node build status. StudyContainer passes currentNode?.data.globalBuildStatus.

Merge Risk: ⚪ Minimal · up to 3dcba

This localized change adjusts computation-status retrieval behavior without any identified merge-blocking correctness, availability, or deployment risk. It is merge-ready after normal checks and review, with no actionable merge-blocking risk remaining.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The description contains only a template and does not provide meaningful details about the computation status changes. Add a brief summary that explains how computation status handling changed and why the change was made.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately identifies the change to computation status handling.
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.

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/computing-status/use-all-computing-status.ts`:
- Around line 129-134: The BuildStatus is only handled in
useAllComputingStatusAtOnce, while useComputingStatus still runs independently
for each computation type and can repopulate status after a batch reset. Thread
currentNodeStatusBuildStatus through useAllComputingStatus into the per-type
hook path, and update useComputingStatus to accept and honor that status so
NOT_BUILT continues to map to IDLE instead of being overwritten by its own
fetch/listen logic.

In `@src/components/computing-status/use-computing-status-at-once.ts`:
- Around line 214-220: The NOT_BUILT branch in useComputingStatusAtOnce is only
resetting statuses and nodeUuidRef, but it does not cancel any in-flight
updateAll request or clear its completion marker. Update this branch to also
invalidate the pending request state used by shouldRequestBeCanceled and reset
the last-completed computation tracking the same way updateAll does when the
node changes, so stale responses cannot overwrite the forced IDLE state.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 897a4970-76f8-4af4-bd82-66167edae0e3

📥 Commits

Reviewing files that changed from the base of the PR and between 0a0f69d and a524251.

📒 Files selected for processing (3)
  • src/components/computing-status/use-all-computing-status.ts
  • src/components/computing-status/use-computing-status-at-once.ts
  • src/components/study-container.jsx

Comment on lines +129 to +134
export const useAllComputingStatus = (
studyUuid: UUID,
currentNodeUuid: UUID,
currentRootNetworkUuid: UUID,
currentNodeStatusBuildStatus: BuildStatus
): void => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

file="$(fd -i 'use-computing-status.ts' src/components/computing-status | head -n1)"
echo "Inspecting: $file"

ast-grep outline "$file" --view expanded
echo
rg -n -C3 'BuildStatus|NOT_BUILT|useNotificationsListener|setComputingStatus|fetch.*Status' "$file"
echo
sed -n '1,260p' "$file"

Repository: gridsuite/gridstudy-app

Length of output: 13338


🏁 Script executed:

#!/bin/bash
set -euo pipefail

file="src/components/computing-status/use-all-computing-status.ts"
echo "Inspecting: $file"

ast-grep outline "$file" --view expanded
echo
rg -n -C4 'useComputingStatus|useAllComputingStatusAtOnce|currentNodeStatusBuildStatus|BuildStatus|NOT_BUILT' "$file"
echo
sed -n '1,260p' "$file"

Repository: gridsuite/gridstudy-app

Length of output: 18556


Thread currentNodeStatusBuildStatus into the per-type hooks toouseAllComputingStatusAtOnce(...) is the only place that sees the BuildStatus, but useComputingStatus(...) is still mounted for every computation type and still fetches/listens on its own. If NOT_BUILT should stay IDLE, those hooks can repopulate status after the batch reset.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/computing-status/use-all-computing-status.ts` around lines 129
- 134, The BuildStatus is only handled in useAllComputingStatusAtOnce, while
useComputingStatus still runs independently for each computation type and can
repopulate status after a batch reset. Thread currentNodeStatusBuildStatus
through useAllComputingStatus into the per-type hook path, and update
useComputingStatus to accept and honor that status so NOT_BUILT continues to map
to IDLE instead of being overwritten by its own fetch/listen logic.

Comment on lines +214 to +220
// no need to request the back if node is not built
if (currentNodeBuildStatus === BuildStatus.NOT_BUILT) {
Object.values(ComputingType).forEach((computingType: ComputingType) => {
dispatch(setComputingStatus(computingType, RunningStatus.IDLE));
});
nodeUuidRef.current = nodeUuid;
return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Invalidate outstanding updates before returning for NOT_BUILT.

This branch forces IDLE and exits, but it does not invalidate an updateAll() request that was already in flight for the same node/root. When that response lands, shouldRequestBeCanceled(...) still passes and can repopulate stale statuses, undoing this reset. It also skips the setLastCompletedComputation() reset that updateAll() performs for node changes.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/computing-status/use-computing-status-at-once.ts` around lines
214 - 220, The NOT_BUILT branch in useComputingStatusAtOnce is only resetting
statuses and nodeUuidRef, but it does not cancel any in-flight updateAll request
or clear its completion marker. Update this branch to also invalidate the
pending request state used by shouldRequestBeCanceled and reset the
last-completed computation tracking the same way updateAll does when the node
changes, so stale responses cannot overwrite the forced IDLE state.

@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@sonarqubecloud

Copy link
Copy Markdown

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.

2 participants