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: Structure build logs folder #9304

Merged

Conversation

BBesrour
Copy link
Member

@BBesrour BBesrour commented Sep 10, 2024

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 principle of data economy for all database calls.
  • I strictly followed the server coding and design guidelines.
  • 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).

Motivation and Context

Currently, all the build log files are saved under the same folder. This raises an issue when admins want to access a build log file manually where the folder takes a long time to load due to the extremely large number of files

Description

This PR introduces a folder structure to the build logs:

  • build-logs
    • Course-short-name
      • Exercise-short-name
        • buildlog file

Old build logs files will stay in that parent folder for now and will be automatically gradually deleted.

Steps for Testing

Prerequisites (Test servers):

  • Before checking out this branch, make a few submissions from develop
  • 1 Instructor
  1. Create a programming exercise and submit a few attempts
  2. Go to Build Overview
  3. Check that the old and new build log files are accessible
  4. Go to exercise participation, check the submissions for a participation (ideally a new submission and an old one), no errors

Prerequisites (Optional - Locally):

  • Before checking out this branch, make a few submissions from develop
  • 1 Instructor
  1. Check that the build logs are saved correctly (they should be under a directory with path './build-logs' relative to the artemis repo)

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

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 even for very large courses with more than 2000 students.
  • I (as a reviewer) confirm that the server changes (in particular related to database calls) are implemented with a very good performance even for very large courses with more than 2000 students.

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Performance Tests

  • Test 1
  • Test 2

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Enhanced build log handling with improved organization and access based on programming exercises.
    • Introduced a method to check for the existence of log files in both exercise-specific and parent directories.
    • Added functionality to process results with a focus on programming exercise participation.
    • New methods in repositories for robust retrieval and error handling of build jobs and programming exercises.
  • Bug Fixes

    • Implemented a fallback mechanism for backward compatibility with existing logs.
  • Documentation

    • Updated method signatures to reflect new parameters and functionality related to participation.
  • Tests

    • Improved test cases to validate new functionality regarding build logs and participation context.

@BBesrour BBesrour requested a review from a team as a code owner September 10, 2024 16:22
Copy link

coderabbitai bot commented Sep 10, 2024

Walkthrough

The changes introduced in this pull request enhance the functionality of the BuildLogEntryService, ResultService, and related services by modifying methods to incorporate the Participation context. This allows for more informed handling of build logs and results. Additionally, several test cases have been updated to ensure the new functionality is validated through dynamic identifiers and improved log management.

Changes

Files Change Summary
src/main/java/de/tum/in/www1/artemis/service/ResultService.java Modified getLogsAvailabilityForResults to include Participation participation as an additional parameter.
src/main/java/de/tum/in/www1/artemis/web/rest/ResultResource.java Modified getBuildJobIdsForResultsOfParticipation to pass participation to getLogsAvailabilityForResults.
src/main/java/de/tum/in/www1/artemis/service/BuildLogEntryService.java Introduced dependencies for BuildJobRepository and ProgrammingExerciseRepository. Modified methods to include programming exercise context, added new methods for log file handling, and implemented a fallback for backward compatibility.
src/main/java/de/tum/in/www1/artemis/service/connectors/localci/LocalCIResultProcessingService.java Updated processResult method to enhance handling of ProgrammingExerciseParticipation.
src/test/java/de/tum/in/www1/artemis/localvcci/LocalCIResourceIntegrationTest.java Modified testGetBuildLogsForResult to use specific build job ID "6" instead of "0" for log saving and API request.
src/main/java/de/tum/cit/aet/artemis/programming/repository/BuildJobRepository.java Added methods for retrieving build jobs by ID and handling errors when not found.
src/main/java/de/tum/cit/aet/artemis/programming/repository/ProgrammingExerciseRepository.java Added a method for retrieving programming exercises by ID with error handling.
src/test/java/de/tum/in/www1/artemis/localvcci/LocalCIIntegrationTest.java Updated buildJobHasLogFile method to require ProgrammingExercise parameter.
src/test/java/de/tum/in/www1/artemis/service/ParticipationServiceTest.java Modified testGetBuildJobsForResultsOfParticipation to include Participation participation in the getLogsAvailabilityForResults call.

Possibly related PRs

Suggested labels

ready to merge, maintainer-approved


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 generate interesting stats about this repository and render them as a table.
    -- @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 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.

Tip

Early access features: enabled

We are currently testing the following features in early access:

  • OpenAI o1 for code reviews: OpenAI's new o1 model is being tested for code reviews. This model has advanced reasoning capabilities and can provide more nuanced feedback on your code.

Note:

  • You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file.

@github-actions github-actions bot added tests server Pull requests that update Java code. (Added Automatically!) labels Sep 10, 2024
coderabbitai[bot]
coderabbitai bot previously approved these changes Sep 10, 2024
coderabbitai[bot]
coderabbitai bot previously approved these changes Sep 10, 2024
coderabbitai[bot]
coderabbitai bot previously approved these changes Sep 10, 2024
coderabbitai[bot]
coderabbitai bot previously approved these changes Sep 10, 2024
coderabbitai[bot]
coderabbitai bot previously approved these changes Sep 10, 2024
@BBesrour BBesrour changed the title Integrated code lifecycle: add folder structure buildlogs Integrated code lifecycle: Structure buildlogs folder Sep 11, 2024
@BBesrour BBesrour force-pushed the chore/integrated-code-lifecycle/add-folder-structure-buildlogs branch from c40a64b to f14c498 Compare September 12, 2024 11:25
coderabbitai[bot]
coderabbitai bot previously approved these changes Sep 12, 2024
Copy link

@GODrums GODrums 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 testing server in review session, LGTM.

Copy link
Contributor

@cremertim cremertim 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 yesterday, Changes lgtm

@krusche krusche added this to the 7.5.4 milestone Sep 19, 2024
@krusche krusche merged commit c35ba63 into develop Sep 19, 2024
38 of 43 checks passed
@krusche krusche deleted the chore/integrated-code-lifecycle/add-folder-structure-buildlogs branch September 19, 2024 20:29
@krusche krusche changed the title Integrated code lifecycle: Structure buildlogs folder Integrated code lifecycle: Structure build logs folder Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review ready to merge server Pull requests that update Java code. (Added Automatically!) tests
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

9 participants