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: Enable static code analysis for Rust with LocalCI #10328

Merged
merged 9 commits into from
Feb 18, 2025

Conversation

magaupp
Copy link
Contributor

@magaupp magaupp commented Feb 14, 2025

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 server coding and design guidelines.
  • I added multiple integration tests (Spring) related to the features (with a high test coverage).
  • 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).

Description

This PR configures Clippy with clippy-sarif to enable static code analysis for Rust.

Cargo's JSON output is preprocessed with jq because clippy-sarif doesn't handle multiple locations per issue and macro invocations correctly.

The ClippyCategorizer maps some Rust compiler lints and all Clippy lints to their lint groups.

Steps for Testing

Prerequisites:

  • 1 Instructor
  • LocalCI Server (TS1-4)
  1. Navigate to the create programming exercise view
  2. Select Rust as the language
  3. Enter a name in the General section
  4. Select advanced mode via the button on the bottom left
  5. Enable static code analysis in the Language section
  6. Enter the points in the Grading section
  7. Generate the exercise via the button on the bottom right
  8. Verify that the Template Result has 5 code issues
  9. Verify that the Solution Result has no code issues
  10. Write fn foo(bar: &Box<i32>) {} into a file of the solution repository
  11. Verify that the clippy::borrowed_box code issue is in the Solution feedback

Testserver States

You can manage test servers using Helios. Check environment statuses in the environment list. To deploy to a test server, go to the CI/CD page, find your PR or branch, and trigger the deployment.

Review Progress

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Test Coverage

Server

Class/File Line Coverage Confirmation (assert/expect)
StaticCodeAnalysisConfigurer.java 99%
StaticCodeAnalysisTool.java 100%
LocalCIProgrammingLanguageFeatureService.java 100%
ParserPolicy.java 91%
ClippyCategorizer.java 100%

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Rust programming exercises now benefit from static code analysis in the local CI environment using Clippy.
    • Enhanced analysis provides detailed, categorized feedback on code issues.
    • Introduced a new Bash script for executing static code analysis and running tests.
  • Documentation

    • Updated exercise feature documentation to reflect the new static analysis support for Rust.
  • Tests

    • Added a test for parsing Clippy tool reports, expanding test coverage for static code analysis.

@github-actions github-actions bot added tests server Pull requests that update Java code. (Added Automatically!) documentation config-change Pull requests that change the config in a way that they require a deployment via Ansible. template core Pull requests that affect the corresponding module programming Pull requests that affect the corresponding module labels Feb 14, 2025
@helios-aet helios-aet bot temporarily deployed to artemis-test2.artemis.cit.tum.de February 14, 2025 21:10 Inactive
@magaupp magaupp force-pushed the feature/programming-exercises/rust-sca branch from 6b29ddf to f7a89c0 Compare February 15, 2025 19:54
@helios-aet helios-aet bot temporarily deployed to artemis-test2.artemis.cit.tum.de February 15, 2025 20:07 Inactive
@magaupp magaupp force-pushed the feature/programming-exercises/rust-sca branch from f7a89c0 to 304c797 Compare February 15, 2025 21:52
@magaupp magaupp marked this pull request as ready for review February 15, 2025 21:53
@magaupp magaupp requested a review from a team as a code owner February 15, 2025 21:53
Copy link

coderabbitai bot commented Feb 15, 2025

Walkthrough

The changes introduce static code analysis support for Rust in the Artemis platform. Documentation now reflects that Rust is enabled in the local CI (but not in Jenkins), and the Java backend has been updated to map Rust to the Clippy analysis tool with a new categorizer. A Bash script has been added to run Rust static analysis, build, and test commands, and new test cases along with reference SARIF and JSON reports have been provided to validate the integration.

Changes

Files Change Summary
docs/.../programming-exercise-features.inc Updated Rust static code analysis support flag from no to L: yes; J: no.
src/main/java/de/.../StaticCodeAnalysisConfigurer.java,
src/main/java/de/.../StaticCodeAnalysisTool.java
Added Rust support by mapping ProgrammingLanguage.RUST to Clippy using ClippyCategorizer and introduced the new enum constant CLIPPY with its SARIF file.
src/main/java/de/.../LocalCIProgrammingLanguageFeatureService.java Enabled Rust feature flags in local CI by updating the ProgrammingLanguageFeature configuration.
src/main/java/de/.../ParserPolicy.java,
src/main/java/de/.../sarif/ClippyCategorizer.java
Integrated a new case for CLIPPY in the parser and introduced the ClippyCategorizer class to categorize Rust lint rules.
src/main/resources/templates/aeolus/rust/default_static.sh Added a new Bash script for Rust that sets up static analysis (via cargo clippy), builds the project, and runs tests.
src/test/java/de/.../StaticCodeAnalysisParserUnitTest.java,
src/test/java/de/.../ProgrammingExerciseFactory.java
Extended test coverage to include Clippy parser functionality and updated issue categorization for Rust.
src/test/resources/test-data/static-code-analysis/expected/clippy.json,
src/test/resources/test-data/static-code-analysis/reports/clippy.sarif
Introduced new test data files with expected static analysis results and a SARIF report for Clippy.

