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

Iris: Display ingestion state for lecture slide upload #9090

Merged
merged 141 commits into from
Nov 29, 2024

Conversation

yassinsws
Copy link
Contributor

@yassinsws yassinsws commented Jul 19, 2024

Motivation and Context

For Now we send a lecture for ingestion but there is no other UI that shows the state of the Ingestion. That's why this PR is created to add the Ingestion States for Lectures and Lecture Units.

Description

I added one column in the manage lectures view that shows whether a lecture is ingested and what is it's State.
I added a button to ingest one lecture Unit manually that also shows the ingestion State of the lecture unit.

Checklist

General

Server

  • Important: I implemented the changes with a very good performance and prevented too many (unnecessary) 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.
  • 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 added authorities to all new routes and checked the course groups for displaying navigation elements (links, buttons).
  • 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.

Screenshots :
Lecture Management view:
image
In case Pyris is Down the Ingestion State will give an error:
image

Lecture Unit View:
image
In case Pyris is Down all lecture units will display an error:
image

Steps for Testing

Prerequisites:

  • 1 Instructor
  • 1 Course with Iris Lecture ingestion enabled
  1. Log in to Artemis
  2. Navigate to Course Administration to enable Iris Lecture Ingestion
  3. Upload an AttachmentUnit ( the pdf file attached here should do)
  4. Send One Attachment Unit to Ingestion
  5. The Icon Should change according to the phase it is in when you refresh the page.
  6. Check if the Ingestion State is shown on the client side.
    blankpdf.pdf

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
  • I (as a reviewer) confirm that the server changes (in particular related to database calls) are implemented with a very good performance

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Test Coverage

Client

Class/File Line Coverage Confirmation (assert/expect)
attachmentUnit.model.ts 100%
lecture.model.ts 100%
lecture-unit-management.component.ts 84.61%
lecture.component.ts 93.27%
lecture.service.ts 97.08%
course-overview.service.ts 92.64%

Server

Could not generate code coverage here due to flaky tests failing constantly.

Client

Class/File Line Coverage Confirmation (assert/expect)
attachmentUnit.model.ts 100%
lecture.model.ts 100%
lecture-unit-management.component.ts 90.9%
lectureUnit.service.ts 63.29%
lecture.component.ts 93.27%
lecture.service.ts 97.08%
course-overview.service.ts 92.64%

Server

|------------|--------------:|---------------------:|
| PyrisWebhookService.java | 82% | ✅ |
| LectureRepository.java | 86% | ✅ |
| LectureService.java | 100% | ✅ |
| LectureUnitService.java | 83% | ✅ |
| LectureResource.java | 90% | ✅ |
| LectureUnitResource.java | 80% | ✅ |

Summary by CodeRabbit

  • New Features

    • Introduced ingestion state management for attachment units, enhancing tracking during the ingestion process.
    • Added functionality for directly ingesting lecture units and managing lecture state retrieval through new API endpoints.
    • Improved error handling in webhook services, allowing for better management of ingestion states and failures.
  • Bug Fixes

    • Streamlined response handling in lecture ingestion methods to ensure consistent feedback.
  • Refactor

    • Simplified method signatures and logic across various services for improved clarity and maintainability.
  • Tests

    • Expanded test coverage for ingestion processes, ensuring robust error handling and state management.

yassinsws added 4 commits July 9, 2024 13:30
…tionStateUI

# Conflicts:
#	src/main/java/de/tum/in/www1/artemis/web/rest/lecture/LectureUnitResource.java
#	src/main/webapp/app/lecture/lecture-unit/lecture-unit-management/lectureUnit.service.ts
#	src/test/java/de/tum/in/www1/artemis/iris/PyrisLectureIngestionTest.java
@yassinsws yassinsws requested a review from a team as a code owner July 19, 2024 15:04
@yassinsws yassinsws self-assigned this Jul 19, 2024
@github-actions github-actions bot added tests server Pull requests that update Java code. (Added Automatically!) client Pull requests that update TypeScript code. (Added Automatically!) database Pull requests that update the database. (Added Automatically!). Require a CRITICAL deployment. labels Jul 19, 2024
Copy link

