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

General: Improve cleanup service #9851

Merged
merged 52 commits into from
Dec 20, 2024
Merged

Conversation

coolchock
Copy link
Contributor

@coolchock coolchock commented Nov 22, 2024

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 added multiple integration tests (Spring) related to the features (with a high test coverage).
  • I added pre-authorization annotations according to the guidelines and checked the course groups for all new REST Calls (security).
  • I documented the Java code using JavaDoc style.

Client

  • Important: I implemented the changes with a very good performance, prevented too many (unnecessary) REST calls and made sure the UI is responsive, even with large data (e.g. using paging).
  • I strictly followed the principle of data economy for all client-server REST calls.
  • I strictly followed the client coding and design guidelines.
  • Following the theming guidelines, I specified colors only in the theming variable files and checked that the changes look consistent in both the light and the dark theme.
  • I added multiple integration tests (Jest) related to the features (with a high test coverage), while following the test guidelines.
  • I documented the TypeScript code using JSDoc style.
  • I added multiple screenshots/screencasts of my UI changes.
  • I translated all newly inserted strings into English and German.

Motivation and Context

This change enhances the transparency and accountability of cleanup operations within the administration interface. Previously, administrators lacked a clear overview of how many entities would be affected by a cleanup operation before execution, as well as insight into the results of the operation afterward. This feature addresses that gap by providing detailed information to administrators, ensuring they can make informed decisions and verify the outcomes of their actions.

Description

This pull request introduces a CleanupService modal that provides administrators with detailed insights into cleanup operations. The modal displays the number of entities that would be affected by a specific cleanup operation, broken down into relevant categories for better granularity. After the operation is executed, the modal updates to reflect the results, showing how many entities were successfully deleted and if any errors occurred. This feature helps administrators verify the success of the operation and troubleshoot any issues if necessary.

  • Pre-execution View: Administrators can see the total number of entities that would be impacted by a cleanup operation, categorized for clarity.
  • Post-execution Results: The modal updates to display the actual number of entities deleted

Steps for Testing

Prerequisites:

  • 1 test server with admin access (TS3)
  • 1 Admin
  1. Log in to Artemis.
  2. Navigate to Server Administration -> Cleanup Service.
  3. Select a time period and click the Execute button.
  4. Verify that the modal opens and displays the affected entries.
  5. Execute an operation where entities will be deleted.
  6. Verify that the numbers update and icons indicating success or failure are displayed.

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

Performance Review

  • I (as a reviewer) confirm that the client changes (in particular related to REST calls and UI responsiveness) are implemented with a very good performance even for very large courses with more than 2000 students.
  • I (as a reviewer) confirm that the server changes (in particular related to database calls) are implemented with a very good performance even for very large courses with more than 2000 students.

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Performance Tests

  • Test 1
  • Test 2

Screenshots

Before execution:
image

After execution:
image

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced multiple counting methods for various data types, including orphaned feedback, plagiarism comparisons, non-rated results, and submission versions.
    • Added new modal component for managing cleanup operations within the application.
    • Enhanced localization for cleanup operations with detailed tooltips and confirmation messages.
    • Introduced new endpoints for counting orphaned entities, old submission versions, and non-rated results.
    • Added a new repository for managing submission versions.
    • Implemented new DTOs for encapsulating counts related to various cleanup operations.
  • Bug Fixes

    • Improved error handling for unauthorized access to new cleanup count endpoints.
  • Documentation

    • Updated localization files to improve user guidance and operational clarity.
  • Tests

    • Expanded test coverage for new counting functionalities and modal component behavior.

@github-actions github-actions bot added server Pull requests that update Java code. (Added Automatically!) client Pull requests that update TypeScript code. (Added Automatically!) assessment Pull requests that affect the corresponding module core Pull requests that affect the corresponding module labels Nov 22, 2024
@coolchock coolchock changed the title Chore: Cleanup service improvements General: Cleanup service improvements Nov 26, 2024
Copy link

⚠️ Unable to deploy to test servers ⚠️

Testserver "artemis-test3.artemis.cit.tum.de" is already in use by PR #10026.

@github-actions github-actions bot added the deployment-error Added by deployment workflows if an error occured label Dec 19, 2024
@magaupp magaupp added deploy:artemis-test3 and removed deployment-error Added by deployment workflows if an error occured labels Dec 19, 2024
@magaupp magaupp temporarily deployed to artemis-test3.artemis.cit.tum.de December 19, 2024 17:56 — with GitHub Actions Inactive
Copy link
Contributor

@magaupp magaupp left a comment

Choose a reason for hiding this comment

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

Tested on TS3. Count of items to be deleted is correctly shown. Confirmation icon is displayed after execution. Only items of the selected time frame are deleted.
image
image

Copy link
Contributor

@florian-glombik florian-glombik left a comment

Choose a reason for hiding this comment

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

Tested on ts3

  • I generated some results with the supporting scripts
  • Delete old submission versions appears to work fine
  • Delete feedback of old rated results appears to work fine
  • I did not test the orphans
  • I did not test non related results

I have noticed that when opening Delete feedback of old rated results yields a short delay until the translations are loaded - we could add a very low priority issue for that, if it is an issue at all - considering that it is a rarely used admin feature.
It does not need to be changed within this PR

modalABitLaggy.mov

@krusche krusche changed the title General: Cleanup service improvements General: Improve cleanup service Dec 20, 2024
@krusche krusche added this to the 7.8.0 milestone Dec 20, 2024
@krusche krusche merged commit 98c0bcf into develop Dec 20, 2024
126 of 134 checks passed
@krusche krusche deleted the chore/cleanup-service-improvements branch December 20, 2024 15:54
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 client Pull requests that update TypeScript code. (Added Automatically!) core Pull requests that affect the corresponding module ready to merge server Pull requests that update Java code. (Added Automatically!) tests
Projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

9 participants