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 Bash programming exercise template #10089

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

Conversation

magaupp
Copy link
Contributor

@magaupp magaupp commented Dec 31, 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 local server configured with LocalVC and Jenkins.

Description

The PR adds a programming exercise template for Bash.
The testing framework in use is Bats.

Steps for Testing

Prerequisites:

  • 1 Instructor
  1. Navigate to the programming exercise creation page
  2. Select Bash as the programming language
  3. Fill out the required fields and create the exercise
  4. Wait until the builds finish
  5. Verify that the Template Result passes 0/8 tests without build failure
  6. Verify that the Solution Result passes 8/8 tests without build failure
  7. Verify that the feedback in the Template Result makes sense

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

Summary by CodeRabbit

  • New Features

    • Added support for Bash programming language in continuous integration systems
    • Introduced Bash scripting exercise with tasks for file manipulation and scripting skills
    • Expanded programming language options in the application
  • Documentation

    • Updated documentation to include Bash language details and exercise instructions
  • Chores

    • Added Bash-related templates, test scripts, and configuration files
    • Updated programming language configurations to support Bash

@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!) documentation config-change Pull requests that change the config in a way that they require a deployment via Ansible. template programming Pull requests that affect the corresponding module labels Dec 31, 2024
Copy link

⚠️ Unable to deploy to test servers ⚠️

The docker build needs to run through before deploying.

@github-actions github-actions bot added the deployment-error Added by deployment workflows if an error occured label Dec 31, 2024
@magaupp magaupp added deploy:artemis-test1 and removed deployment-error Added by deployment workflows if an error occured labels Dec 31, 2024
Copy link

⚠️ Unable to deploy to test servers ⚠️

The docker build needs to run through before deploying.

@github-actions github-actions bot added the deployment-error Added by deployment workflows if an error occured label Dec 31, 2024
@magaupp magaupp added deploy:artemis-test1 and removed deployment-error Added by deployment workflows if an error occured labels Dec 31, 2024
@magaupp magaupp temporarily deployed to artemis-test1.artemis.cit.tum.de December 31, 2024 15:16 — with GitHub Actions Inactive
@magaupp magaupp force-pushed the feature/programming-exercises/bash-template branch 2 times, most recently from bb9b2ef to 7d7ecad Compare January 6, 2025 21:12
@magaupp magaupp force-pushed the feature/programming-exercises/bash-template branch from 7d7ecad to c48d300 Compare January 6, 2025 21:29
@magaupp magaupp temporarily deployed to artemis-test2.artemis.cit.tum.de January 6, 2025 21:52 — with GitHub Actions Inactive
@magaupp magaupp force-pushed the feature/programming-exercises/bash-template branch from c48d300 to 1446b6a Compare January 6, 2025 21:57
@magaupp magaupp temporarily deployed to artemis-test2.artemis.cit.tum.de January 6, 2025 22:05 — with GitHub Actions Inactive
@magaupp magaupp marked this pull request as ready for review January 6, 2025 22:21
@magaupp magaupp requested a review from a team as a code owner January 6, 2025 22:21
Copy link

coderabbitai bot commented Jan 6, 2025

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 pmd (7.8.0)
src/main/java/de/tum/cit/aet/artemis/programming/domain/ProgrammingLanguage.java

The following rules are missing or misspelled in your ruleset file category/vm/bestpractices.xml: BooleanInstantiation, DontImportJavaLang, DuplicateImports, EmptyFinallyBlock, EmptyIfStmt, EmptyInitializer, EmptyStatementBlock, EmptyStatementNotInLoop, EmptySwitchStatements, EmptySynchronizedBlock, EmptyTryBlock, EmptyWhileStmt, ExcessiveClassLength, ExcessiveMethodLength, ImportFromSamePackage, MissingBreakInSwitch, SimplifyBooleanAssertion. Please check your ruleset configuration.

src/main/java/de/tum/cit/aet/artemis/programming/service/TemplateUpgradePolicyService.java