coderabbitai bot commented Jul 19, 2024

Walkthrough

The recent changes enhance the ingestion management system within the application by introducing structured state tracking for attachment units and related entities. Key improvements include the addition of a pyrisIngestionState field, modifications to service methods for improved error handling, and the introduction of new methods for managing lecture unit ingestion and status retrieval.

Changes

Files Change Summary
src/main/java/.../AttachmentUnit.java Introduced pyrisIngestionState field with getter/setter methods for tracking ingestion states.
src/main/java/.../LectureService.java Modified ingestLecturesInPyris method to return void instead of boolean, focusing on execution without feedback.
src/main/java/.../LectureUnitService.java Added ingestLectureUnitInPyris method for handling individual lecture unit ingestion.
src/main/java/.../PyrisConnectorService.java Enhanced webhook handling with method renaming and improved error management. Added methods for retrieving ingestion states.
src/main/java/.../PyrisWebhookService.java Updated to manage AttachmentUnit states and modified method signatures for improved job status updates.
src/main/java/.../PublicPyrisStatusUpdateResource.java Introduced new methods for retrieving ingestion states of lectures and lecture units, with error handling.
src/test/javascript/spec/component/lecture-unit/lecture-unit-management.component.spec.ts Updated tests to include new services and validate ingestion handling logic, ensuring robust test coverage for new functionalities.
src/test/javascript/spec/component/lecture/lecture.component.spec.ts Removed references to IrisSettingsService and updated method names to reflect changes in the LectureService.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant LectureUnitResource
    participant LectureUnitService
    participant PyrisConnectorService

    User->>LectureUnitResource: Trigger ingestLectureUnit
    LectureUnitResource->>LectureUnitService: ingestLectureUnitInPyris(lectureUnitId)
    LectureUnitService->>PyrisConnectorService: addLectureUnitToPyrisDB(lectureUnit)
    PyrisConnectorService-->>LectureUnitService: Acknowledge ingestion
    LectureUnitService-->>LectureUnitResource: Return success response
    LectureUnitResource-->>User: Display success notification
Loading
sequenceDiagram
    participant User
    participant LectureUnitManagementComponent

    User->>LectureUnitManagementComponent: Click ingest button
    LectureUnitManagementComponent->>LectureUnitManagementComponent: updateIngestionStates()
    LectureUnitManagementComponent->>PyrisConnectorService: getLectureUnitIngestionState(lectureUnitId)
    PyrisConnectorService-->>LectureUnitManagementComponent: Return ingestion state
    LectureUnitManagementComponent-->>User: Update UI with new state
Loading

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:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 using 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.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

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.

coderabbitai[bot]

This comment was marked as abuse.

coderabbitai[bot]

This comment was marked as abuse.

coderabbitai[bot]

This comment was marked as abuse.

coderabbitai[bot]

This comment was marked as outdated.

coderabbitai[bot]

This comment was marked as outdated.

coderabbitai[bot]

This comment was marked as outdated.

coderabbitai[bot]

This comment was marked as outdated.

coderabbitai[bot]
coderabbitai bot previously approved these changes Jul 21, 2024
sachmii
sachmii previously approved these changes Nov 19, 2024
@github-actions github-actions bot added the programming Pull requests that affect the corresponding module label Nov 29, 2024
coderabbitai[bot]
coderabbitai bot previously approved these changes Nov 29, 2024
@bassner bassner merged commit 9270bc0 into develop Nov 29, 2024
32 of 36 checks passed
@bassner bassner deleted the feature/iris/AddIngestionStateUI branch November 29, 2024 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client Pull requests that update TypeScript code. (Added Automatically!) core Pull requests that affect the corresponding module iris Pull requests that affect the corresponding module lecture Pull requests that affect the corresponding module programming 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.