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: Fix template upgrade for maven exercises #8241

Merged
merged 4 commits into from
Mar 24, 2024

Conversation

Strohgelaender
Copy link
Contributor

@Strohgelaender Strohgelaender commented Mar 23, 2024

Checklist

General

Server

  • Important: I implemented the changes with a very good performance and prevented too many (unnecessary) database calls.
  • I strictly followed the server coding and design guidelines.

Client

  • Important: I implemented the changes with a very good performance, prevented too many (unnecessary) REST calls and made sure the UI is responsive, even with large data.
  • I strictly followed the client coding and design guidelines.

Motivation and Context

For Java-Maven exercises we offer the option to upgrade the templates, updating the configuration files and dependency versions. However, this did not work correctly, leading to issues like #8186.

Fixes #8186 (the root cause of the issue).

Description

This PR fixes two issues:

  1. The client did not correctly set the upgradeTemplate option to true if the checkbox was activated. This was caused by passing direct booleans to the sub-components, where the updated value did not get populated to the API call. I fixed that by addding a small wrapper object.

  2. The server did not upgrade the test repository since the Path to the template repository was not set correctly.

Steps for Testing

  1. Import a older maven exercise into a course
  2. Activate the "Upgrade Template" option during the import
  3. Check that after importing a "Template upgraded by Artemis commit" is present in the Repository. Check that Ares version 1.13.0 and a new version of the maven-surefire-plugin is present.
  4. Check that running the tests still works after the import. Check that failed tests come with test feedback (detailText).

Testserver States

Note

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







Review Progress

Performance Review

  • I (as a reviewer) confirm that the client changes (in particular related to REST calls and UI responsiveness) are implemented with a very good performance
  • I (as a reviewer) confirm that the server changes (in particular related to database calls) are implemented with a very good performance

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Test Coverage

unchanged
(Sadly the JavaTemplateUpgradeService seems to be completely untested, we should add server tests here in a followup)

Summary by CodeRabbit

  • New Features
    • Added exclusion of the "checked-out-repos/**" directory from code formatting to enhance developer experience.
    • Introduced additional configuration options for importing exercises in the programming exercise management UI.
  • Enhancements
    • Updated the directory structure for Maven projects in Java templates to improve project organization.
    • Refactored import options in the ProgrammingExerciseUpdateComponent for better structure and readability.
  • Bug Fixes
    • Fixed bindings for checkboxes related to build plans and template updates in the programming exercise information component.
  • Tests
    • Updated unit tests to reflect changes in the handling of import options.

@github-actions github-actions bot added the client Pull requests that update TypeScript code. (Added Automatically!) label Mar 23, 2024
@github-actions github-actions bot added the tests label Mar 23, 2024
@github-actions github-actions bot added the server Pull requests that update Java code. (Added Automatically!) label Mar 23, 2024
@Strohgelaender Strohgelaender marked this pull request as ready for review March 23, 2024 13:16
@Strohgelaender Strohgelaender requested a review from a team as a code owner March 23, 2024 13:16
Copy link

coderabbitai bot commented Mar 23, 2024

Walkthrough

The changes primarily revolve around enhancing the management and update functionalities of programming exercises within a development environment. Key updates include excluding specific directories from code formatting, refining the directory structure for Maven projects, and structuring import options for exercise updates. These adjustments aim to streamline the development process, improve code management efficiency, and offer more precise control over exercise import configurations.

Changes

File Path Change Summary
build.gradle Excluded "checked-out-repos/**" from spotless code formatting
src/main/.../JavaTemplateUpgradeService.java Updated templatePomDir based on repositoryType for Maven projects
src/main/.../programming-exercise-update.component.html
src/main/.../programming-exercise-information.component.html
Added [importOptions] binding and updated bindings for recreateBuildPlans and updateTemplateFiles
src/main/.../programming-exercise-update.component.ts
src/main/.../programming-exercise-information.component.ts
src/test/.../programming-exercise-update.component.spec.ts
Refactored import options into ImportOptions interface; updated references and added @Input() declaration

Assessment against linked issues

Objective Addressed Explanation
Display of detailed test-results not displayed (#8186) The changes do not directly address the issue of displaying detailed test results in Artemis.
Inconsistent behavior of imported exercises leading to missing build plans (#7439) The updates do not seem to tackle the issue of missing build plans for imported exercises.
Display status of the latest template submission correctly (#7880) The changes made do not appear to address the display inconsistencies of template submission statuses.
Preventing test.json file breakage upon changing short name during import (#7188) The provided changes do not address the issue related to the test.json file breaking due to changes in the exercise's short name during import.
Replacing working test cases with a dummy test during exam programming exercise creation (#6621) The modifications do not cover the objectives related to handling test cases during the exam programming exercise creation process.

Related issues

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-tests 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 tests 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 tests.
    • @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.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link
Member

@julian-christl julian-christl left a comment

Choose a reason for hiding this comment

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

No objections to the code changes, assuming the manual tests will be successful

@krusche krusche changed the title Programming Exercises: Fix template upgrade for maven exercises Programming exercises: Fix template upgrade for maven exercises Mar 24, 2024
@krusche krusche merged commit c605b34 into develop Mar 24, 2024
30 of 34 checks passed
@krusche krusche deleted the bugfix/template-upgrade branch March 24, 2024 21:56
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!) ready for review server Pull requests that update Java code. (Added Automatically!) tests
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Programming exercise: Detailed test-results not displayed
3 participants