Skip to content

Conversation

@renczesstefan
Copy link
Member

@renczesstefan renczesstefan commented Oct 7, 2025

Description

Corrected wrong function call and simplified resolution of global role in collectRolesForPreferenceItem, as importId for global roles always will be unique.

Fixes NAE-2228

Dependencies

No new dependencies were introduced

Third party dependencies

No new dependencies were introduced

Blocking Pull requests

There are no dependencies on other PR

How Has Been This Tested?

This was tested manually and with unit tests.

Test Configuration

Name Tested on
OS macOS Tahoe 26.0.1
Runtime Java 21
Dependency Manager Maven 3.9.9n
Framework version Spring Boot 3.4.4
Run parameters
Other configuration

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes have been checked, personally or remotely, with @machacjozef
  • I have commented my code, particularly in hard-to-understand areas
  • I have resolved all conflicts with the target branch of the PR
  • I have updated and synced my code with the target branch
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing tests pass locally with my changes:
    • Lint test
    • Unit tests
    • Integration tests
  • I have checked my contribution with code analysis tools:
  • I have made corresponding changes to the documentation:
    • Developer documentation
    • User Guides
    • Migration Guides

Summary by CodeRabbit

  • Bug Fixes

    • Role-based preference handling now tolerates missing global roles, reducing errors and unexpected behavior.
  • Performance

    • Faster global role lookup during preference evaluation, improving responsiveness in large or complex setups.
  • Chores

    • Parent project version updated across modules (release candidate patch).

machacjozef and others added 2 commits October 2, 2025 15:44
- Replaced multiple calls with a single paginated query to improve performance and reduce unnecessary iterations. This simplifies the logic and ensures the first global role is efficiently retrieved.
@renczesstefan renczesstefan self-assigned this Oct 7, 2025
@renczesstefan renczesstefan added the bugfix A change that fixes a bug label Oct 7, 2025
@coderabbitai
Copy link

coderabbitai bot commented Oct 7, 2025

Walkthrough

Replace GLOBAL role lookup in ActionDelegate.collectRolesForPreferenceItem to use a paginated call to ProcessRoleService.findAllByImportId(..., Pageable.ofSize(1)); proceed only if the returned page has at least one entry and use its first element. Several module parent POM versions updated from 7.0.0-RC8 to 7.0.0-RC8.1.

Changes

Cohort / File(s) Summary
ActionDelegate GLOBAL lookup
application-engine/src/main/groovy/com/netgrif/application/engine/petrinet/domain/dataset/logic/action/ActionDelegate.groovy
Replace non-paginated/global filtering with processRoleService.findAllByImportId(ProcessRole.GLOBAL + entry.key, Pageable.ofSize(1)); check page content and use first result when present. Non-global path unchanged.
Parent POM version bumps
pom.xml, application-engine/pom.xml, nae-object-library/pom.xml, nae-spring-core-adapter/pom.xml, nae-user-ce/pom.xml, nae-user-common/pom.xml
Update parent version from 7.0.0-RC8 to 7.0.0-RC8.1 across multiple modules; no other functional changes in these files.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Caller
  participant ActionDelegate
  participant ProcessRoleService

  Caller->>ActionDelegate: collectRolesForPreferenceItem(roles)
  alt GLOBAL role key present
    ActionDelegate->>ProcessRoleService: findAllByImportId(importId, Pageable.ofSize(1))
    ProcessRoleService-->>ActionDelegate: Page<ProcessRole>
    alt page not empty
      ActionDelegate->>ActionDelegate: select first ProcessRole (getFirst)
      ActionDelegate-->>Caller: continue with selected global role
    else page empty
      ActionDelegate-->>Caller: skip GLOBAL role handling
    end
  else non-global role
    ActionDelegate->>ActionDelegate: existing non-global role handling (unchanged)
    ActionDelegate-->>Caller: continue
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Pre-merge checks

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title directly references the main functional change in the changeset. The primary modification is to the collectRolesForPreferenceItem method in the ActionDelegate.groovy file, where a wrong function call was corrected and the global role resolution was simplified. The title clearly identifies both the method name and the issue type. The secondary changes (version bumps across multiple pom.xml files) are administrative updates for the release and do not constitute the primary focus of this PR. The title is specific enough that a teammate reviewing the history would understand this is a targeted bug fix for a particular method.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7e40aca and 2f8469f.

📒 Files selected for processing (6)
  • application-engine/pom.xml (1 hunks)
  • nae-object-library/pom.xml (1 hunks)
  • nae-spring-core-adapter/pom.xml (1 hunks)
  • nae-user-ce/pom.xml (1 hunks)
  • nae-user-common/pom.xml (1 hunks)
  • pom.xml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build
🔇 Additional comments (6)
nae-object-library/pom.xml (1)

10-10: Version bump is consistent with parent module update.

The parent version update from 7.0.0-RC8 to 7.0.0-RC8.1 aligns with the coordinated version bump across all modules.

nae-user-ce/pom.xml (1)

9-9: Version bump is consistent with coordinated parent module update.

The parent version is correctly aligned with other modules in this PR.

application-engine/pom.xml (1)

9-9: Version bump is consistent, but the actual behavioral fix is not included in this review.

The PR objectives describe a fix to ActionDelegate.collectRolesForPreferenceItem that should replace GLOBAL role lookup with a paginated call. This file (application-engine/src/main/groovy/.../ActionDelegate.groovy) is not provided in the current review set.

Please include application-engine/src/main/groovy/com/netgrif/application/engine/petrinet/domain/dataset/logic/action/ActionDelegate.groovy in the review files so the functional fix can be validated.

nae-spring-core-adapter/pom.xml (1)

10-10: Version bump is consistent with coordinated parent module update.

pom.xml (1)

9-9: Root parent POM version correctly drives coordinated update across all child modules.

The version bump from 7.0.0-RC8 to 7.0.0-RC8.1 at the root level ensures consistency across the entire module hierarchy.

nae-user-common/pom.xml (1)

9-9: Version bump is consistent with coordinated parent module update.


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.

@coderabbitai coderabbitai bot added the Medium label Oct 7, 2025
Copy link

@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: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8143934 and eff6b55.

📒 Files selected for processing (1)
  • application-engine/src/main/groovy/com/netgrif/application/engine/petrinet/domain/dataset/logic/action/ActionDelegate.groovy (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: task-list-completed
  • GitHub Check: task-list-completed
  • GitHub Check: task-list-completed
  • GitHub Check: task-list-completed
  • GitHub Check: Build

Updated logic to correctly handle cases where no global roles are found by checking for an empty list instead of null. This ensures robustness and prevents potential runtime errors.
coderabbitai[bot]
coderabbitai bot previously approved these changes Oct 7, 2025
tuplle
tuplle previously approved these changes Oct 20, 2025
machacjozef
machacjozef previously approved these changes Oct 20, 2025
@machacjozef machacjozef changed the base branch from release/7.0.0-rev9 to release/7.0.0-rev8 October 20, 2025 10:47
@machacjozef machacjozef dismissed stale reviews from tuplle, coderabbitai[bot], and themself October 20, 2025 10:47

The base branch was changed.

@machacjozef machacjozef merged commit 6b0d152 into release/7.0.0-rev8 Oct 20, 2025
7 checks passed
@machacjozef machacjozef deleted the NAE-2228 branch October 20, 2025 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix A change that fixes a bug Medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants