Skip to content

Node build/unbuild updates study last modification date#992

Merged
Meklo merged 2 commits into
mainfrom
marcellinh/node-build-unbuild-updates-last-modification-date
May 15, 2026
Merged

Node build/unbuild updates study last modification date#992
Meklo merged 2 commits into
mainfrom
marcellinh/node-build-unbuild-updates-last-modification-date

Conversation

@Meklo
Copy link
Copy Markdown
Contributor

@Meklo Meklo commented May 15, 2026

PR Summary

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 15, 2026

Review Change Stack

Warning

Rate limit exceeded

@Meklo has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 43 minutes and 56 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0a471016-2444-4e1e-b0ba-26eaeebb93d6

📥 Commits

Reviewing files that changed from the base of the PR and between 510c6f9 and 625342b.

📒 Files selected for processing (1)
  • src/main/java/org/gridsuite/study/server/service/StudyService.java
📝 Walkthrough

Walkthrough

This PR extends unbuild operations in GridSuite Study Server to track the requesting user and emit element-update notifications. The unbuild APIs in StudyService, StudyController, and SupervisionService are updated to accept a userId parameter, and notifications are emitted after unbuild completion. Tests verify userId passing and notification messages.

Changes

Add userId tracking and element-update notifications to unbuild flow

Layer / File(s) Summary
Service API updates for userId and notifications
src/main/java/org/gridsuite/study/server/service/StudyService.java
unbuildStudyNode and unbuildNodeTree method signatures now accept userId parameter and emit emitElementUpdated notifications. buildStudyNode also emits the notification pattern for consistency.
Controller endpoints accepting userId
src/main/java/org/gridsuite/study/server/controller/StudyController.java
unbuildNode and unbuildAllNodes REST endpoints now accept userId via @RequestHeader and forward it to service methods. unbuildAllNodes adds try/finally for unblocking.
SupervisionService integration
src/main/java/org/gridsuite/study/server/service/SupervisionService.java
Introduces SUPERVISION_USER constant and updates unbuildAllNodes to pass this user identifier when calling the updated studyService.unbuildNodeTree.
Test coverage for userId and notifications
src/test/java/org/gridsuite/study/server/NetworkModificationUnitTest.java
Tests updated to pass userId header in unbuild calls, assert element-update message emissions with modifiedBy verification, and add helper method checkElementUpdatedMessageSent for centralized message assertions.

Suggested Reviewers

  • SlimaneAmar
  • AbdelHedhili
  • souissimai
🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (2 warnings, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description is empty, providing no meaningful information about the changeset. Add a detailed description explaining the changes: userId parameter addition to unbuild endpoints, element-updated notifications, and the supervision user constant.
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.
Title check ❓ Inconclusive The title is partially related to the changeset; it mentions updating study modification date, but the changes focus on adding userId tracking to unbuild endpoints and emitting element-updated notifications. Clarify whether the primary focus is updating modification dates or adding userId/notification tracking; adjust title to reflect the main intent.
✅ Passed checks (2 passed)
Check name Status Explanation
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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 and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

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/main/java/org/gridsuite/study/server/controller/StudyController.java`:
- Around line 1703-1708: The pre-check assertNoBlockedNodeInStudy should be run
before entering the try/finally so that unblockNodeTree in the finally does not
run when the pre-check fails; move the call to
studyService.assertNoBlockedNodeInStudy(studyUuid, rootNodeUuid) above the try,
then keep studyService.unbuildNodeTree(...) inside the try and
studyService.unblockNodeTree(...) in the finally so unblock only executes after
unbuild processing has begun.

In `@src/main/java/org/gridsuite/study/server/service/StudyService.java`:
- Around line 1900-1907: The method unbuildNodeTree accepts a nullable userId
but immediately uses it in notificationService.emitElementUpdated; update the
method signature to enforce non-null for userId (e.g., annotate userId with
`@NonNull` or add an explicit Objects.requireNonNull(userId, ...) at the start of
unbuildNodeTree) so callers fail fast and match adjacent APIs; locate the method
by name unbuildNodeTree(UUID studyUuid, UUID rootNodeUuid, boolean
withBlockNodes, String userId) and apply the non-null check/annotation before
any async work or the notification emission.
🪄 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: 780b3f89-ac9b-497c-800b-a3c913b6e170

📥 Commits

Reviewing files that changed from the base of the PR and between db039e8 and 510c6f9.

📒 Files selected for processing (4)
  • src/main/java/org/gridsuite/study/server/controller/StudyController.java
  • src/main/java/org/gridsuite/study/server/service/StudyService.java
  • src/main/java/org/gridsuite/study/server/service/SupervisionService.java
  • src/test/java/org/gridsuite/study/server/NetworkModificationUnitTest.java

Comment thread src/main/java/org/gridsuite/study/server/service/StudyService.java Outdated
@sonarqubecloud
Copy link
Copy Markdown

@Meklo Meklo merged commit f495cde into main May 15, 2026
4 of 9 checks passed
@Meklo Meklo deleted the marcellinh/node-build-unbuild-updates-last-modification-date branch May 15, 2026 09:51
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