Conversation
WalkthroughAdds a SchemaConverter that centralizes normalization of Apollon schemas (v2/v3/v4) into v3 and updates the transformer to use it; switches the playground Apollon dependency and client-side dynamic imports/CSS; adds an example exercise JSON; updates two Dockerfiles (one adds a redundant poetry install, the other bumps protobuf-dev); and adjusts playground viewer/submission components and props handling. Changes
Sequence DiagramsequenceDiagram
participant Client
participant Transformer as apollon_json_transformer
participant Converter as SchemaConverter
participant Parser as Apollon (importDiagram / editor)
Client->>Transformer: transform_json(model_dict)
Transformer->>Converter: normalize_to_v3(model_dict)
alt input is v3
Converter-->>Transformer: v3 schema
else input is v2
Converter-->>Transformer: convert_v2_to_v3 -> v3 schema
else input is v4
Converter-->>Transformer: convert_v4_to_v3 -> v3 schema
end
Transformer->>Parser: importDiagram(v3 schema) / create editor model
Parser-->>Transformer: parsed/editor model
Transformer-->>Client: transformed/parsed result
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🔇 Additional comments (1)
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. Comment |
Athena Test Results Summary
Failing Tests Summary
|
||||||||||||||
📊 Detailed Coverage TableCombining 3 coverage files... 📊 Combined Coverage Summary:
Total packages: 31 Note: Coverage thresholds: ✅ (≥70%), ❌ (<70%) |
Athena: Support Apollon v4 model
Athena Test Results Summary
Failing Tests Summary
|
||||||||||||||
📊 Detailed Coverage TableCombining 3 coverage files... 📊 Combined Coverage Summary:
Total packages: 31 Note: Coverage thresholds: ✅ (≥70%), ❌ (<70%) |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
athena/modules/modeling/module_modeling_llm/Dockerfile(1 hunks)athena/modules/modeling/module_modeling_llm/module_modeling_llm/apollon_transformer/apollon_json_transformer.py(3 hunks)athena/modules/modeling/module_modeling_llm/module_modeling_llm/apollon_transformer/schema_converter.py(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
athena/modules/modeling/module_modeling_llm/module_modeling_llm/apollon_transformer/apollon_json_transformer.py (1)
athena/modules/modeling/module_modeling_llm/module_modeling_llm/apollon_transformer/schema_converter.py (2)
SchemaConverter(9-187)normalize_to_v3(171-187)
🪛 Ruff (0.14.3)
athena/modules/modeling/module_modeling_llm/module_modeling_llm/apollon_transformer/schema_converter.py
95-95: Unnecessary key check before dictionary access
Replace with dict.get
(RUF019)
113-113: Unnecessary key check before dictionary access
Replace with dict.get
(RUF019)
| if "attributes" in node_data and node_data["attributes"]: | ||
| attribute_ids: list[str] = [] | ||
| for attr in node_data["attributes"]: | ||
| attr_id = attr.get("id", f"{element_id}_attr_{len(attribute_ids)}") | ||
| attribute_ids.append(attr_id) | ||
|
|
||
| # Create separate attribute element | ||
| v3_data["elements"][attr_id] = { | ||
| "id": attr_id, | ||
| "name": attr.get("name", ""), | ||
| "type": "ClassAttribute", | ||
| "owner": element_id, | ||
| "bounds": {"x": 0, "y": 0, "width": 0, "height": 0} | ||
| } | ||
|
|
||
| element["attributes"] = attribute_ids | ||
|
|
||
| # Handle methods (convert from embedded objects to ID references) | ||
| if "methods" in node_data and node_data["methods"]: | ||
| method_ids: list[str] = [] | ||
| for method in node_data["methods"]: | ||
| method_id = method.get("id", f"{element_id}_method_{len(method_ids)}") | ||
| method_ids.append(method_id) | ||
|
|
||
| # Create separate method element | ||
| v3_data["elements"][method_id] = { | ||
| "id": method_id, | ||
| "name": method.get("name", ""), | ||
| "type": "ClassMethod", | ||
| "owner": element_id, | ||
| "bounds": {"x": 0, "y": 0, "width": 0, "height": 0} | ||
| } | ||
|
|
There was a problem hiding this comment.
Preserve attribute/method metadata during v4 → v3 conversion
Line 102 and Line 120 currently create placeholder ClassAttribute/ClassMethod elements that keep nothing but the name. Apollon v4 attribute/method objects include metadata such as visibility, type, static, parameters, and returnType, and UMLParser depends on those fields to render correct notation. Dropping everything but the name means diagrams like + foo(): String collapse to plain foo, so feedback produced from v4 payloads will be wrong. Please merge the original attribute/method dictionaries into the converted elements instead of discarding their contents.
@@
- v3_data["elements"][attr_id] = {
- "id": attr_id,
- "name": attr.get("name", ""),
- "type": "ClassAttribute",
- "owner": element_id,
- "bounds": {"x": 0, "y": 0, "width": 0, "height": 0}
- }
+ attr_element = attr.copy()
+ attribute_type = attr_element.pop("type", None)
+ attr_element.update({
+ "id": attr_id,
+ "type": "ClassAttribute",
+ "owner": element_id,
+ "bounds": attr_element.get(
+ "bounds", {"x": 0, "y": 0, "width": 0, "height": 0}
+ ),
+ })
+ if attribute_type is not None:
+ attr_element["attributeType"] = attribute_type
+ v3_data["elements"][attr_id] = attr_element
@@
- v3_data["elements"][method_id] = {
- "id": method_id,
- "name": method.get("name", ""),
- "type": "ClassMethod",
- "owner": element_id,
- "bounds": {"x": 0, "y": 0, "width": 0, "height": 0}
- }
+ method_element = method.copy()
+ method_kind = method_element.pop("type", None)
+ method_element.update({
+ "id": method_id,
+ "type": "ClassMethod",
+ "owner": element_id,
+ "bounds": method_element.get(
+ "bounds", {"x": 0, "y": 0, "width": 0, "height": 0}
+ ),
+ })
+ if method_kind is not None:
+ method_element["methodKind"] = method_kind
+ v3_data["elements"][method_id] = method_element🧰 Tools
🪛 Ruff (0.14.3)
95-95: Unnecessary key check before dictionary access
Replace with dict.get
(RUF019)
113-113: Unnecessary key check before dictionary access
Replace with dict.get
(RUF019)
🤖 Prompt for AI Agents
In
athena/modules/modeling/module_modeling_llm/module_modeling_llm/apollon_transformer/schema_converter.py
around lines 95 to 127, the converter currently creates placeholder
ClassAttribute/ClassMethod elements containing only id, name, type, owner and
bounds, dropping all original attribute/method metadata; update the conversion
to merge the original attribute/method dict into the new element so fields like
visibility, type, static, parameters and returnType are preserved (while still
ensuring id, name, type, owner and bounds are set/overridden as needed), i.e.
construct the v3 element by taking the original dict and then enforcing/adding
the required keys (id, type -> ClassAttribute/ClassMethod, owner, bounds) before
assigning into v3_data["elements"] and keep
element["attributes"]/element["methods"] as the ID lists.
FelixTJDietrich
left a comment
There was a problem hiding this comment.
Code looks good and also was tested with Artemis via test server
| # Project files | ||
| COPY . ./ | ||
|
|
||
| RUN poetry install --no-interaction --no-ansi |
There was a problem hiding this comment.
Not sure if this is necessary but it fixed a build issue
Athena Test Results Summary
Failing Tests Summary
|
||||||||||||||
📊 Detailed Coverage TableCombining 3 coverage files... 📊 Combined Coverage Summary:
Total packages: 31 Note: Coverage thresholds: ✅ (≥70%), ❌ (<70%) |
|
There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions. |
|
There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions. |
Athena Test Results Summary
Failing Tests Summary
|
||||||||||||||
📊 Detailed Coverage TableCombining 3 coverage files... 📊 Combined Coverage Summary:
Total packages: 31 Note: Coverage thresholds: ✅ (≥70%), ❌ (<70%) |
|
There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions. |
Athena Test Results Summary
Failing Tests Summary
|
||||||||||||||
📊 Detailed Coverage TableCombining 3 coverage files... 📊 Combined Coverage Summary:
Total packages: 31 Note: Coverage thresholds: ✅ (≥70%), ❌ (<70%) |
|
There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions. |
Athena Test Results Summary
Failing Tests Summary
|
||||||||||||||
📊 Detailed Coverage TableCombining 3 coverage files... 📊 Combined Coverage Summary:
Total packages: 31 Note: Coverage thresholds: ✅ (≥70%), ❌ (<70%) |
Athena Test Results Summary
Failing Tests Summary
|
||||||||||||||
📊 Detailed Coverage TableCombining 3 coverage files... 📊 Combined Coverage Summary:
Total packages: 31 Note: Coverage thresholds: ✅ (≥70%), ❌ (<70%) |
Athena Test Results Summary
Failing Tests Summary
|
||||||||||||||
📊 Detailed Coverage TableCombining 3 coverage files... 📊 Combined Coverage Summary:
Total packages: 31 Note: Coverage thresholds: ✅ (≥70%), ❌ (<70%) |
Athena:
Support Apollon v3 and v4 model for modeling assessment
Summary by CodeRabbit
New Features
Improvements
Chores
✏️ Tip: You can customize this high-level summary in your review settings.