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

Assessment: Do not display automatic as additional feedback in the online code editor #10120

Merged
merged 8 commits into from
Jan 12, 2025

Conversation

LeonWehrhahn
Copy link
Contributor

@LeonWehrhahn LeonWehrhahn commented Jan 9, 2025

Checklist

General

Client

  • 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 multiple screenshots/screencasts of my UI changes.

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

The previous implementation of getUnreferencedFeedback() returned unreferenced feedback of type MANUAL_UNREFERENCED and of type AUTOMATIC. Since some parts of the application expected to only receive unreferenced feedback of type MANUAL_UNREFERENCED, AUTOMATIC unreferenced feedback was displayed in places where it was not expected.

Description

This PR introduces two new functions:

  • getManualUnreferencedFeedback: Returns only unreferenced feedback of type MANUAL_UNREFERENCED
  • getAutomaticUnreferencedFeedback: Returns only unreferenced feedback of type AUTOMATIC

The code was updated accordingly to use the appropriate functions.

Steps for Testing

Prerequisites:

  • 1 Instructor
  • 1 Students
  • 1 Programming Exercise

Instructor:

  1. Create a programming exercise with test cases

Student: Programming

  1. Start and submit the programming exercise in the integrated Online Code Editor
  2. Check that there is no Additional Feedback shown below the Build Output, or that if Additional Feedback is shown, the feedback only includes non-automatic feedback (no test case feedback)

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

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Screenshots

UI before PR changes

The unreferenced Automatic Feedback (In this case, test cases) is displayed in the Additional Feedback section, which is not the intended behavior.

image

UI after PR changes

The unreferenced Automatic Feedback is now not displayed anymore in the Additional Feedback section.

image

Summary by CodeRabbit

  • Refactor

    • Updated feedback retrieval mechanism across multiple exercise components.
    • Separated manual and automatic unreferenced feedback processing.
    • Replaced generic getUnreferencedFeedback with more specific getManualUnreferencedFeedback and getAutomaticUnreferencedFeedback functions.
  • Tests

    • Updated test cases to reflect new feedback retrieval logic and adjusted expected behaviors for feedback requests.
    • Modified feedback types in tests to align with new classifications of manual and automatic feedback.

@LeonWehrhahn LeonWehrhahn requested a review from a team as a code owner January 9, 2025 17:38
@github-actions github-actions bot added tests client Pull requests that update TypeScript code. (Added Automatically!) labels Jan 9, 2025
Copy link

coderabbitai bot commented Jan 9, 2025

Walkthrough

This pull request introduces changes to the feedback retrieval mechanism across multiple exercise components. The primary modification involves replacing the generic getUnreferencedFeedback utility function with two specialized functions: getManualUnreferencedFeedback and getAutomaticUnreferencedFeedback. These changes are implemented in the result utilities and subsequently updated in file upload, modeling, programming, and text exercise components. The refactoring aims to provide more precise feedback filtering by separating manual and automatic unreferenced feedback types.

Changes

File Change Summary
src/main/webapp/app/exercises/shared/result/result.utils.ts Removed generic getUnreferencedFeedback and added two new functions: getManualUnreferencedFeedback and getAutomaticUnreferencedFeedback
src/main/webapp/app/exercises/.../file-upload/participate/file-upload-submission.component.ts, src/main/webapp/app/exercises/.../programming/participate/code-editor-student-container.component.ts, src/main/webapp/app/exercises/.../text/participate/text-editor.component.ts Updated import from getUnreferencedFeedback to getManualUnreferencedFeedback
src/main/webapp/app/exercises/modeling/participate/modeling-submission.component.ts Updated import from getUnreferencedFeedback to getAutomaticUnreferencedFeedback
src/test/javascript/spec/component/utils/result.utils.spec.ts Updated test cases to use getManualUnreferencedFeedback and added tests for getAutomaticUnreferencedFeedback
src/test/java/de/tum/cit/aet/artemis/exercise/participation/ParticipationIntegrationTest.java Modified verification of broadcastNewResult method calls from once to twice in specific test methods
src/test/javascript/spec/component/modeling-submission/modeling-submission.component.spec.ts Updated feedback type in the test suite from FeedbackType.MANUAL_UNREFERENCED to FeedbackType.AUTOMATIC
src/test/javascript/spec/component/modeling-submission/modeling-submission-team.component.spec.ts Updated feedback type in the test suite from FeedbackType.MANUAL_UNREFERENCED to FeedbackType.AUTOMATIC

Possibly related PRs

Suggested Labels

bugfix, assessment, refactoring

Suggested Reviewers

  • EneaGore
  • az108
  • krusche
  • coolchock
  • b-fein

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 (3)
src/test/javascript/spec/component/utils/result.utils.spec.ts (1)

23-24: Test case needs additional coverage.

While the test case correctly verifies manual unreferenced feedback filtering, it should be expanded to cover more scenarios:

  1. Empty feedback array
  2. Array with only automatic unreferenced feedback
  3. Array with mixed manual and automatic unreferenced feedback
-    it('should filter out all non unreferenced feedbacks', () => {
-        const feedbacks = [{ reference: 'foo' }, { reference: 'foo', type: FeedbackType.MANUAL_UNREFERENCED }, { type: FeedbackType.MANUAL_UNREFERENCED }, {}];
-        const unreferencedFeedbacks = getManualUnreferencedFeedback(feedbacks);
-        expect(unreferencedFeedbacks).toEqual([{ type: FeedbackType.MANUAL_UNREFERENCED }]);
-    });
+    describe('getManualUnreferencedFeedback', () => {
+        it('should return undefined for undefined input', () => {
+            expect(getManualUnreferencedFeedback(undefined)).toBeUndefined();
+        });
+
+        it('should return empty array for empty input', () => {
+            expect(getManualUnreferencedFeedback([])).toEqual([]);
+        });
+
+        it('should filter out all non-manual unreferenced feedbacks', () => {
+            const feedbacks = [
+                { reference: 'foo' },
+                { reference: 'foo', type: FeedbackType.MANUAL_UNREFERENCED },
+                { type: FeedbackType.MANUAL_UNREFERENCED },
+                { type: FeedbackType.AUTOMATIC },
+                {}
+            ];
+            expect(getManualUnreferencedFeedback(feedbacks)).toEqual([
+                { type: FeedbackType.MANUAL_UNREFERENCED }
+            ]);
+        });
+
+        it('should handle array with only automatic unreferenced feedback', () => {
+            const feedbacks = [
+                { type: FeedbackType.AUTOMATIC },
+                { type: FeedbackType.AUTOMATIC }
+            ];
+            expect(getManualUnreferencedFeedback(feedbacks)).toEqual([]);
+        });
+    });
src/main/webapp/app/exercises/shared/result/result.utils.ts (1)

119-133: Consider enhancing error handling and input validation.

While the implementation is correct, consider adding input validation for edge cases:

  1. Handle malformed feedback objects (missing type property)
  2. Add type guards for better type safety
+interface ValidFeedback extends Feedback {
+    type: FeedbackType;
+}
+
+function isValidFeedback(feedback: Feedback): feedback is ValidFeedback {
+    return 'type' in feedback;
+}
+
 export const getManualUnreferencedFeedback = (feedbacks: Feedback[] | undefined): Feedback[] | undefined => {
-    return feedbacks ? feedbacks.filter((feedbackElement) => !feedbackElement.reference && feedbackElement.type === FeedbackType.MANUAL_UNREFERENCED) : undefined;
+    return feedbacks?.filter((feedbackElement): feedbackElement is ValidFeedback => 
+        isValidFeedback(feedbackElement) && !feedbackElement.reference && feedbackElement.type === FeedbackType.MANUAL_UNREFERENCED
+    );
 };

 export const getAutomaticUnreferencedFeedback = (feedbacks: Feedback[] | undefined): Feedback[] | undefined => {
-    return feedbacks ? feedbacks.filter((feedbackElement) => !feedbackElement.reference && feedbackElement.type === FeedbackType.AUTOMATIC) : undefined;
+    return feedbacks?.filter((feedbackElement): feedbackElement is ValidFeedback => 
+        isValidFeedback(feedbackElement) && !feedbackElement.reference && feedbackElement.type === FeedbackType.AUTOMATIC
+    );
 };
