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

Integrated code lifecycle: Enhance handling of build scripts in the client #8165

Merged
merged 16 commits into from
Mar 15, 2024

Conversation

reschandreas
Copy link
Contributor

@reschandreas reschandreas commented Mar 9, 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.
  • I documented the Java code using JavaDoc style.

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.
  • I added multiple integration tests (Jest) related to the features (with a high test coverage), while following the test guidelines.
  • I documented the TypeScript code using JSDoc style.
  • I added screenshots/screencasts of my UI changes.
  • I translated all newly inserted strings into English and German.

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).

Motivation and Context

I added the build script to the detail page to make it easier to check what will be run, it is now also possible to reset the build plan back to the template using the reset button which was already there. I further improved some translations and applied the new guideline, and removed some unused services.

Description

Instructors can now quickly see their build script and revert to the template if something does not work

Steps for Testing

Prerequisites:

  • 1 Instructor
  • 1 Programming Exercise
  1. Log in to Artemis
  2. Navigate to Programming Exercises
  3. Look at a programming exercise detail page and check if you can see the build script
  4. edit the programming exercise's build script, save, reload and check if it is updated
  5. reset the build plan, reload, check if it was resetted

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

Client

Class/File Line Coverage Confirmation (assert/expect)
programming-exercise-detail.component.ts 85.24%

Server

Class/File Line Coverage Confirmation (assert/expect)
BuildScriptProvider.java 91%
LocalCIService.java 100%
ProgrammingExerciseResource.java 89%

Screenshots

Screenshot 2024-03-15 at 08 50 00

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features
    • Introduced a method to generate default build scripts for programming exercises.
    • Added new functionality to recreate build plans for exercises, including fetching and setting build configurations.
    • Implemented a new component to display build configuration details (Docker image and script) for programming exercises.
    • Enhanced programming exercise detail pages with options to view and revert to template build plans.
  • Enhancements
    • Updated UI components to use the artemisTranslate pipe for localization, improving consistency and removing deprecated elements.
    • Refined the display of programming exercise customization options, removing the BETA badge and updating labels for better clarity.
  • Bug Fixes
    • Corrected Docker image settings in programming exercise management and test components.
  • Tests
    • Added and updated tests to cover new functionalities and component behaviors, including build plan recreation and build configuration details.

@artemis-bot artemis-bot added this to In progress in Artemis Development Mar 9, 2024
@github-actions github-actions bot added client Pull requests that update TypeScript code. (Added Automatically!) tests server Pull requests that update Java code. (Added Automatically!) labels Mar 9, 2024
@reschandreas reschandreas force-pushed the feature/enhance-build-script-editing branch from 767ac5d to bc80afe Compare March 9, 2024 14:25
@reschandreas reschandreas marked this pull request as ready for review March 9, 2024 15:24
@reschandreas reschandreas requested a review from a team as a code owner March 9, 2024 15:24
Copy link

coderabbitai bot commented Mar 9, 2024

Walkthrough

The updates focus on enhancing programming exercise management and build configuration within an educational platform. A significant addition is the method for generating default build scripts based on exercise properties, alongside improvements in local continuous integration service handling and user interface enhancements for displaying programming exercise details, specifically build configurations. Changes streamline the process of managing programming exercises, from build plan recreation to UI updates for a better user experience in configuring and understanding exercise build specifics.

Changes

File(s) Change Summary
BuildScriptProvider.java Added method getScriptFor to generate default build scripts.
LocalCIService.java Enhanced with new imports, fields, recreateBuildPlansForExercise method; updated exception handling.
ProgrammingExerciseResource.java Updated with new imports, annotations, and conditional save logic.
detail-overview-list.*
programming-exercise-detail-build-configuration.*
Introduced components and enums for rendering build configuration details.
programming-exercise-detail.component.ts Removed unnecessary imports; added AeolusService for build configuration display.
programming-exercise-update.module.ts Updated exports with ProgrammingExerciseCustomBuildPlanComponent.
programming-exercise-custom-*build-plan.component.html Updated localization and UI elements for exercise customization.
LocalCIServiceTest.java Added tests for new functionality in LocalCIService.
programming-exercise-*.spec.ts Unit tests for components related to exercise build configuration.

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.

@artemis-bot artemis-bot moved this from In progress to Ready for review in Artemis Development Mar 9, 2024
@reschandreas reschandreas force-pushed the feature/enhance-build-script-editing branch from 61881bb to a178c25 Compare March 9, 2024 15:25
@reschandreas reschandreas force-pushed the feature/enhance-build-script-editing branch from a178c25 to 5d2b8d8 Compare March 9, 2024 15:26
@reschandreas reschandreas changed the title Development: Enhance handling of build scripts in the client Integrated code lifecycle: Enhance handling of build scripts in the client Mar 9, 2024
@b-fein
Copy link
Contributor

b-fein commented Mar 9, 2024

I’m not sure if adding this as additional information to the exercise details page is a bit too much.

Would it be possible to show the build script in the already existing (at least for Jenkins) build plan editor or refactor that page so that you can see either the Jenkins pipeline definition or the build script depending on the system/exercise setup?
Alternatively, you could show a ‘View Build Script’ button instead of the ‘Build Plan Editor’ and design a new page for that if a unified approach would have too many edge cases.

The editor could be shown in read-only mode for the build script in either case if manually editing the script is not or should not be supported.

Rel #8079

Artemis Development automation moved this from Ready for review to Review in progress Mar 10, 2024
@reschandreas reschandreas force-pushed the feature/enhance-build-script-editing branch from 17abde3 to c27f70f Compare March 12, 2024 18:58
@reschandreas
Copy link
Contributor Author

Hi @b-fein! Thanks for the questions. I think this would result in a much bigger PR with a lot of refactoring that maybe could be done at a later time, for now this is a solution for LocalCI only and not Jenkins.

Copy link
Contributor

@rstief rstief left a comment

Choose a reason for hiding this comment

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

Some minor comments, looks good :)

src/main/webapp/i18n/de/programmingExercise.json Outdated Show resolved Hide resolved
src/main/webapp/i18n/en/programmingExercise.json Outdated Show resolved Hide resolved
Copy link
Contributor

@milljoniaer milljoniaer left a comment

Choose a reason for hiding this comment

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

Thanks for the changes, LGTM 🚀

Copy link
Contributor

@laurenzfb laurenzfb 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

Copy link
Contributor

@mateusmm01 mateusmm01 left a comment

Choose a reason for hiding this comment

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

Demonstrated in testing session. LGTM

@b-fein b-fein added this to the 6.9.3 milestone Mar 15, 2024
@krusche krusche merged commit 9d91f48 into develop Mar 15, 2024
31 of 39 checks passed
@krusche krusche deleted the feature/enhance-build-script-editing branch March 15, 2024 15:09
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!) component:integrated code lifecycle ready to merge server Pull requests that update Java code. (Added Automatically!) tests
Projects
Archived in project
Artemis Development
  
Review in progress
Development

Successfully merging this pull request may close these issues.

None yet

7 participants