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

Programming exercises: Add Rust and JavaScript to plagiarism detection #9344

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

Conversation

magaupp
Copy link
Contributor

@magaupp magaupp commented Sep 20, 2024

Checklist

General

Server

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

JPlag supports Rust and JavaScript out of the box, but plagiarism detection was not enabled in #8802 and #8859.

Description

This PR adds the Rust and JavaScript JPlag modules as a dependency and enables the feature for these languages.

Steps for Testing

Prerequisites:

  • 1 Instructor
  • 2 Students
  • 1 Programming Exercise with Complaints enabled
  1. Log in to Artemis
  2. Navigate to Course Administration
  3. ...

Exam Mode Testing

Prerequisites:

  • 1 Instructor
  • 2 Students
  • 1 Exam with a Programming Exercise
  1. Log in to Artemis
  2. Participate in the exam as a student
  3. Make sure that the UI of the programming exercise in the exam mode stays unchanged. You can use the exam mode documentation as reference.
  4. ...

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

Exam Mode Test

  • Test 1
  • Test 2

Performance Tests

  • Test 1
  • Test 2

Test Coverage

Screenshots

Summary by CodeRabbit

  • New Features

    • Added support for Rust and JavaScript programming languages.
    • Enhanced functionality for programming language features related to Rust and JavaScript.
  • Bug Fixes

    • Improved error handling for unsupported programming languages, providing clearer feedback to users.

These updates enhance the platform's versatility and usability for users working with a broader range of programming languages.

@magaupp magaupp added the small label Sep 20, 2024
@magaupp magaupp requested a review from a team as a code owner September 20, 2024 17:21
Copy link

coderabbitai bot commented Sep 20, 2024

Walkthrough

The pull request introduces support for Rust and JavaScript programming languages across various components of the project. It updates the build.gradle file to include new dependencies for these languages and modifies several service classes to handle their features and programming language detection. The changes ensure that the system can recognize and process submissions in Rust and JavaScript, enhancing its overall functionality.

Changes

File Change Summary
build.gradle Added dependencies for Rust and JavaScript: implementation "de.jplag:rust:${jplag_version}" and implementation "de.jplag:javascript:${jplag_version}".
src/main/java/de/tum/cit/aet/artemis/plagiarism/service/... Updated getJPlagProgrammingLanguage method to support Rust and JavaScript, expanded unsupported languages list.
src/main/java/de/tum/cit/aet/artemis/programming/service/gitlabci/... Modified ProgrammingLanguageFeature for Rust and JavaScript to enable a previously disabled feature by changing a boolean parameter from false to true.
src/main/java/de/tum/cit/aet/artemis/programming/service/jenkins/... Similar modification to ProgrammingLanguageFeature for Rust and JavaScript as in the GitLab CI service.
src/main/java/de/tum/cit/aet/artemis/programming/service/localci/... Updated ProgrammingLanguageFeature for Rust and JavaScript, changing the third parameter from false to true.
docs/user/exercises/programming-exercise-features.inc Updated support status for Rust and JavaScript from "no" to "yes" for a specific feature in the documentation.

Possibly related PRs

Suggested labels

tests, client, documentation, config-change, bugfix

Suggested reviewers

  • SimonEntholzer
  • BBesrour
  • iyannsch
  • edkaya
  • undernagruzez

Recent review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE

Commits

Files that changed from the base of the PR and between 014073e and 3a27a11.

Files selected for processing (1)
  • docs/user/exercises/programming-exercise-features.inc (1 hunks)
Additional comments not posted (2)
docs/user/exercises/programming-exercise-features.inc (2)

70-70: LGTM!

The change correctly updates the support status for Rust to indicate that plagiarism checks are now supported. This aligns with the PR objective.


72-72: LGTM!

The change correctly updates the support status for JavaScript to indicate that plagiarism checks are now supported. This aligns with the PR objective.


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.

@github-actions github-actions bot added the server Pull requests that update Java code. (Added Automatically!) label Sep 20, 2024
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: 1

Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE

Commits

Files that changed from the base of the PR and between 0354197 and 014073e.

Files selected for processing (5)
  • build.gradle (1 hunks)
  • src/main/java/de/tum/cit/aet/artemis/plagiarism/service/ProgrammingPlagiarismDetectionService.java (2 hunks)
  • src/main/java/de/tum/cit/aet/artemis/programming/service/gitlabci/GitLabCIProgrammingLanguageFeatureService.java (1 hunks)
  • src/main/java/de/tum/cit/aet/artemis/programming/service/jenkins/JenkinsProgrammingLanguageFeatureService.java (1 hunks)
  • src/main/java/de/tum/cit/aet/artemis/programming/service/localci/LocalCIProgrammingLanguageFeatureService.java (1 hunks)
Additional context used
Path-based instructions (4)
src/main/java/de/tum/cit/aet/artemis/plagiarism/service/ProgrammingPlagiarismDetectionService.java (1)

Pattern src/main/java/**/*.java: naming:CamelCase; principles:{single_responsibility,small_methods,no_duplication}; db:{perf_queries,datetime_not_timestamp}; rest:{stateless,singleton,delegate_logic,http_only,minimal_dtos}; dtos:{java_records,no_entities,min_data,single_resp}; di:constructor_injection; kiss:simple_code; file_handling:os_indep_paths; practices:{least_access,avoid_transactions,code_reuse,static_member_ref,prefer_primitives}; sql:{param_annotation,uppercase,avoid_subqueries};java:avoid_star_imports

src/main/java/de/tum/cit/aet/artemis/programming/service/gitlabci/GitLabCIProgrammingLanguageFeatureService.java (1)

