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: Fix issue in result processing #10363

Merged

Conversation

BBesrour
Copy link
Member

@BBesrour BBesrour commented Feb 18, 2025

Checklist

General

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

There is an issue with the result processing that would cause an exception and interrupt the flow. The exception is caused when a high number of items are added to the result queue in a short amount of time, which causes an error when casting back to the list.

This PR also includes a small UI fix in the build overview page

Testserver States

You can manage test servers using Helios. Check environment statuses in the environment list. To deploy to a test server, go to the CI/CD page, find your PR or branch, and trigger the deployment.

Review Progress

Code Review

  • Code Review 1
  • Code Review 2

Summary by CodeRabbit

  • New Features
    • Finished build jobs display updated with a new "Build Submission Date" column featuring integrated sorting capabilities. This update enhances the user interface by providing clearer tracking of build submission times, helping users manage and review their build history more effectively. The change offers a more intuitive experience and improved accessibility in monitoring build status.

@BBesrour BBesrour self-assigned this Feb 18, 2025
@BBesrour BBesrour requested a review from a team as a code owner February 18, 2025 16:03
@github-actions github-actions bot added server Pull requests that update Java code. (Added Automatically!) client Pull requests that update TypeScript code. (Added Automatically!) programming Pull requests that affect the corresponding module labels Feb 18, 2025
Copy link

coderabbitai bot commented Feb 18, 2025

Walkthrough

This pull request introduces a new private method getResultQueueBuildJobIds() in the LocalCIResultProcessingService class to encapsulate the logic for extracting build job IDs from the result queue. The logging in the processResult() method is updated to use this new method. In addition, the build queue component’s HTML is modified to add a new sortable column for buildSubmissionDate, replacing the previous submissionDate column in the finished build jobs table.

Changes

File Path Change Summary
src/main/java/…/LocalCIResultProcessingService.java - Added new private method getResultQueueBuildJobIds() to extract build job IDs from resultQueue.
- Updated logging in processResult() to use the new method.
src/main/webapp/…/build-queue.component.html - Introduced a new column buildSubmissionDate with sorting support (jhiSortBy).
- Removed the old submissionDate column in the finished build jobs table.

Sequence Diagram(s)

sequenceDiagram
    participant Service as LocalCIResultProcessingService
    participant Queue as resultQueue
    participant Logger

    Service->>+Service: processResult()
    Service->>+Service: getResultQueueBuildJobIds()
    Service->>+Queue: Iterate over ResultQueueItems
    Queue-->>-Service: Return list of build job IDs
    Service->>Logger: Log build job IDs
Loading

Possibly related PRs

Suggested labels

tests, server, client, bugfix, programming

Suggested reviewers

  • krusche
  • SimonEntholzer
  • EneaGore
  • coolchock
  • HawKhiem
✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

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

🧹 Nitpick comments (1)
src/main/java/de/tum/cit/aet/artemis/programming/service/localci/LocalCIResultProcessingService.java (1)

352-355: Optimize queue iteration performance.

The creation of a new ArrayList from the queue is unnecessary and could be inefficient for large queues. Consider streaming the queue directly.

-    private List<String> getResultQueueBuildJobIds() {
-        List<ResultQueueItem> resultQueueList = new ArrayList<>(resultQueue);
-        return resultQueueList.stream().map(i -> i.buildJobQueueItem().id()).toList();
+    private List<String> getResultQueueBuildJobIds() {
+        return resultQueue.stream().map(i -> i.buildJobQueueItem().id()).toList();
+    }
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between e3eaaa2 and af07113.

📒 Files selected for processing (2)
  • src/main/java/de/tum/cit/aet/artemis/programming/service/localci/LocalCIResultProcessingService.java (3 hunks)
  • src/main/webapp/app/localci/build-queue/build-queue.component.html (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
`src/main/java/**/*.java`: naming:CamelCase; principles:{sin...

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/LocalCIResultProcessingService.java
`src/main/webapp/**/*.html`: @if and @for are new and valid ...

src/main/webapp/**/*.html: @if and @for are new and valid Angular syntax replacing *ngIf and *ngFor. They should always be used over the old style.

  • src/main/webapp/app/localci/build-queue/build-queue.component.html
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: Call Build Workflow / Build and Push Docker Image
  • GitHub Check: Call Build Workflow / Build .war artifact
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: client-tests
  • GitHub Check: client-style
  • GitHub Check: server-style
  • GitHub Check: server-tests
  • GitHub Check: Analyse
🔇 Additional comments (2)
src/main/java/de/tum/cit/aet/artemis/programming/service/localci/LocalCIResultProcessingService.java (1)

144-144: LGTM! Improved logging readability.

The change improves code readability by extracting the queue ID mapping logic into a dedicated method.

src/main/webapp/app/localci/build-queue/build-queue.component.html (1)

491-494: LGTM! Consistent field naming.

The change aligns the sorting attribute with the actual field name, maintaining consistency with other build-related fields.

@krusche krusche added this to the 7.10.2 milestone Feb 18, 2025
@krusche krusche merged commit 0e85422 into develop Feb 18, 2025
30 of 33 checks passed
@krusche krusche deleted the bugfix/integrated-code-lifecycle/fix-issues-with-build-state branch February 18, 2025 16: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!) programming Pull requests that affect the corresponding module server Pull requests that update Java code. (Added Automatically!)
Projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

2 participants