The following rules are missing or misspelled in your ruleset file category/vm/bestpractices.xml: BooleanInstantiation, DontImportJavaLang, DuplicateImports, EmptyFinallyBlock, EmptyIfStmt, EmptyInitializer, EmptyStatementBlock, EmptyStatementNotInLoop, EmptySwitchStatements, EmptySynchronizedBlock, EmptyTryBlock, EmptyWhileStmt, ExcessiveClassLength, ExcessiveMethodLength, ImportFromSamePackage, MissingBreakInSwitch, SimplifyBooleanAssertion. Please check your ruleset configuration.

src/main/java/de/tum/cit/aet/artemis/programming/service/ci/ContinuousIntegrationService.java

The following rules are missing or misspelled in your ruleset file category/vm/bestpractices.xml: BooleanInstantiation, DontImportJavaLang, DuplicateImports, EmptyFinallyBlock, EmptyIfStmt, EmptyInitializer, EmptyStatementBlock, EmptyStatementNotInLoop, EmptySwitchStatements, EmptySynchronizedBlock, EmptyTryBlock, EmptyWhileStmt, ExcessiveClassLength, ExcessiveMethodLength, ImportFromSamePackage, MissingBreakInSwitch, SimplifyBooleanAssertion. Please check your ruleset configuration.

  • 3 others

Walkthrough

This pull request introduces comprehensive support for the Bash programming language across the Artemis platform. The changes span multiple components, including documentation, domain models, services, templates, and frontend configurations. The implementation adds Bash as a fully supported programming language, enabling features like continuous integration, build plan creation, and exercise templates with associated test suites.

Changes

File Path Change Summary
docs/user/exercises/programming-exercise-features.inc Added Bash to programming language support tables
src/main/java/de/tum/cit/aet/artemis/programming/domain/ProgrammingLanguage.java Added BASH to ENABLED_LANGUAGES set
src/main/java/de/tum/cit/aet/artemis/programming/service/* Updated services to support Bash in various contexts
src/main/resources/templates/bash/* Added Bash exercise templates, solution scripts, and test configurations
src/main/webapp/app/entities/programming/programming-exercise.model.ts Added BASH to ProgrammingLanguage enum

Sequence Diagram

sequenceDiagram
    participant User
    participant ArtemisPlatform
    participant ContinuousIntegration
    participant BuildSystem

    User->>ArtemisPlatform: Create Bash Programming Exercise
    ArtemisPlatform->>BuildSystem: Configure Build Plan
    BuildSystem->>ContinuousIntegration: Prepare CI Environment
    ContinuousIntegration->>BuildSystem: Execute Bash Tests
    BuildSystem->>ArtemisPlatform: Return Test Results
    ArtemisPlatform->>User: Display Exercise Feedback
Loading

Possibly related PRs

Suggested Labels

ready for review, ready to merge

Suggested Reviewers

  • JohannesStoehr
  • SimonEntholzer
  • BBesrour
  • krusche
  • EneaGore

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: 6

🧹 Nitpick comments (7)
src/main/resources/templates/bash/readme (2)

7-8: Consider adding more specific guidance for the shebang task.

While the task is clear, it would be helpful to provide examples of standard paths (e.g., /bin/bash or /usr/bin/env bash) to guide students, especially those new to Bash scripting.


22-24: Add safety considerations for the find and replace task.

The task should mention the importance of handling special characters in the replacement text and suggest using appropriate tools (e.g., sed with proper escaping).

src/main/resources/templates/bash/test/test.bats (2)

1-3: Consider adding cleanup function.

While setup is properly handled, there's no cleanup function to restore the test environment. Consider adding a teardown function.

+teardown() {
+    cd "$BATS_TEST_DIRNAME"
+    rm -rf "$BATS_TEST_TMPDIR"/*
+}

26-31: Improve error message clarity.

The custom error message could be more descriptive by showing the expected format.

-        | batslib_decorate "first line is not a valid shebang" \
+        | batslib_decorate "First line must be a valid shebang (e.g., #!/bin/bash or #!/usr/bin/env bash)" \
src/main/resources/templates/bash/solution/script.bash (2)

11-11: Make sed pattern matching more robust.

The current sed command might fail with special characters. Consider using a more robust pattern matching approach.

-sed -i 's/2\.718/3.1415/g' numbers.txt
+sed -i 's/\b2\.718\b/3.1415/g' numbers.txt

13-13: Exit with actual operation status.

Instead of hardcoding exit 0, consider capturing and using the actual operation status.

-exit 0
+exit $?
src/main/resources/templates/aeolus/bash/default.sh (1)

14-17: Improve test execution error handling.

The || true construct silently ignores test failures. Consider capturing and reporting the test status.

 test () {
   echo '⚙️ executing test'
-  bats --report-formatter junit --output results "${testWorkingDirectory}" || true
+  if ! bats --report-formatter junit --output results "${testWorkingDirectory}"; then
+    echo "Warning: Tests failed with status $?"
+    return 1
+  fi
 }
🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 16-16: testWorkingDirectory is referenced but not assigned.

(SC2154)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 1798b25 and 1446b6a.

⛔ Files ignored due to path filters (3)
  • src/main/resources/config/application.yml is excluded by !**/*.yml
  • src/main/resources/templates/aeolus/bash/default.yaml is excluded by !**/*.yaml
  • src/test/resources/config/application.yml is excluded by !**/*.yml
