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

Modeling Exercises: Refactor Feedback Reference (#354) #354

Merged
merged 17 commits into from
Dec 8, 2024

Conversation

LeonWehrhahn
Copy link
Contributor

@LeonWehrhahn LeonWehrhahn commented Nov 16, 2024

Motivation and Context

This PR introduces two changes:

  1. Simplified Feedback Schema: The feedback schema has been simplified by replacing the list of element_ids with a single reference field. This change avoids unnecessary conversions on the Artemis side and aligns the reference format with how manual references are handled in Artemis.

  2. Enabled Detailed Element Referencing: Previously, feedback could only reference entire elements. With this update, feedback can now reference specific attributes, methods within elements and also references between elements.

Description

1. Simplified Feedback Schema

  • Updated Data Models: Modified the DBModelingFeedback and ModelingFeedback models to replace the element_ids field with a reference field that accepts a single string in the format elementType:elementId (e.g., ClassAttribute:5a337bdf-da00-4bd0-a6f0-78ba5b84330e).

2. Enabled Detailed Element Referencing

  • Enhanced Parsers and Transformers:

    • Updated the ApollonJSONTransformer and its parsers to extract IDs and types of attributes, methods, and relations.
    • Modified the Element and UMLParser classes to support detailed mapping between element names and their IDs/types.
  • Adjusted Prompts and Utility Functions:

    • Updated the feedback generation prompt to instruct the LLM to reference specific attributes, methods, and relations using the new format.
    • Modified utility functions like convert_to_athana_feedback_model and get_exercise_model to handle the new reference field and support the enhanced referencing capabilities.

Steps for Testing

  1. API Testing:

    • Make direct API calls to the /feedback_suggestions endpoint of the module.
    • Use submissions that include classes with attributes, methods, and relations.
  2. Verify Feedback Generation:

    • Ensure that feedback is generated correctly without errors.
    • Check that the feedback includes the new reference field in the format elementType:elementId.
  3. Check Granular Referencing:

    • Verify that feedback can reference specific attributes, methods, and relations.
      • For example, feedback might reference ClassAttribute:[attribute-id] or ClassMethod:[method-id].

Testserver States

Note

These badges show the state of the test servers.
Green = Currently available, Red = Currently locked
Click on the badges to get to the test servers.


Screenshots

Example of how attribute and method referencing is displayed in the feedback UI on Artemis:
image

@github-actions github-actions bot removed the deploy:athena-test1 Athena Test Server 1 label Nov 16, 2024
@LeonWehrhahn LeonWehrhahn added the deploy:athena-test1 Athena Test Server 1 label Nov 16, 2024
@github-actions github-actions bot added the lock:athena-test1 Is currently deployed to Athena Test Server 1 label Nov 16, 2024
@LeonWehrhahn LeonWehrhahn temporarily deployed to athena-test1.ase.cit.tum.de November 16, 2024 19:02 — with GitHub Actions Inactive
@github-actions github-actions bot removed the deploy:athena-test1 Athena Test Server 1 label Nov 16, 2024
@LeonWehrhahn LeonWehrhahn added deploy:athena-test1 Athena Test Server 1 and removed lock:athena-test1 Is currently deployed to Athena Test Server 1 labels Nov 18, 2024
@github-actions github-actions bot removed the deploy:athena-test1 Athena Test Server 1 label Nov 18, 2024
Copy link

⚠️ Unable to deploy to test servers ⚠️

The docker build needs to run through before deploying.

@github-actions github-actions bot added the deployment-error Added by deployment workflows if an error occured label Nov 18, 2024
@LeonWehrhahn LeonWehrhahn changed the title Refactor feedback reference Refactor Feedback Reference Nov 18, 2024
@LeonWehrhahn LeonWehrhahn added deploy:athena-test1 Athena Test Server 1 and removed deployment-error Added by deployment workflows if an error occured labels Nov 19, 2024
@LeonWehrhahn LeonWehrhahn temporarily deployed to athena-test1.ase.cit.tum.de November 19, 2024 10:07 — with GitHub Actions Inactive
@github-actions github-actions bot added lock:athena-test1 Is currently deployed to Athena Test Server 1 and removed deploy:athena-test1 Athena Test Server 1 labels Nov 19, 2024
@github-actions github-actions bot removed the lock:athena-test1 Is currently deployed to Athena Test Server 1 label Nov 22, 2024
DominikRemo
DominikRemo previously approved these changes Nov 24, 2024
Copy link
Contributor

@DominikRemo DominikRemo left a comment

Choose a reason for hiding this comment

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

Code LGTM

@LeonWehrhahn LeonWehrhahn added deploy:athena-test1 Athena Test Server 1 and removed lock:athena-test1 Is currently deployed to Athena Test Server 1 labels Dec 3, 2024
@LeonWehrhahn LeonWehrhahn temporarily deployed to athena-test1.ase.cit.tum.de December 3, 2024 10:37 — with GitHub Actions Inactive
@github-actions github-actions bot removed the deploy:athena-test1 Athena Test Server 1 label Dec 3, 2024
@LeonWehrhahn LeonWehrhahn added the deploy:athena-test1 Athena Test Server 1 label Dec 3, 2024
@github-actions github-actions bot added the lock:athena-test1 Is currently deployed to Athena Test Server 1 label Dec 3, 2024
@LeonWehrhahn LeonWehrhahn temporarily deployed to athena-test1.ase.cit.tum.de December 3, 2024 10:43 — with GitHub Actions Inactive
@github-actions github-actions bot removed the deploy:athena-test1 Athena Test Server 1 label Dec 3, 2024
@LeonWehrhahn LeonWehrhahn added deploy:athena-test1 Athena Test Server 1 and removed lock:athena-test1 Is currently deployed to Athena Test Server 1 labels Dec 3, 2024
@LeonWehrhahn LeonWehrhahn temporarily deployed to athena-test1.ase.cit.tum.de December 3, 2024 16:28 — with GitHub Actions Inactive
@github-actions github-actions bot added lock:athena-test1 Is currently deployed to Athena Test Server 1 and removed deploy:athena-test1 Athena Test Server 1 labels Dec 3, 2024
@LeonWehrhahn LeonWehrhahn added deploy:athena-test1 Athena Test Server 1 and removed lock:athena-test1 Is currently deployed to Athena Test Server 1 labels Dec 3, 2024
@github-actions github-actions bot added lock:athena-test1 Is currently deployed to Athena Test Server 1 and removed deploy:athena-test1 Athena Test Server 1 labels Dec 3, 2024
@@ -11,7 +11,8 @@
class DBModelingFeedback(DBFeedback, Base):
__tablename__ = "modeling_feedbacks"

element_ids: Optional[list[str]] = Column(JSON) # type: ignore
element_ids: Optional[list[str]] = Column(JSON) # type: ignore
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a todo comment to remove that in the future?

athena/athena/schemas/modeling_feedback.py Outdated Show resolved Hide resolved
@maximiliansoelch maximiliansoelch changed the title Refactor Feedback Reference Modeling Exercises: Refactor Feedback Reference (#354) Dec 8, 2024
@maximiliansoelch maximiliansoelch merged commit a71756d into develop Dec 8, 2024
16 checks passed
@maximiliansoelch maximiliansoelch deleted the feature/modeling/reference branch December 8, 2024 15:53
@github-actions github-actions bot removed the lock:athena-test1 Is currently deployed to Athena Test Server 1 label Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants