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

Development: Add Atlas Profile with optionally autowired Atlas Java API #9936

Open
wants to merge 35 commits into
base: develop
Choose a base branch
from

Conversation

ole-ve
Copy link
Contributor

@ole-ve ole-ve commented Dec 3, 2024

Breaking Change: atlas profile needs to be enabled after merging this PR. Otherwise, all atlas-related functionality is disabled (client & server).

Checklist

General

Server

  • Important: I implemented the changes with a very good performance and prevented too many (unnecessary) and too complex database calls.
  • I strictly followed the principle of data economy for all database calls.
  • I strictly followed the server coding and design guidelines.
  • I documented the Java code using JavaDoc style.

Changes affecting Programming Exercises

  • High priority: I tested all changes and their related features with all corresponding user types on a test server configured with the integrated lifecycle setup (LocalVC and LocalCI).
  • I tested all changes and their related features with all corresponding user types on a test server configured with Gitlab and Jenkins.

Motivation and Context

To allow starting Artemis without atlas, we would need to optionally autowire the atlas Java APIs introduced in !9752.

Description

For this, we need to add a new Spring profile specific to atlas (PROFILE_ATLAS) and pass in the atlas Java APIs as Optionals to the Spring components constructor. Depending on whether the call is crucially required, an ApiNotPresentException is thrown. This, for instance, is not required when updating the competency progress (asynchronously).

I have tested the following reasons for data inconsistencies:

  • Initials start without atlas

    • Still creates the DB tables, but Java migrations are skipped.
  • Task created

    • Competencies linked, learning path generated for user, task evaluated.
    • Without profile: Task deleted.
    • With profile: Restart without issues, no residuals in the learning path.
      • Competency progress, however, remains.
      • Atlas entities still exist in the DB.
  • Lecture with unit created

    • Competencies linked, learning path generated for user.
    • Without profile: Lecture deleted.
    • With profile: Restart without issues, no residuals in the learning path.
      • Atlas entities still exist in the DB.
  • With profile: Course created

    • Linked lecture units and learning path enabled, student participated, path generated, tasks evaluated.
    • Without profile: Course deleted.
    • With profile: All related objects removed from the DB.

Steps for Testing

These changes need to be tested locally OR on test server 3.

  1. Start the server with the Atlas profile enabled ("atlas" should be part of your run config, e.g. Artemis__Server_.xml), changes as part of this PR.
  2. Create a course with learning paths enabled.
  3. Create any resource that are related to atlas (exercises, lecture units, competencies, etc.)
  4. Participate in the course as a student, generate the learning path and create participations for lecture units/exercises
  5. Restart the server without the Atlas profile by removing it from your run config (see step 1)
  6. Delete the lecture units and exercise
  7. Start with Atlas profile enabled and verify that everything works as expected
  8. Restart without atlas profile
  9. Delete the course
  10. Restart with atlas profile. Verify that everything still works

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.







Review Progress

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Integrated a new "Atlas" competency management system that enhances course management functionalities. Instructors will now see additional options for managing competencies and learning paths.
  • Documentation

    • Updated the setup guides and configuration instructions to reflect the inclusion of the Atlas profile in the default deployment.
    • Enhanced the user documentation for various services to clarify the new profile configurations and their implications.
  • Refactor

    • Improved overall system robustness and error handling by conditionally enabling features, ensuring a smoother user experience.
    • Updated several services and resources to handle optional dependencies, enhancing error handling and preventing potential runtime exceptions.

These enhancements aim to provide a more streamlined and feature-rich course management experience for end-users.

@github-actions github-actions bot added tests server Pull requests that update Java code. (Added Automatically!) documentation assessment Pull requests that affect the corresponding module atlas Pull requests that affect the corresponding module core Pull requests that affect the corresponding module exercise Pull requests that affect the corresponding module fileupload Pull requests that affect the corresponding module iris Pull requests that affect the corresponding module lecture Pull requests that affect the corresponding module modeling Pull requests that affect the corresponding module programming Pull requests that affect the corresponding module quiz Pull requests that affect the corresponding module text Pull requests that affect the corresponding module labels Dec 3, 2024
@ole-ve ole-ve marked this pull request as ready for review December 3, 2024 13:15
@ole-ve ole-ve requested a review from a team as a code owner December 3, 2024 13:15
AjayvirS
AjayvirS previously approved these changes Feb 8, 2025
Copy link
Contributor

@AjayvirS AjayvirS left a comment

Choose a reason for hiding this comment

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

Tested locally, works as expected with Atlas disabled

coolchock
coolchock previously approved these changes Feb 8, 2025
Copy link
Contributor

@coolchock coolchock left a comment

Choose a reason for hiding this comment

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

tested locally, works as described

cremertim
cremertim previously approved these changes Feb 9, 2025
Copy link
Contributor

@cremertim cremertim left a comment

Choose a reason for hiding this comment

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

tested loclly according to the testing steps. Works as expected

Copy link
Contributor

@tobias-lippert tobias-lippert left a comment

Choose a reason for hiding this comment

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

I think I found one unintended change.
Otherwise, I just have two questions.

@ole-ve ole-ve requested a review from tobias-lippert February 9, 2025 17:59
tobias-lippert
tobias-lippert previously approved these changes Feb 9, 2025
Copy link
Contributor

@tobias-lippert tobias-lippert left a comment

Choose a reason for hiding this comment

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

Thanks for answering my questions. LGTM now.

az108
az108 previously approved these changes Feb 10, 2025
Copy link
Contributor

@az108 az108 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 👍

@helios-aet helios-aet bot temporarily deployed to artemis-test3.artemis.cit.tum.de February 10, 2025 17:26 Inactive
MaximilianAnzinger

This comment was marked as outdated.

Copy link
Collaborator

@MaximilianAnzinger MaximilianAnzinger left a comment

Choose a reason for hiding this comment

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

The coverage fails. There seems to be one new class that has 0 Coverage and thus it fails the complete verification. Please adjust the threshold.

@ole-ve ole-ve added ready to merge maintainer-approved The feature maintainer has approved the PR and removed ready for review labels Feb 11, 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: 0

🧹 Nitpick comments (1)
gradle/jacoco.gradle (1)

2-2: Consider tracking coverage improvement goals.

The TODOs indicate ambitious targets (90% instruction coverage, 0 class coverage), but there's no clear timeline or tracking mechanism. Consider:

  1. Converting these TODOs into tracked issues
  2. Creating a gradual improvement plan with milestones

Would you like me to help create a template for tracking these coverage improvement goals?

Also applies to: 4-4

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 976d1f5 and 071855e.

📒 Files selected for processing (1)
  • gradle/jacoco.gradle (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: Call Build Workflow / Build and Push Docker Image
  • GitHub Check: Call Build Workflow / Build .war artifact
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: client-tests-selected
  • GitHub Check: server-style
  • GitHub Check: client-tests
  • GitHub Check: server-tests
  • GitHub Check: Analyse
🔇 Additional comments (2)
gradle/jacoco.gradle (2)

3-3: LGTM! Gradual improvement in code coverage thresholds.

The incremental increases in coverage thresholds for both aggregated (70) and core module (18) demonstrate a commitment to improving code quality through better test coverage.

Also applies to: 11-11


213-261: LGTM! Well-structured coverage reporting with security considerations.

The implementation demonstrates good practices:

  • Secure XML parsing without DOCTYPE
  • Clear error handling and reporting
  • Informative coverage statistics output

@ole-ve
Copy link
Contributor Author

ole-ve commented Feb 11, 2025

PR is ready to merge, but depends on admins adding the atlas profiles to run configs on

  • remaining test servers
  • staging
  • production

Until then, this PR is blocked.

@helios-aet helios-aet bot temporarily deployed to artemis-test3.artemis.cit.tum.de February 13, 2025 11:10 Inactive
Copy link

@HawKhiem HawKhiem left a comment

Choose a reason for hiding this comment

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

Tested locally. Works as described

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assessment Pull requests that affect the corresponding module atlas Pull requests that affect the corresponding module client Pull requests that update TypeScript code. (Added Automatically!) core Pull requests that affect the corresponding module database Pull requests that update the database. (Added Automatically!). Require a CRITICAL deployment. documentation exercise Pull requests that affect the corresponding module fileupload Pull requests that affect the corresponding module iris Pull requests that affect the corresponding module lecture Pull requests that affect the corresponding module maintainer-approved The feature maintainer has approved the PR modeling Pull requests that affect the corresponding module programming Pull requests that affect the corresponding module quiz Pull requests that affect the corresponding module server Pull requests that update Java code. (Added Automatically!) tests text Pull requests that affect the corresponding module
Projects
Status: Ready For Review
Development

Successfully merging this pull request may close these issues.