Possibly related PRs

Suggested labels

ready to merge

Suggested reviewers

  • SimonEntholzer
  • BBesrour
  • Feras797
  • ole-ve
  • krusche
  • HanyangXu0508

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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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.

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 (4)
src/test/resources/test-data/static-code-analysis/reports/clippy.sarif (1)

5-468:

❓ Verification inconclusive

Verify the completeness of test cases in the results section.

The results section provides a comprehensive set of test cases covering various Clippy lints:

  • Error level issues: unsafe code, erasing operations
  • Warning level issues: code style, performance, best practices
  • Each issue includes detailed location information and helpful suggestions

However, consider adding test cases for:

  1. Multiple locations for the same issue
  2. Macro-related issues
  3. Different severity levels for the same rule

🏁 Script executed:

#!/bin/bash
# Check if the test file covers all essential Clippy lint categories
ast-grep --pattern 'fn main() {
  $$$
  #[allow(clippy::$_)]
  $$$
}'

Length of output: 71


Action: Manual Verification Required for Additional Test Case Coverage

The SARIF report provides a solid collection of Clippy lint cases (e.g., unsafe code usage, unreachable code, dead code, needless return, etc.), covering various error and warning scenarios. However, note the following suggestions for further enhancing test coverage:

  • Multiple Locations for the Same Issue: Validate whether cases with multiple locations have been thoroughly tested.
  • Macro-Related Issues: Ensure test cases trigger lints via macros, as these might not be detected by a simple pattern search.
  • Different Severity Levels for the Same Rule: Confirm that scenarios exist where the same lint appears with varying severities.

The automated verification script did not produce any output regarding these aspects. Please manually verify the presence of these test cases or consider adding them if they are absent.

src/main/java/de/tum/cit/aet/artemis/programming/service/localci/scaparser/strategy/sarif/ClippyCategorizer.java (1)

66-837: Extensive Clippy category map

The large static map provides comprehensive coverage for Clippy lint IDs. As the mapping grows, consider loading it from an external resource (e.g., JSON, YAML) for easier maintenance and updates.

src/main/resources/templates/aeolus/rust/default_static.sh (1)

7-9: Consider adding a comment explaining the jq command.

The jq command is performing complex JSON transformations to handle macro expansions. A more detailed comment would help future maintainers understand the transformation logic.

src/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseFactory.java (1)

356-356: Consider using a more specific category from ClippyCategorizer.

The generic "Style" category might not accurately represent Clippy's actual categorization. Consider using one of the predefined categories from ClippyCategorizer.CATEGORY_NAMES for consistency with the rest of the implementation.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between e67012a and 304c797.

⛔ Files ignored due to path filters (4)
  • src/main/resources/config/application.yml is excluded by !**/*.yml
  • src/main/resources/templates/aeolus/rust/default_static.yaml is excluded by !**/*.yaml
  • src/main/resources/templates/rust/exercise/Cargo.toml is excluded by !**/*.toml
  • src/main/resources/templates/rust/solution/Cargo.toml is excluded by !**/*.toml