src/main/webapp/app/exercises/modeling/participate/modeling-submission.component.ts (1)

666-668: Consider documenting the feedback type selection rationale.

The codebase now uses different types of feedback for different exercise types:

  • Text exercises: Manual feedback
  • Modeling exercises: Automatic feedback

Consider adding documentation to explain this architectural decision, making it easier for future developers to understand why different feedback types are used for different exercise types.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 1798b25 and 7b54b4b.

📒 Files selected for processing (6)
  • src/main/webapp/app/exercises/file-upload/participate/file-upload-submission.component.ts (2 hunks)
  • src/main/webapp/app/exercises/modeling/participate/modeling-submission.component.ts (2 hunks)
  • src/main/webapp/app/exercises/programming/participate/code-editor-student-container.component.ts (2 hunks)
  • src/main/webapp/app/exercises/shared/result/result.utils.ts (1 hunks)
  • src/main/webapp/app/exercises/text/participate/text-editor.component.ts (2 hunks)
  • src/test/javascript/spec/component/utils/result.utils.spec.ts (2 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
src/main/webapp/app/exercises/file-upload/participate/file-upload-submission.component.ts (1)

Pattern src/main/webapp/**/*.ts: angular_style:https://angular.io/guide/styleguide;methods_in_html:false;lazy_loading:true;code_reuse:true;tests:meaningful;types:PascalCase;enums:PascalCase;funcs:camelCase;props:camelCase;no_priv_prefix:true;strings:single_quotes;localize:true;btns:functionality;links:navigation;icons_text:newline;labels:associate;code_style:arrow_funcs,curly_braces,open_braces_same_line,indent_4;memory_leak_prevention:true;routes:naming_schema;chart_framework:ngx-charts;responsive_layout:true

src/main/webapp/app/exercises/programming/participate/code-editor-student-container.component.ts (1)

Pattern src/main/webapp/**/*.ts: angular_style:https://angular.io/guide/styleguide;methods_in_html:false;lazy_loading:true;code_reuse:true;tests:meaningful;types:PascalCase;enums:PascalCase;funcs:camelCase;props:camelCase;no_priv_prefix:true;strings:single_quotes;localize:true;btns:functionality;links:navigation;icons_text:newline;labels:associate;code_style:arrow_funcs,curly_braces,open_braces_same_line,indent_4;memory_leak_prevention:true;routes:naming_schema;chart_framework:ngx-charts;responsive_layout:true

src/test/javascript/spec/component/utils/result.utils.spec.ts (1)

Pattern src/test/javascript/spec/**/*.ts: jest: true; mock: NgMocks; bad_practices: avoid_full_module_import; perf_improvements: mock_irrelevant_deps; service_testing: mock_http_for_logic; no_schema: avoid_NO_ERRORS_SCHEMA; expectation_specificity: true; solutions: {boolean: toBeTrue/False, reference: toBe, existence: toBeNull/NotNull, undefined: toBeUndefined, class_obj: toContainEntries/toEqual, spy_calls: {not_called: not.toHaveBeenCalled, once: toHaveBeenCalledOnce, with_value: toHaveBeenCalledWith|toHaveBeenCalledExactlyOnceWith}}

src/main/webapp/app/exercises/text/participate/text-editor.component.ts (1)

Pattern src/main/webapp/**/*.ts: angular_style:https://angular.io/guide/styleguide;methods_in_html:false;lazy_loading:true;code_reuse:true;tests:meaningful;types:PascalCase;enums:PascalCase;funcs:camelCase;props:camelCase;no_priv_prefix:true;strings:single_quotes;localize:true;btns:functionality;links:navigation;icons_text:newline;labels:associate;code_style:arrow_funcs,curly_braces,open_braces_same_line,indent_4;memory_leak_prevention:true;routes:naming_schema;chart_framework:ngx-charts;responsive_layout:true

src/main/webapp/app/exercises/modeling/participate/modeling-submission.component.ts (1)

Pattern src/main/webapp/**/*.ts: angular_style:https://angular.io/guide/styleguide;methods_in_html:false;lazy_loading:true;code_reuse:true;tests:meaningful;types:PascalCase;enums:PascalCase;funcs:camelCase;props:camelCase;no_priv_prefix:true;strings:single_quotes;localize:true;btns:functionality;links:navigation;icons_text:newline;labels:associate;code_style:arrow_funcs,curly_braces,open_braces_same_line,indent_4;memory_leak_prevention:true;routes:naming_schema;chart_framework:ngx-charts;responsive_layout:true

src/main/webapp/app/exercises/shared/result/result.utils.ts (1)

Pattern src/main/webapp/**/*.ts: angular_style:https://angular.io/guide/styleguide;methods_in_html:false;lazy_loading:true;code_reuse:true;tests:meaningful;types:PascalCase;enums:PascalCase;funcs:camelCase;props:camelCase;no_priv_prefix:true;strings:single_quotes;localize:true;btns:functionality;links:navigation;icons_text:newline;labels:associate;code_style:arrow_funcs,curly_braces,open_braces_same_line,indent_4;memory_leak_prevention:true;routes:naming_schema;chart_framework:ngx-charts;responsive_layout:true

⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: client-tests-selected
  • GitHub Check: client-tests
  • GitHub Check: Build and Push Docker Image
  • GitHub Check: server-tests
  • GitHub Check: Build .war artifact
  • GitHub Check: Analyse
🔇 Additional comments (11)
src/main/webapp/app/exercises/programming/participate/code-editor-student-container.component.ts (2)

17-17: LGTM! Import statement updated correctly.

The import statement has been updated to use the new getManualUnreferencedFeedback function, which aligns with the PR objective of separating manual and automatic feedback.


163-163: LGTM! Getter implementation updated correctly.

The unreferencedFeedback getter now specifically retrieves manual unreferenced feedback, which is the correct behavior for this component as it should only display manual feedback to students.

src/test/javascript/spec/component/utils/result.utils.spec.ts (1)

4-4: LGTM! Import statement updated correctly.

The import statement has been updated to include the new getManualUnreferencedFeedback function.

src/main/webapp/app/exercises/file-upload/participate/file-upload-submission.component.ts (2)

25-25: LGTM! Import statement updated correctly.

The import statement has been updated to use the new getManualUnreferencedFeedback function.


250-250: LGTM! Getter implementation updated correctly.

The unreferencedFeedback getter now specifically retrieves manual unreferenced feedback, which is the correct behavior for this component.

src/main/webapp/app/exercises/shared/result/result.utils.ts (2)

119-125: LGTM! Manual feedback utility function implemented correctly.

The getManualUnreferencedFeedback function is well-implemented with clear documentation and proper type safety.


127-133: LGTM! Automatic feedback utility function implemented correctly.

The getAutomaticUnreferencedFeedback function is well-implemented with clear documentation and proper type safety.

src/main/webapp/app/exercises/text/participate/text-editor.component.ts (2)

23-23: LGTM! Import statement updated to use the new feedback utility function.

The change aligns with the PR objectives to separate manual and automatic feedback retrieval.


315-315: LGTM! Updated to use manual feedback retrieval.

The getter now correctly returns only manual unreferenced feedback, which is appropriate for text exercises.

src/main/webapp/app/exercises/modeling/participate/modeling-submission.component.ts (2)

18-18: LGTM! Import statement updated to use the new feedback utility function.

The change aligns with the PR objectives to separate manual and automatic feedback retrieval.


667-667: LGTM! Updated to use automatic feedback retrieval.

The getter now correctly returns only automatic unreferenced feedback, which is appropriate for modeling exercises.

coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 9, 2025
@github-actions github-actions bot added the exercise Pull requests that affect the corresponding module label Jan 9, 2025
coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 9, 2025
@LeonWehrhahn LeonWehrhahn changed the title General: Refactor feedback utility functions to separate manual and automatic General: Refactor feedback utility functions to separate manual and automatic Jan 9, 2025
coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 9, 2025
Copy link

⚠️ Unable to deploy to test servers ⚠️

Testserver "artemis-test1.artemis.cit.tum.de" is already in use by PR #10114.

@github-actions github-actions bot added the deployment-error Added by deployment workflows if an error occured label Jan 10, 2025
Copy link

@HawKhiem HawKhiem 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 TS1.

  1. No Additional Feedback is shown
    image

  2. I'm not quite sure how to prompt Athena to generate a feedback, should we also tick the checkbox "Allow automatic AI preliminary feedback requests"? I did that and try to request AI feedback and got the following error

image
image

@LeonWehrhahn
Copy link
Contributor Author

LeonWehrhahn commented Jan 11, 2025

Tested on TS1.

  1. I'm not quite sure how to prompt Athena to generate a feedback, should we also tick the checkbox "Allow automatic AI preliminary feedback requests"? I did that and try to request AI feedback and got the following error

We are currently having difficulties with Athena TS1; normally, having "Allow automatic Al preliminary feedback requests" checked enables student feedback generation. However, Athena TS1 is currently not working - so feedback won't be generated on this test server.

However, the following tests, should verify that also unreferenced AUTOMATIC Feedback is still working for modeling exercises. Please take a look at those and verify that they are correct - as an alternative check, as Athena TS1 will probably need a couple of days till its running again.

result.utils.spec.ts:

  • should filter out all non unreferenced feedbacks that do not have type MANUAL_UNREFERENCED
  • should filter out all non unreferenced feedbacks that do not have type AUTOMATIC

modeling-submission.component.spec.ts:

  • should mark the subsequent feedback

modeling-submission-team.component.spec.ts

  • should mark the subsequent feedback

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 (2)
src/test/javascript/spec/component/utils/result.utils.spec.ts (2)

22-32: Consider enhancing test coverage with additional edge cases

The test case effectively verifies the basic functionality of getManualUnreferencedFeedback. However, consider adding:

  1. Edge cases for null/undefined feedbacks
  2. Type assertions for the test data
 it('should filter out all non unreferenced feedbacks that do not have type MANUAL_UNREFERENCED', () => {
     const feedbacks = [
         { reference: 'foo' },
         { reference: 'foo', type: FeedbackType.MANUAL_UNREFERENCED },
         { type: FeedbackType.AUTOMATIC },
         { type: FeedbackType.MANUAL_UNREFERENCED },
         {},
+        null,
+        undefined,
     ] as Feedback[];
     const unreferencedFeedbacks = getManualUnreferencedFeedback(feedbacks);
-    expect(unreferencedFeedbacks).toEqual([{ type: FeedbackType.MANUAL_UNREFERENCED }]);
+    expect(unreferencedFeedbacks).toContainEqual<Feedback>({ type: FeedbackType.MANUAL_UNREFERENCED });
+    expect(unreferencedFeedbacks).toHaveLength(1);
 });

34-44: Apply similar enhancements to automatic feedback test

For consistency with the manual feedback test improvements, consider enhancing this test case with the same patterns:

  1. Edge cases for null/undefined feedbacks
  2. Type assertions for the test data
 it('should filter out all non unreferenced feedbacks that do not have type AUTOMATIC', () => {
     const feedbacks = [
         { reference: 'foo' },
         { reference: 'foo', type: FeedbackType.AUTOMATIC },
         { type: FeedbackType.AUTOMATIC },
         { type: FeedbackType.MANUAL_UNREFERENCED },
         {},
+        null,
+        undefined,
     ] as Feedback[];
     const unreferencedFeedbacks = getAutomaticUnreferencedFeedback(feedbacks);
-    expect(unreferencedFeedbacks).toEqual([{ type: FeedbackType.AUTOMATIC }]);
+    expect(unreferencedFeedbacks).toContainEqual<Feedback>({ type: FeedbackType.AUTOMATIC });
+    expect(unreferencedFeedbacks).toHaveLength(1);
 });
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 7081eac and 4096f0b.

📒 Files selected for processing (1)
  • src/test/javascript/spec/component/utils/result.utils.spec.ts (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
src/test/javascript/spec/component/utils/result.utils.spec.ts (1)

Pattern src/test/javascript/spec/**/*.ts: jest: true; mock: NgMocks; bad_practices: avoid_full_module_import; perf_improvements: mock_irrelevant_deps; service_testing: mock_http_for_logic; no_schema: avoid_NO_ERRORS_SCHEMA; expectation_specificity: true; solutions: {boolean: toBeTrue/False, reference: toBe, existence: toBeNull/NotNull, undefined: toBeUndefined, class_obj: toContainEntries/toEqual, spy_calls: {not_called: not.toHaveBeenCalled, once: toHaveBeenCalledOnce, with_value: toHaveBeenCalledWith|toHaveBeenCalledExactlyOnceWith}}

⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: client-tests-selected
  • GitHub Check: client-tests
  • GitHub Check: server-tests
  • GitHub Check: Build and Push Docker Image
  • GitHub Check: Build .war artifact
  • GitHub Check: Analyse
🔇 Additional comments (2)
src/test/javascript/spec/component/utils/result.utils.spec.ts (2)

4-5: LGTM! Clear and well-organized imports

The new imports for getAutomaticUnreferencedFeedback and getManualUnreferencedFeedback are properly organized and clearly named.


22-44: Verify test coverage aligns with PR objectives

The test suite effectively covers the separation of manual and automatic unreferenced feedback, which aligns with the PR's main objective. The test cases verify that:

  1. Manual unreferenced feedback is correctly filtered
  2. Automatic unreferenced feedback is correctly filtered

This satisfies the requirement to "verify the correctness of the unreferenced AUTOMATIC feedback" as mentioned in the PR objectives.

✅ Verification successful

Test coverage is comprehensive and aligns with implementation

The test cases adequately cover the functionality of both feedback filtering functions, matching their actual usage across multiple components in the codebase. The tests verify all essential scenarios including mixed feedback types, referenced/unreferenced items, and empty objects. The implementation is straightforward, and no edge cases are left uncovered.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Verify test coverage for feedback-related functions
jest --coverage --collectCoverageFrom="**/result.utils.ts" --testPathPattern="result.utils.spec.ts"

Length of output: 194


Script:

#!/bin/bash
# Find the implementation file
fd result.utils.ts

# Get the implementation of feedback filtering functions
ast-grep --pattern 'export function getManualUnreferencedFeedback($_) { $$$ }'
ast-grep --pattern 'export function getAutomaticUnreferencedFeedback($_) { $$$ }'

# Look for other usages of these functions
rg "getManualUnreferencedFeedback|getAutomaticUnreferencedFeedback" -A 2

Length of output: 5829

@LeonWehrhahn LeonWehrhahn requested a review from HawKhiem January 11, 2025 18:20
Copy link
Contributor

@ahmetsenturk ahmetsenturk 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 TS1 and checked the tests on bamboo. Works as described

Copy link
Contributor

@EneaGore EneaGore left a comment

Choose a reason for hiding this comment

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

code

Copy link
Member

@BBesrour BBesrour left a comment

Choose a reason for hiding this comment

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

Code

Copy link

@vinceclifford vinceclifford 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 TS1, works as expected.

@krusche krusche changed the title General: Refactor feedback utility functions to separate manual and automatic Assessment: Do not display automatic as manual feedback in the online code editor Jan 12, 2025
@krusche krusche added this to the 7.8.3 milestone Jan 12, 2025
Copy link
Member

@krusche krusche left a comment

Choose a reason for hiding this comment

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

code looks good 👍

@krusche krusche merged commit fda9e65 into develop Jan 12, 2025
41 of 46 checks passed
@krusche krusche deleted the bugfix/unreferenced-feedback-filtering branch January 12, 2025 12:29
@krusche krusche changed the title Assessment: Do not display automatic as manual feedback in the online code editor Assessment: Do not display automatic as additional feedback in the online code editor Jan 12, 2025
N0W0RK pushed a commit that referenced this pull request Jan 14, 2025
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!) exercise Pull requests that affect the corresponding module ready to merge tests
Projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

7 participants