📒 Files selected for processing (18)
  • docs/user/exercises/programming-exercise-features.inc (2 hunks)
  • src/main/java/de/tum/cit/aet/artemis/programming/domain/ProgrammingLanguage.java (1 hunks)
  • src/main/java/de/tum/cit/aet/artemis/programming/service/TemplateUpgradePolicyService.java (1 hunks)
  • src/main/java/de/tum/cit/aet/artemis/programming/service/ci/ContinuousIntegrationService.java (2 hunks)
  • src/main/java/de/tum/cit/aet/artemis/programming/service/jenkins/JenkinsProgrammingLanguageFeatureService.java (2 hunks)
  • src/main/java/de/tum/cit/aet/artemis/programming/service/jenkins/build_plan/JenkinsBuildPlanService.java (1 hunks)
  • src/main/java/de/tum/cit/aet/artemis/programming/service/localci/LocalCIProgrammingLanguageFeatureService.java (2 hunks)
  • src/main/resources/templates/aeolus/bash/default.sh (1 hunks)
  • src/main/resources/templates/bash/exercise/script.bash (1 hunks)
  • src/main/resources/templates/bash/readme (1 hunks)
  • src/main/resources/templates/bash/solution/script.bash (1 hunks)
  • src/main/resources/templates/bash/test/test.bats (1 hunks)
  • src/main/resources/templates/bash/test/test_data/numbers.txt (1 hunks)
  • src/main/resources/templates/bash/test/test_data/numbers_expected.txt (1 hunks)
  • src/main/resources/templates/bash/test/test_data/rename_me.txt (1 hunks)
  • src/main/resources/templates/bash/test/test_helper/common-setup.bash (1 hunks)
  • src/main/resources/templates/jenkins/bash/regularRuns/pipeline.groovy (1 hunks)
  • src/main/webapp/app/entities/programming/programming-exercise.model.ts (1 hunks)
✅ Files skipped from review due to trivial changes (3)
  • src/main/resources/templates/bash/test/test_data/rename_me.txt
  • src/main/resources/templates/bash/test/test_data/numbers.txt
  • src/main/resources/templates/bash/test/test_data/numbers_expected.txt
🧰 Additional context used
📓 Path-based instructions (7)
src/main/webapp/app/entities/programming/programming-exercise.model.ts (1)

Pattern src/main/webapp/**/*.ts: angular_style:https://angular.io/guide/styleguide;methods_in_html:false;lazy_loading:true;code_reuse:true;tests:meaningful;types:PascalCase;enums:PascalCase;funcs:camelCase;props:camelCase;no_priv_prefix:true;strings:single_quotes;localize:true;btns:functionality;links:navigation;icons_text:newline;labels:associate;code_style:arrow_funcs,curly_braces,open_braces_same_line,indent_4;memory_leak_prevention:true;routes:naming_schema;chart_framework:ngx-charts;responsive_layout:true

