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: Upgrade Java Blackbox template to java 22 #8388

Merged
merged 4 commits into from
Apr 22, 2024

Conversation

BaumiCoder
Copy link
Member

@BaumiCoder BaumiCoder commented Apr 12, 2024

Checklist

General

  • I tested all changes and their related features with all corresponding user types on a test server.
  • This is a small issue that I tested locally and was confirmed by another developer on a test server.
  • I chose a title conforming to the naming conventions for pull requests.

Server

The PR only changes a template for a programming exercises. No Changes in the server source code.

Client

The PR only changes a template for a programming exercises. No Changes in the client source code.

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). Cannot be tested there, because at the moment only Jenkins supports the exercise task MAVEN_BLACKBOX (DejaGnu).
  • 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

Update the template of the Java Blackbox DejaGnu exercises to the newest java version to allow the usage of the language features of that version.

Description

Update the template of the Java Blackbox DejaGnu exercises to java 22.

The usage of java.io.Console with this java version leads to problems with dejagnu/runtest.
Dejagnu/runtest erroneously detects java.io.Console of Java 22 as an interactive terminal, although there is none and only input and output pipes/redirection. Then, dejagnu sends some ANSI control sequence to the "shell" which are not interpreted and simply stored in the output. A quick fix restoring the default behavior of Java 21 for the test execution can be found in 85824ff.

Steps for Testing

Prerequisites:

  • 1 Instructor
  1. Log in to Artemis with the Instructor account
  2. Navigate to a course
  3. Create a new Programming Exercise there
    1. Choose language Java
    2. Choose type DejaGnu
  4. Check if the tests for the solution repository are 100 %
  5. Click on "Edit in editor"
  6. Choose SOLUTION instead of TEMPLATE
  7. Choose the Client.java in the "File browser"
  8. Go to the main method in the code
  9. At the top of the method replace
    BufferedReader in
        = new BufferedReader(new InputStreamReader(System.in));
    with
    java.io.Console in = System.console();
  10. Click on "Submit"
  11. Go back to the exercise and check if the tests for the solution repository are still 100 % after that change.

Testserver States

Note

These badges show the state of the test servers.
Green = Currently available, Red = Currently locked







Review Progress

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Test Coverage

No changes in Java code.

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Updated Maven blackbox image version to enhance project compatibility.
    • Added javaFlags variable to improve Java process customization in Jenkins pipelines.
  • Refactor

    • Updated Java compiler plugin and release version in Maven configurations to align with latest standards.
  • Bug Fixes

    • Modified Tcl script to correctly include Java flags in the spawn command, ensuring proper execution settings.

@BaumiCoder BaumiCoder self-assigned this Apr 12, 2024
@BaumiCoder BaumiCoder requested a review from a team as a code owner April 12, 2024 17:14
Copy link

coderabbitai bot commented Apr 12, 2024

Walkthrough

The changes in this update involve upgrading Java and Maven configurations across different project components to newer versions, enhancing compatibility and potentially improving performance by optimizing Java flags handling during build and test processes.

Changes

Files Change Summary
.../config/application.yml Updated Maven blackbox image version from 21 to 22.
.../java/maven_blackbox/exercise/pom.xml, .../solution/pom.xml Updated Java compiler plugin to 3.11.0 and Java release version from 21 to 22.
.../test/blackbox/projectTemplate/testsuite/config/default.exp Modified spawn command to include JAVA_FLAGS before the -cp option.
.../jenkins/java/blackbox/regularRuns/pipeline.groovy Added javaFlags variable and used it in a sed command to replace script placeholders.
.../aeolus/java/plain_maven_blackbox.sh, .../plain_maven_blackbox.yaml Updated script to include JAVA_FLAGS with specific values for enhanced Java flag handling.
.../aeolus/java/plain_maven_blackbox_static.sh, .../plain_maven_blackbox_static.yaml Added JAVA_FLAGS variable with predefined values and updated script to dynamically set Java flags.

Possibly related issues

  • Issue Exam: Divide the Testing Process into Steps #6621: The updates aligning Java and Maven configurations could potentially contribute to the objectives outlined in this issue by ensuring a more robust and secure testing environment for exam programming exercises. Further investigation is needed for confirmation.

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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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 config-change Pull requests that change the config in a way that they require a deployment via Ansible. template labels Apr 12, 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

coderabbitai[bot]
coderabbitai bot previously approved these changes Apr 12, 2024
@b-fein b-fein added the small label Apr 18, 2024
@b-fein b-fein added this to the 7.0.1 milestone Apr 18, 2024
Copy link
Contributor

@kaancayli kaancayli 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 Legacy TS2 works as expected.

Copy link
Contributor

@pzdr7 pzdr7 left a comment

Choose a reason for hiding this comment

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

Tested in testing session; works as described

Copy link
Contributor

@coolchock coolchock left a comment

Choose a reason for hiding this comment

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

tested during testing tession on the legacy ts2, works as expected

Copy link
Contributor

@egekurt123 egekurt123 left a comment

Choose a reason for hiding this comment

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

Tested during a testing session on ts2 legacy, works as expected

@krusche krusche modified the milestones: 7.0.1, 7.0.2 Apr 22, 2024
@krusche krusche merged commit af1d72f into develop Apr 22, 2024
49 of 55 checks passed
@krusche krusche deleted the improvement/update-Dejagnu-template-to-java-22 branch April 22, 2024 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:Programming config-change Pull requests that change the config in a way that they require a deployment via Ansible. ready to merge small template
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

9 participants