Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JNG-5840 transform relations - round 1 #244

Merged
merged 15 commits into from
Jul 18, 2024

Conversation

noherczeg
Copy link
Contributor

@noherczeg noherczeg commented Jul 16, 2024

Sub-taskJNG-5840 Transform relations - round 1

@noherczeg noherczeg marked this pull request as ready for review July 18, 2024 14:52
@noherczeg noherczeg changed the title JNG-5840 transform relations JNG-5840 transform relations - round 1 Jul 18, 2024
Copy link

coderabbitai bot commented Jul 18, 2024

Walkthrough

Recent updates to the project involve extensive modifications across multiple files, primarily enhancing error handling, refining caching mechanisms, and improving functionality related to operations, transformations, and testing. New operations were introduced, particularly for handling relations and fields within the JSL model. Additionally, several test cases were updated and new ones were added to ensure comprehensive validation of nested fields, relations, and various data types.

Changes

Files Change Summary
.editorconfig Added new configuration for files in the src/main/epsilon directory.
src/main/epsilon/operations/... Error handling, cache management, new imports, refined operations, and logic.
src/main/epsilon/transformations/... Modifications to transformation rules, new rules for relation declarations.
src/test/java/hu/blackbelt/judo/tatami/jsl/jsl2ui/application/... Test enhancements, new entities, refactored assertions, and new test methods.

Sequence Diagram(s)

Equivalent Discriminated Operation

sequenceDiagram
    participant User
    participant JSL!equivalentDiscriminated
    participant CacheManager

    User->>JSL!equivalentDiscriminated: Request equivalentDiscriminated(transformation, id, discriminator)
    JSL!equivalentDiscriminated->>CacheManager: Check cache for element with ID
    alt Element found in cache
        CacheManager-->>JSL!equivalentDiscriminated: Return cached element
    else Element not found
        JSL!equivalentDiscriminated->>JSL!equivalentDiscriminated: Create new instance
        JSL!equivalentDiscriminated->>CacheManager: Store new instance in cache
    end
    JSL!equivalentDiscriminated-->>User: Return element
Loading

Transfer Field Declaration Operation

sequenceDiagram
    participant User
    participant JSL!TransferFieldDeclaration
    participant JSL!TransferContainer
    participant UI!ui::data::ClassType

    User->>JSL!TransferFieldDeclaration: Request getActorDeclaration()
    JSL!TransferFieldDeclaration->>JSL!TransferContainer: Get transfer container
    JSL!TransferContainer-->>JSL!TransferFieldDeclaration: Return container
    JSL!TransferFieldDeclaration->>UI!ui::data::ClassType: Get container equivalent class type
    UI!ui::data::ClassType-->>JSL!TransferFieldDeclaration: Return class type
    JSL!TransferFieldDeclaration-->>User: Return actor declaration
Loading

Poem

In the code, a rabbit hops,
Enhancing fields, refining ops.
Cache and errors now refined,
Transformations well-aligned.
Tests abound in nested threads,
Code improved where logic spreads.
Cheers to changes, one and all,
JSL's rise, a coder's call. 🐇✨


Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 1109025 and 2c38474.

Files selected for processing (7)
  • judo-tatami-jsl-jsl2ui/src/main/epsilon/operations/jsl/data/transferDeclaration.eol (2 hunks)
  • judo-tatami-jsl-jsl2ui/src/main/epsilon/operations/jsl/data/transferFieldDeclaration.eol (4 hunks)
  • judo-tatami-jsl-jsl2ui/src/main/epsilon/operations/jsl/data/transferRelationDeclaration.eol (1 hunks)
  • judo-tatami-jsl-jsl2ui/src/main/epsilon/transformations/ui/modules/structure/transferFieldDeclaration.etl (4 hunks)
  • judo-tatami-jsl-jsl2ui/src/main/epsilon/transformations/ui/modules/structure/transferRelationDeclaration.etl (1 hunks)
  • judo-tatami-jsl-jsl2ui/src/test/java/hu/blackbelt/judo/tatami/jsl/jsl2ui/application/JslModel2UiApplicationTest.java (6 hunks)
  • judo-tatami-jsl-jsl2ui/src/test/java/hu/blackbelt/judo/tatami/jsl/jsl2ui/application/JslModel2UiDataTest.java (7 hunks)
Files skipped from review as they are similar to previous changes (7)
  • judo-tatami-jsl-jsl2ui/src/main/epsilon/operations/jsl/data/transferDeclaration.eol
  • judo-tatami-jsl-jsl2ui/src/main/epsilon/operations/jsl/data/transferFieldDeclaration.eol
  • judo-tatami-jsl-jsl2ui/src/main/epsilon/operations/jsl/data/transferRelationDeclaration.eol
  • judo-tatami-jsl-jsl2ui/src/main/epsilon/transformations/ui/modules/structure/transferFieldDeclaration.etl
  • judo-tatami-jsl-jsl2ui/src/main/epsilon/transformations/ui/modules/structure/transferRelationDeclaration.etl
  • judo-tatami-jsl-jsl2ui/src/test/java/hu/blackbelt/judo/tatami/jsl/jsl2ui/application/JslModel2UiApplicationTest.java
  • judo-tatami-jsl-jsl2ui/src/test/java/hu/blackbelt/judo/tatami/jsl/jsl2ui/application/JslModel2UiDataTest.java

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 3

Outside diff range, codebase verification and nitpick comments (4)
judo-tatami-jsl-jsl2ui/src/main/epsilon/operations/equivalentDiscriminated.eol (2)

9-9: Typo in comment.

Fix the typo in the comment.

- // Find the discriminated id in cahe first
+ // Find the discriminated id in cache first

35-47: Clean up commented code.

Remove the commented-out code if it is no longer needed.

- /*
- for (t in transTrace.transformations) {
-     if (t.source == self and t.rule.name == transformation) {
-         t.targets.add(f);
-     }
- }
- */
judo-tatami-jsl-jsl2ui/src/main/epsilon/operations/jsl/actor/actorDeclaration.eol (1)

Line range hint 53-71:
Consolidate duplicate logic.

The logic for collecting menu declarations is duplicated. Consider refactoring to avoid code duplication.

operation JSL!ActorDeclaration getAllMenuDeclarations(): Set {
    return self.collectMenuDeclarations();
}

operation JSL!ActorGroupDeclaration getAllMenuDeclarations(): Set {
    return self.collectMenuDeclarations();
}

@cached
operation JSL!ActorDeclaration collectMenuDeclarations(): Set {
    var menuDeclarations = new Set();
    for (declaration : Any in self.members) {
        if (declaration.isTypeOf(JSL!ActorLinkDeclaration)) {
            menuDeclarations.add(declaration);
        } else if (declaration.isTypeOf(JSL!ActorGroupDeclaration)) {
            menuDeclarations.addAll(declaration.collectMenuDeclarations());
        }
    }
    return menuDeclarations;
}
judo-tatami-jsl-jsl2ui/src/main/epsilon/operations/jsl/data/transferFieldDeclaration.eol (1)

Line range hint 48-56:
Fix typo in error message.

There is a typo in the error message.

- throw "Could not determinate attribute type: " + s.fqName();
+ throw "Could not determine attribute type: " + s.fqName();

@noherczeg noherczeg merged commit 480eec7 into develop Jul 18, 2024
3 checks passed
@noherczeg noherczeg deleted the feature/JNG-5840-transform-relations branch July 18, 2024 22:07
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.

4 participants