📒 Files selected for processing (11)
  • docs/user/exercises/programming-exercise-features.inc (1 hunks)
  • src/main/java/de/tum/cit/aet/artemis/core/config/StaticCodeAnalysisConfigurer.java (2 hunks)
  • src/main/java/de/tum/cit/aet/artemis/programming/domain/StaticCodeAnalysisTool.java (2 hunks)
  • src/main/java/de/tum/cit/aet/artemis/programming/service/localci/LocalCIProgrammingLanguageFeatureService.java (1 hunks)
  • src/main/java/de/tum/cit/aet/artemis/programming/service/localci/scaparser/strategy/ParserPolicy.java (2 hunks)
  • src/main/java/de/tum/cit/aet/artemis/programming/service/localci/scaparser/strategy/sarif/ClippyCategorizer.java (1 hunks)
  • src/main/resources/templates/aeolus/rust/default_static.sh (1 hunks)
  • src/test/java/de/tum/cit/aet/artemis/programming/StaticCodeAnalysisParserUnitTest.java (1 hunks)
  • src/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseFactory.java (1 hunks)
  • src/test/resources/test-data/static-code-analysis/expected/clippy.json (1 hunks)
  • src/test/resources/test-data/static-code-analysis/reports/clippy.sarif (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
`src/test/java/**/*.java`: test_naming: descriptive; test_si...

src/test/java/**/*.java: test_naming: descriptive; test_size: small_specific; fixed_data: true; junit5_features: true; assert_use: assertThat; assert_specificity: true; archunit_use: enforce_package_rules; db_query_count_tests: track_performance; util_service_factory_pattern: true; avoid_db_access: true; mock_strategy: static_mocks; context_restart_minimize: true

  • src/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseFactory.java
  • src/test/java/de/tum/cit/aet/artemis/programming/StaticCodeAnalysisParserUnitTest.java
`src/main/java/**/*.java`: naming:CamelCase; principles:{sin...

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
  • src/main/java/de/tum/cit/aet/artemis/programming/domain/StaticCodeAnalysisTool.java
  • src/main/java/de/tum/cit/aet/artemis/core/config/StaticCodeAnalysisConfigurer.java
  • src/main/java/de/tum/cit/aet/artemis/programming/service/localci/scaparser/strategy/ParserPolicy.java
  • src/main/java/de/tum/cit/aet/artemis/programming/service/localci/scaparser/strategy/sarif/ClippyCategorizer.java
🧠 Learnings (2)
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-11-12T12:51:46.554Z
Learning: Static code analysis for Rust in GitLab CI will be added in a follow-up PR.
src/main/resources/templates/aeolus/rust/default_static.sh (1)
Learnt from: magaupp
PR: ls1intum/Artemis#8802
File: src/main/resources/templates/aeolus/rust/default.sh:14-24
Timestamp: 2024-11-12T12:51:46.554Z
Learning: The `default.sh` script in the `src/main/resources/templates/aeolus/rust/` directory is auto-generated by Aeolus and should not be manually edited. Changes need to be made in the Aeolus generator settings or templates.
⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: Call Build Workflow / Build .war artifact
  • GitHub Check: Call Build Workflow / Build and Push Docker Image
  • GitHub Check: client-style
  • GitHub Check: server-style
  • GitHub Check: server-tests
  • GitHub Check: client-tests
  • GitHub Check: Analyse
🔇 Additional comments (17)
src/test/resources/test-data/static-code-analysis/reports/clippy.sarif (3)

1-4: LGTM! The SARIF file follows the correct schema.

The file correctly references the SARIF 2.1.0 schema and follows the standard structure.


469-555: LGTM! The tool configuration is well-documented.

The tool section:

  • Correctly identifies Clippy as the analysis tool
  • Provides documentation links for each rule
  • Includes clear descriptions of rule configurations

556-559: LGTM! Version information is correctly specified.

The SARIF version is correctly specified as 2.1.0.

src/main/java/de/tum/cit/aet/artemis/programming/service/localci/scaparser/strategy/sarif/ClippyCategorizer.java (4)

1-17: Well-structured class definition

This file cleanly introduces a dedicated categorizer for Rust Clippy lints. The top-level documentation is clear, referencing Rust lint groups and Clippy lint docs. No immediate issues are apparent.


19-21: Enum 'Category' is cohesive

Defining a single enum with both Rust and Clippy categories ensures consistency and reuse. This enumerated approach promotes clarity.


23-32: Minimal, readable categorizeRule implementation

The method handles Clippy vs. Rust rules explicitly, returning a lowercase category name. This is maintainable and clearly expresses intent.


34-62: RUST_CATEGORY_BY_NAME mapping

The mapping is straightforward, using well-labeled lint identifiers. It’s efficient and effectively covers common Rust-level lints. No issues noted.

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

7-7: Import addition is necessary

The import for ClippyCategorizer aligns with the new Clippy tool support. This is correct.


32-32: Properly added CLIPPY case

Creating a SarifParser with StaticCodeAnalysisTool.CLIPPY and ClippyCategorizer is consistent with the other tool cases. Ensure thorough testing of the newly integrated parser.

src/main/java/de/tum/cit/aet/artemis/programming/domain/StaticCodeAnalysisTool.java (2)

18-18: Introducing the CLIPPY enum constant

Naming follows the established convention, and the file pattern "clippy.sarif" is appropriately descriptive.


36-36: Registering Clippy for Rust

Adding CLIPPY to TOOLS_OF_PROGRAMMING_LANGUAGE lets Rust exercises benefit from static analysis. Good extension of the existing mapping.

src/test/java/de/tum/cit/aet/artemis/programming/StaticCodeAnalysisParserUnitTest.java (1)

86-89: LGTM!

The test method follows the established pattern in the class and correctly tests the parsing functionality for Clippy reports.

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

79-79: LGTM!

The change correctly enables static code analysis and testing for Rust in the Local CI environment, aligning with the PR objectives and documentation.

src/main/java/de/tum/cit/aet/artemis/core/config/StaticCodeAnalysisConfigurer.java (1)

12-12: LGTM!

The changes correctly configure Rust static code analysis by:

  1. Adding the required import for ClippyCategorizer
  2. Adding Rust to the map with appropriate categories and tool configuration

Also applies to: 92-92

docs/user/exercises/programming-exercise-features.inc (1)

88-88: LGTM!

The documentation correctly reflects that static code analysis for Rust is now supported in Local CI but not in Jenkins, which is consistent with the code changes.

src/main/resources/templates/aeolus/rust/default_static.sh (1)

1-37:

✅ Verification successful

Verify if this file should be manually edited.

According to previous learnings, Aeolus auto-generates these scripts. Verify if changes should be made in the Aeolus generator settings or templates instead.


🌐 Web query:

What is Aeolus and how does it handle template generation for build scripts?

💡 Result:

Aeolus is a Domain-Specific Language (DSL) designed to streamline the configuration of continuous integration (CI) jobs for programming exercises by generating platform-specific build scripts from a single declarative configuration file[5][8]. Here's how it handles template generation:

Core Functionality

  • Declarative Configuration: Users define CI workflows in a YAML-based Windfile that specifies:
    • Docker images and tags
    • Git repositories/branches
    • Custom actions (script blocks or prebuilt templates)
    • Environment variables[5][8]

Template Generation Process

  1. Multi-Platform Support: Converts Windfiles into executable configurations for:

    • Jenkins: Full pipeline definitions with stages/steps
    • Bamboo: Build plans with tasks/dependencies
    • Bash: Portable shell scripts with error handling[5][8]
  2. Action Templating:

    actions:
      - name: test-suite
        use: https://github.com/example/ci-templates.git
        parameters:
          TEST_TYPE: "unit"
      - name: security-scan
        script: ./run_scanner.sh

    This generates platform-specific implementations while preserving parameterization[5][8].

  3. Lifecycle Management:

    • Automates environment setup/teardown
    • Handles artifact cleanup
    • Manages conditional execution paths[5]

Key Features

Capability Implementation
Platform Abstraction Single config → multiple CI systems
Template Reuse Shared action repositories via Git
Environment Control Docker containerization per stage
Migration Support Translates existing Bamboo/Jenkins configs to Windfiles[8]

Aeolus reduces CI maintenance overhead by 83% for multi-platform environments according to internal benchmarks[8], while ensuring consistency across different execution environments through its template-driven approach.

Citations:


Important: This auto-generated script should not be manually edited.

Based on the Aeolus documentation and our web query, this file is generated automatically from configuration settings (such as your Windfile) that define CI workflows. Therefore, manual modifications to this script are discouraged. Any necessary changes should be made in the Aeolus generator settings or its associated templates to ensure that they persist through regeneration.

  • File Affected: src/main/resources/templates/aeolus/rust/default_static.sh
  • Action Required: Update the Aeolus configuration (e.g., Windfile) or generator templates instead of manually editing this script.
src/test/resources/test-data/static-code-analysis/expected/clippy.json (1)

1-137: LGTM! Comprehensive test data covering various Clippy scenarios.

The test data effectively covers:

  • Different severity levels (errors and warnings)
  • Various Clippy categories (unsafe_code, suspicious, unused, etc.)
  • Different types of issues (unsafe blocks, unreachable code, style violations, etc.)
  • Detailed issue information (file paths, line numbers, messages)

coderabbitai[bot]
coderabbitai bot previously approved these changes Feb 15, 2025
@helios-aet helios-aet bot temporarily deployed to artemis-test1.artemis.cit.tum.de February 17, 2025 23:36 Inactive
@helios-aet helios-aet bot temporarily deployed to artemis-test2.artemis.cit.tum.de February 18, 2025 08:52 Inactive
@helios-aet helios-aet bot temporarily deployed to artemis-test3.artemis.cit.tum.de February 18, 2025 09:40 Inactive
az108
az108 previously approved these changes Feb 18, 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 👍

simonbohnen
simonbohnen previously approved these changes Feb 18, 2025
Copy link

@simonbohnen simonbohnen 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 and works 👌🏼

iyannsch
iyannsch previously approved these changes Feb 18, 2025
Copy link
Contributor

@iyannsch iyannsch left a comment

Choose a reason for hiding this comment

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

LGTM

@helios-aet helios-aet bot temporarily deployed to artemis-test4.artemis.cit.tum.de February 18, 2025 11:05 Inactive
SimonEntholzer
SimonEntholzer previously approved these changes Feb 18, 2025
Copy link
Contributor

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

@helios-aet helios-aet bot temporarily deployed to artemis-test4.artemis.cit.tum.de February 18, 2025 17:12 Inactive
@helios-aet helios-aet bot temporarily deployed to artemis-test4.artemis.cit.tum.de February 18, 2025 17:22 Inactive
Copy link
Member

@krusche krusche left a comment

Choose a reason for hiding this comment

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

Code looks good 👍 but the PR has merge conflicts

# Conflicts:
#	src/main/java/de/tum/cit/aet/artemis/programming/domain/StaticCodeAnalysisTool.java
#	src/main/java/de/tum/cit/aet/artemis/programming/service/localci/scaparser/strategy/ParserPolicy.java
#	src/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseFactory.java
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)
docs/user/exercises/programming-exercise-features.inc (1)

121-122: Consider updating the note about C language.

Since Rust now joins C in having LocalCI-only static analysis support, consider updating this note to be more generic.

-  Static Code Analysis for ``C`` exercises is only supported for ``LocalCI`` at the moment.
+  Static Code Analysis for some languages (e.g., ``C``, ``Rust``) is only supported for ``LocalCI`` at the moment.
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 304c797 and 40b840d.

⛔ Files ignored due to path filters (1)
  • src/main/resources/config/application.yml is excluded by !**/*.yml
📒 Files selected for processing (7)
  • docs/user/exercises/programming-exercise-features.inc (1 hunks)
  • src/main/java/de/tum/cit/aet/artemis/core/config/StaticCodeAnalysisConfigurer.java (2 hunks)
  • src/main/java/de/tum/cit/aet/artemis/programming/domain/StaticCodeAnalysisTool.java (2 hunks)
  • src/main/java/de/tum/cit/aet/artemis/programming/service/localci/LocalCIProgrammingLanguageFeatureService.java (1 hunks)
  • src/main/java/de/tum/cit/aet/artemis/programming/service/localci/scaparser/strategy/ParserPolicy.java (2 hunks)
  • src/test/java/de/tum/cit/aet/artemis/programming/StaticCodeAnalysisParserUnitTest.java (1 hunks)
  • src/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseFactory.java (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (6)
  • src/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseFactory.java
  • src/main/java/de/tum/cit/aet/artemis/programming/domain/StaticCodeAnalysisTool.java
  • src/main/java/de/tum/cit/aet/artemis/programming/service/localci/scaparser/strategy/ParserPolicy.java
  • src/test/java/de/tum/cit/aet/artemis/programming/StaticCodeAnalysisParserUnitTest.java
  • src/main/java/de/tum/cit/aet/artemis/programming/service/localci/LocalCIProgrammingLanguageFeatureService.java
  • src/main/java/de/tum/cit/aet/artemis/core/config/StaticCodeAnalysisConfigurer.java
🔇 Additional comments (1)
docs/user/exercises/programming-exercise-features.inc (1)

88-88: LGTM! The Rust feature update accurately reflects the implementation.

The change correctly indicates that static code analysis for Rust is now supported in LocalCI but not in Jenkins (L: yes; J: no), which aligns with:

  • The PR objectives of configuring Clippy for LocalCI
  • The implementation details in the backend changes
  • The pattern used for other languages with similar support levels (e.g., C, Ruby, Dart)

Copy link

@HanyangXu0508 HanyangXu0508 left a comment

Choose a reason for hiding this comment

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

image
tested on server 2 and worked as expected

@magaupp magaupp requested a review from krusche February 18, 2025 18:30
@krusche krusche merged commit b16a418 into develop Feb 18, 2025
23 of 26 checks passed
@krusche krusche deleted the feature/programming-exercises/rust-sca branch February 18, 2025 18:32
@krusche krusche added this to the 7.10.2 milestone Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config-change Pull requests that change the config in a way that they require a deployment via Ansible. core Pull requests that affect the corresponding module documentation programming Pull requests that affect the corresponding module server Pull requests that update Java code. (Added Automatically!) template tests
Projects
Status: Merged
Status: Done
Development

Successfully merging this pull request may close these issues.

7 participants