src/main/java/de/tum/cit/aet/artemis/programming/service/ci/ContinuousIntegrationService.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/domain/ProgrammingLanguage.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/build_plan/JenkinsBuildPlanService.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/TemplateUpgradePolicyService.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/TemplateUpgradePolicyService.java (1)
Learnt from: magaupp
PR: ls1intum/Artemis#9074
File: src/main/java/de/tum/in/www1/artemis/service/programming/TemplateUpgradePolicyService.java:35-35
Timestamp: 2024-11-12T12:51:46.554Z
Learning: The `defaultRepositoryUpgradeService` in the `TemplateUpgradePolicyService` is used as a default for all non-JAVA languages, with specialized services added based on testing outcomes if necessary.
src/main/java/de/tum/cit/aet/artemis/programming/service/jenkins/JenkinsProgrammingLanguageFeatureService.java (2)
Learnt from: magaupp
PR: ls1intum/Artemis#9256
File: src/main/java/de/tum/cit/aet/artemis/programming/service/jenkins/JenkinsProgrammingLanguageFeatureService.java:0-0
Timestamp: 2024-11-12T12:52:03.805Z
Learning: In `JenkinsProgrammingLanguageFeatureService.java`, comments explaining boolean flags in calls to the `ProgrammingLanguageFeature` constructor are unnecessary because the parameter names are clear, and most IDEs display them as inline hints.
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-11-12T12:51:58.050Z
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#9261
File: src/main/java/de/tum/cit/aet/artemis/programming/service/localci/LocalCIProgrammingLanguageFeatureService.java:43-55
Timestamp: 2024-11-12T12:51:40.391Z
Learning: For constructors with multiple boolean parameters, it's acceptable to keep them as is because parameter names are clear and IDEs provide inline hints, making the code readable without refactoring to the builder pattern.
🪛 Shellcheck (0.10.0)
src/main/resources/templates/bash/test/test_helper/common-setup.bash

[warning] 7-7: studentParentWorkingDirectoryName is referenced but not assigned.

(SC2154)

src/main/resources/templates/aeolus/bash/default.sh

[warning] 6-6: studentParentWorkingDirectoryName is referenced but not assigned.

(SC2154)


[warning] 16-16: testWorkingDirectory is referenced but not assigned.

(SC2154)

🔇 Additional comments (14)
src/main/resources/templates/jenkins/bash/regularRuns/pipeline.groovy (1)

31-33: Consider restricting file permissions.

The current implementation grants execute permissions to all files in the assignment directory. Consider being more selective about which files need execute permissions.

✅ Verification successful

Current implementation is appropriate for CI environment

The blanket execute permissions are acceptable in this context because:

  • Files are in an isolated Docker container
  • Directory is created fresh for each build
  • Permissions are required for build and test execution
  • Scope is limited to the assignment directory only
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for potentially sensitive files that might get execute permissions
find ./assignment -type f -not -name "*.sh" -not -name "*.bash" | grep -v "test"

Length of output: 128


Script:

#!/bin/bash
# Search for documentation and configuration files
fd -e md -e yaml -e yml -e json

# Search for patterns defining assignment structure
rg -i "assignment.*directory|directory.*structure" -A 3 -B 3

# Find similar pipeline configurations
fd pipeline.groovy

Length of output: 67657

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

35-37: LGTM! Changes align with existing patterns.

The addition of BASH to the supported languages using defaultRepositoryUpgradeService follows the established pattern for non-JAVA languages, as confirmed by previous learnings.

src/main/java/de/tum/cit/aet/artemis/programming/domain/ProgrammingLanguage.java (1)

42-42: LGTM! BASH language support added correctly.

The addition of BASH to the ENABLED_LANGUAGES set is properly placed and follows the alphabetical ordering convention.

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

42-42: LGTM! BASH configuration aligns with other scripting languages.

The BASH configuration follows the same pattern as other scripting languages like Python, with appropriate feature flags set.


49-51: Verify the feature flag changes for Java and Kotlin.

The last parameter for both JAVA and KOTLIN has been changed to false. Please confirm if this is intentional as it might affect existing functionality.

✅ Verification successful

The feature flag changes for Java and Kotlin are consistent with the codebase.

The changes only affect the auxiliary repositories support (last parameter), which is now set to false for both languages. The static code analysis settings remain unchanged:

  • Java: Static code analysis remains enabled (true)
  • Kotlin: Static code analysis remains disabled (false)
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any related configuration or documentation about Java/Kotlin feature flags
rg -l "JAVA|KOTLIN.*feature" docs/

Length of output: 131


Script:

#!/bin/bash
# Check documentation content
cat docs/dev/setup/server.rst docs/dev/setup/jenkins-localvc.rst docs/dev/setup/jenkins-gitlab.rst | rg -A 5 -B 5 "JAVA|KOTLIN.*feature"

# Find and examine ProgrammingLanguageFeature class definition
fd -e java ProgrammingLanguageFeature

Length of output: 2269


Script:

#!/bin/bash
# Check ProgrammingLanguageFeature class definition
cat src/main/java/de/tum/cit/aet/artemis/programming/service/ProgrammingLanguageFeature.java

# Search for references to this feature in the codebase
rg -A 5 -B 5 "isStaticCodeAnalysisEnabled|staticCodeAnalysis" --type java

Length of output: 73495

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

47-65: Verify the consistent feature flag changes across all languages.

All languages now have their last feature flag set to true. This appears to be a systematic change that affects all languages, including the newly added BASH.

✅ Verification successful

Auxiliary repository support is intentionally enabled only in LocalCI

The consistent true values for auxiliary repository support in LocalCI are intentionally different from other CI implementations (Jenkins, GitLabCI) where it's consistently set to false. This represents a legitimate feature capability difference between CI systems, not an inconsistency that needs to be fixed.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any documentation or commits explaining this feature flag change
rg -l "LocalCI.*feature.*true" docs/
git log -p --all -S "LocalCI.*feature.*true" -- "*.md" "*.adoc"

Length of output: 38


Script:

#!/bin/bash
# Find ProgrammingLanguageFeature class definition
ast-grep --pattern 'class ProgrammingLanguageFeature {
  $$$
}'

# Find any test files related to this class
fd -e java -e kt test --exec rg -l "ProgrammingLanguageFeature"

# Look for any configuration or constant files that might explain these features
rg -l "ProgrammingLanguageFeature" -g "!*.{class,jar}"

Length of output: 2819


Script:

#!/bin/bash
# Get the ProgrammingLanguageFeature class definition
cat src/main/java/de/tum/cit/aet/artemis/programming/service/ProgrammingLanguageFeature.java

# Check other CI implementations for consistency
rg -A 5 -B 5 "ProgrammingLanguageFeature\(" src/main/java/de/tum/cit/aet/artemis/programming/service/jenkins/JenkinsProgrammingLanguageFeatureService.java src/main/java/de/tum/cit/aet/artemis/programming/service/gitlabci/GitLabCIProgrammingLanguageFeatureService.java

Length of output: 8378

src/main/webapp/app/entities/programming/programming-exercise.model.ts (1)

17-17: LGTM! BASH enum value added correctly.

The addition of BASH to the ProgrammingLanguage enum is consistent with the backend changes and follows proper alphabetical ordering.

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

50-51: LGTM! Documentation changes are accurate and well-structured.

The tables correctly document Bash support in both CI systems and accurately reflect the current feature limitations.

Also applies to: 96-97

src/main/resources/templates/bash/test/test_helper/common-setup.bash (3)

24-30: LGTM!

The function is well-documented and correctly implements file content comparison using diff. The error handling is appropriate.


33-33: LGTM!

The function is correctly implemented as a no-op to reduce output during test execution.


34-34: LGTM!

The function is correctly implemented as a no-op to reduce output during test execution.

src/main/java/de/tum/cit/aet/artemis/programming/service/ci/ContinuousIntegrationService.java (2)

222-223: LGTM!

The addition of BASH to the list of languages that return "assignment" is consistent with the PR objectives and follows the established pattern.


233-234: LGTM!

The addition of BASH to the list of languages that return "tests" is consistent with the PR objectives and follows the established pattern.

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

188-189: LGTM!

The addition of BASH to the list of languages that use jenkinsBuildPlanCreator is consistent with the PR objectives and follows the established pattern.

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.

Really nice addition 👍 (Code)
Compact and concise template exercise

Copy link

@flbrgit flbrgit 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. The builds run through without errors, and the feedback of the template result also makes sense.

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!) config-change Pull requests that change the config in a way that they require a deployment via Ansible. documentation programming Pull requests that affect the corresponding module ready for review server Pull requests that update Java code. (Added Automatically!) template tests
Projects
Status: Ready For Review
Status: In review
Development

Successfully merging this pull request may close these issues.

3 participants