Pattern src/main/java/**/*.java: naming:CamelCase; principles:{single_responsibility,small_methods,no_duplication}; db:{perf_queries,datetime_not_timestamp}; rest:{stateless,singleton,delegate_logic,http_only,minimal_dtos}; dtos:{java_records,no_entities,min_data,single_resp}; di:constructor_injection; kiss:simple_code; file_handling:os_indep_paths; practices:{least_access,avoid_transactions,code_reuse,static_member_ref,prefer_primitives}; sql:{param_annotation,uppercase,avoid_subqueries};java:avoid_star_imports

src/main/java/de/tum/cit/aet/artemis/programming/service/jenkins/JenkinsProgrammingLanguageFeatureService.java (1)

Pattern src/main/java/**/*.java: naming:CamelCase; principles:{single_responsibility,small_methods,no_duplication}; db:{perf_queries,datetime_not_timestamp}; rest:{stateless,singleton,delegate_logic,http_only,minimal_dtos}; dtos:{java_records,no_entities,min_data,single_resp}; di:constructor_injection; kiss:simple_code; file_handling:os_indep_paths; practices:{least_access,avoid_transactions,code_reuse,static_member_ref,prefer_primitives}; sql:{param_annotation,uppercase,avoid_subqueries};java:avoid_star_imports

src/main/java/de/tum/cit/aet/artemis/programming/service/localci/LocalCIProgrammingLanguageFeatureService.java (1)

Pattern src/main/java/**/*.java: naming:CamelCase; principles:{single_responsibility,small_methods,no_duplication}; db:{perf_queries,datetime_not_timestamp}; rest:{stateless,singleton,delegate_logic,http_only,minimal_dtos}; dtos:{java_records,no_entities,min_data,single_resp}; di:constructor_injection; kiss:simple_code; file_handling:os_indep_paths; practices:{least_access,avoid_transactions,code_reuse,static_member_ref,prefer_primitives}; sql:{param_annotation,uppercase,avoid_subqueries};java:avoid_star_imports

Learnings (3)
src/main/java/de/tum/cit/aet/artemis/programming/service/gitlabci/GitLabCIProgrammingLanguageFeatureService.java (1)
Learnt from: magaupp
PR: ls1intum/Artemis#8802
File: src/main/java/de/tum/in/www1/artemis/service/connectors/gitlabci/GitLabCIProgrammingLanguageFeatureService.java:24-24
Timestamp: 2024-06-29T14:49:34.001Z
Learning: Static code analysis for Rust in GitLab CI will be added in a follow-up PR.
src/main/java/de/tum/cit/aet/artemis/programming/service/jenkins/JenkinsProgrammingLanguageFeatureService.java (1)
Learnt from: magaupp
PR: ls1intum/Artemis#8802
File: src/main/java/de/tum/in/www1/artemis/service/connectors/jenkins/JenkinsProgrammingLanguageFeatureService.java:43-43
Timestamp: 2024-06-29T14:47:20.796Z
Learning: Jenkins support for Rust was added in commit d0fb7032e70c001dc8b2c4d0a391ca8bf7e7d586.
src/main/java/de/tum/cit/aet/artemis/programming/service/localci/LocalCIProgrammingLanguageFeatureService.java (1)
Learnt from: magaupp
PR: ls1intum/Artemis#8802
File: src/main/java/de/tum/in/www1/artemis/service/connectors/gitlabci/GitLabCIProgrammingLanguageFeatureService.java:24-24
Timestamp: 2024-06-29T14:49:34.001Z
Learning: Static code analysis for Rust in GitLab CI will be added in a follow-up PR.
Additional comments not posted (8)
src/main/java/de/tum/cit/aet/artemis/programming/service/gitlabci/GitLabCIProgrammingLanguageFeatureService.java (2)

28-28: LGTM!

The change to enable a specific feature for the Rust programming language is consistent with the PR objective of enabling plagiarism detection for Rust. Based on the learning, it's likely that the feature being enabled is static code analysis, which is a positive change.


29-29: LGTM!

The change to enable a specific feature for the JavaScript programming language is consistent with the PR objective of enabling plagiarism detection for JavaScript. This is a positive change that is unlikely to have any negative impact on the functionality or performance of the system.

src/main/java/de/tum/cit/aet/artemis/programming/service/jenkins/JenkinsProgrammingLanguageFeatureService.java (2)

44-44: LGTM!

The change to enable plagiarism detection for Rust is consistent with the PR objective and is supported by Jenkins.


45-45: LGTM!

The change to enable plagiarism detection for JavaScript is consistent with the PR objective and is supported by JPlag.

src/main/java/de/tum/cit/aet/artemis/programming/service/localci/LocalCIProgrammingLanguageFeatureService.java (2)

51-51: Verify the new feature for RUST is thoroughly tested.

The change looks good and enables a new feature for the RUST programming language. Please ensure that the new feature is thoroughly tested and does not introduce any regressions.


52-52: Verify the new feature for JAVASCRIPT is thoroughly tested.

The change looks good and enables a new feature for the JAVASCRIPT programming language. Please ensure that the new feature is thoroughly tested and does not introduce any regressions.

build.gradle (2)

255-255: LGTM!

The dependency for the Rust module of JPlag is correctly added, enabling plagiarism detection for Rust programming exercises.


256-256: LGTM!

The dependency for the JavaScript module of JPlag is correctly added, enabling plagiarism detection for JavaScript programming exercises.

coderabbitai[bot]
coderabbitai bot previously approved these changes Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation ready for review server Pull requests that update Java code. (Added Automatically!) small
Projects
Status: Ready For Review
Development

Successfully merging this pull request may close these issues.

2 participants