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

Merged

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 Rust Exercise
  • 1 JavaScript Exercise
  1. Make a submission to both exercises as both students.
  2. As the instructor, for each exercise:
    a. Go to the plagiarism screen
    b. Click on Detect plagiarism
    c. Verify that the action finishes without errors

Note that Rust source files are detected as binary until #9350 is merged.

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

Test Coverage

Screenshots

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Added support for Rust and JavaScript programming languages.
    • Enhanced functionality for programming language features related to Rust and JavaScript.
    • Updated documentation to reflect new capabilities for 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, config-change, ready to merge

Suggested reviewers

  • JohannesWt
  • SimonEntholzer
  • coolchock
  • BBesrour
  • Jan-Thurner

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
@magaupp
Copy link
Contributor Author

magaupp commented Sep 21, 2024

@b-fein is this a test or a code review?

Copy link
Contributor

@JohannesStoehr JohannesStoehr left a comment

Choose a reason for hiding this comment

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

Code

Copy link
Contributor

@ole-ve ole-ve left a comment

Choose a reason for hiding this comment

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

Code

@github-actions github-actions bot added the plagiarism Pull requests that affect the corresponding module label Sep 30, 2024
@github-actions github-actions bot added the programming Pull requests that affect the corresponding module label Sep 30, 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: 2

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE

📥 Commits

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

📒 Files selected for processing (2)
  • build.gradle (1 hunks)
  • src/main/java/de/tum/cit/aet/artemis/programming/service/localci/LocalCIProgrammingLanguageFeatureService.java (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
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 (1)
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 (2)
build.gradle (2)

255-256: LGTM! New JPlag dependencies added as intended.

The addition of Rust and JavaScript JPlag modules aligns perfectly with the PR objectives. These new dependencies will enable plagiarism detection for Rust and JavaScript programming exercises, as intended.


255-256: Verify configuration for new JPlag languages.

While the Rust and JavaScript JPlag dependencies have been added successfully, please verify if any additional configuration is needed to fully enable support for these languages in the plagiarism detection system.

✅ Verification successful

Configuration for new JPlag languages is verified.

The ProgrammingPlagiarismDetectionService correctly includes support for Rust and JavaScript languages in the JPlag configuration.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any JPlag configuration related to language support
rg -i "jplag.*language|jplag.*rust|jplag.*javascript" --type java

Length of output: 2637


Script:

#!/bin/bash
# Extract the implementation of getJPlagProgrammingLanguage method to verify language support
ast-grep --lang java --pattern $'public Language getJPlagProgrammingLanguage($_) { $$$ }' src/main/java/de/tum/cit/aet/artemis/plagiarism/service/ProgrammingPlagiarismDetectionService.java

Length of output: 189


Script:

#!/bin/bash
# Extract the implementation of getJPlagProgrammingLanguage method to verify language support
ast-grep --lang java --pattern $'private Language getJPlagProgrammingLanguage($_) { $$$ }' src/main/java/de/tum/cit/aet/artemis/plagiarism/service/ProgrammingPlagiarismDetectionService.java

Length of output: 2524

@github-actions github-actions bot added deployment-error Added by deployment workflows if an error occured and removed deploy:artemis-test3 labels Sep 30, 2024
@EneaGore EneaGore added deploy:artemis-test3 and removed deployment-error Added by deployment workflows if an error occured labels Sep 30, 2024
@github-actions github-actions bot added deployment-error Added by deployment workflows if an error occured and removed deploy:artemis-test3 labels Sep 30, 2024
@EneaGore EneaGore added deploy:artemis-test1 and removed deployment-error Added by deployment workflows if an error occured labels Sep 30, 2024
@EneaGore EneaGore temporarily deployed to artemis-test1.artemis.cit.tum.de September 30, 2024 17:31 — with GitHub Actions Inactive
Copy link
Contributor

@EneaGore EneaGore 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 TS1 for rust and javascript. No errors encountered

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation plagiarism 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!) small
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

8 participants