Skip to content

Conversation

MaximilianAnzinger
Copy link
Collaborator

@MaximilianAnzinger MaximilianAnzinger commented Oct 10, 2025

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 added multiple integration tests (Spring) related to the features (with a high test coverage).
  • I added pre-authorization annotations according to the guidelines and checked the course groups for all new REST Calls (security).
  • 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 (e.g. using paging).
  • I strictly followed the principle of data economy for all client-server REST calls.
  • I strictly followed the client coding and design guidelines.
  • Following the theming guidelines, I specified colors only in the theming variable files and checked that the changes look consistent in both the light and the dark theme.
  • I added multiple integration tests (Jest) related to the features (with a high test coverage), while following the test guidelines.
  • I added authorities to all new routes and checked the course groups for displaying navigation elements (links, buttons).
  • I documented the TypeScript code using JSDoc style.
  • I added multiple 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).
  • I tested all changes and their related features with all corresponding user types on a test server configured with LocalVC and Jenkins.

Motivation and Context

Description

Steps for Testing

Prerequisites:

  • 1 Instructor
  • 2 Students
  • 1 Programming Exercise with Complaints enabled
  1. Log in to Artemis
  2. Navigate to Course Administration
  3. ...

Exam Mode Testing

Prerequisites:

  • 1 Instructor
  • 2 Students
  • 1 Exam with a Programming Exercise
  1. Log in to Artemis
  2. Participate in the exam as a student
  3. Make sure that the UI of the programming exercise in the exam mode stays unchanged. You can use the exam mode documentation as reference.
  4. ...

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

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

Exam Mode Test

  • Test 1
  • Test 2

Performance Tests

  • Test 1
  • Test 2

Test Coverage

Screenshots

Summary by CodeRabbit

  • Refactor
    • Migrated internal component and template queries to the latest Angular APIs for child references, aligning with current framework standards.
    • Updated access patterns to match the new query approach.
    • No changes to UI or user workflows; behavior remains consistent while improving forward-compatibility and maintainability.

@MaximilianAnzinger MaximilianAnzinger requested a review from a team as a code owner October 10, 2025 13:50
@github-project-automation github-project-automation bot moved this to Work In Progress in Artemis Development Oct 10, 2025
@github-actions github-actions bot added client Pull requests that update TypeScript code. (Added Automatically!) atlas Pull requests that affect the corresponding module labels Oct 10, 2025
Copy link
Contributor

coderabbitai bot commented Oct 10, 2025

Walkthrough

Refactors Angular query APIs: replaces decorator-based ViewChild/ContentChild with function-based viewChild/contentChild. Updates imports, declarations, and call sites accordingly in two components. No behavioral logic changes beyond accessing queried instances via callable wrappers.

Changes

Cohort / File(s) Summary
ViewChild to viewChild migration
src/main/webapp/app/atlas/manage/generate-competencies/generate-competencies.component.ts
Replaced @ViewChild property with readonly ... = viewChild.required(...); updated import to include viewChild; changed usages from this.courseDescriptionForm... to callable this.courseDescriptionForm()....
ContentChild to contentChild migration
src/main/webapp/app/atlas/shared/standardized-competencies/knowledge-area-tree.component.ts
Replaced @ContentChild properties with readonly ... = contentChild(...); updated core import to contentChild; no other logic changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly summarizes the main change—migrating decorators for content and view child—and directly reflects the modifications in the PR, making it clear and specific enough for a reviewer to understand the primary intent.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/atlas/migration

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@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: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between aed198f and da915a2.

📒 Files selected for processing (2)
  • src/main/webapp/app/atlas/manage/generate-competencies/generate-competencies.component.ts (3 hunks)
  • src/main/webapp/app/atlas/shared/standardized-competencies/knowledge-area-tree.component.ts (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
src/main/webapp/**/*.ts

⚙️ CodeRabbit configuration file

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

Files:

  • src/main/webapp/app/atlas/manage/generate-competencies/generate-competencies.component.ts
  • src/main/webapp/app/atlas/shared/standardized-competencies/knowledge-area-tree.component.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
  • GitHub Check: Build and Push Docker Image / Build linux/arm64 Docker Image for ls1intum/artemis
  • GitHub Check: Build and Push Docker Image / Build linux/amd64 Docker Image for ls1intum/artemis
  • GitHub Check: Build .war artifact
  • GitHub Check: client-style
  • GitHub Check: client-tests
  • GitHub Check: server-tests
  • GitHub Check: client-tests-selected
  • GitHub Check: server-style
  • GitHub Check: Analyse
🔇 Additional comments (4)
src/main/webapp/app/atlas/manage/generate-competencies/generate-competencies.component.ts (3)

1-1: LGTM!

The import correctly adds viewChild for the new signal-based query API.


74-74: LGTM!

The migration to viewChild.required() correctly replaces the non-optional @ViewChild decorator. Using readonly with the signal-based API is a best practice.


94-94: LGTM!

The usage correctly invokes the signal with () to access the component instance before calling its method.

src/main/webapp/app/atlas/shared/standardized-competencies/knowledge-area-tree.component.ts (1)

2-2: LGTM!

The import correctly adds contentChild and removes the ContentChild decorator for the signal-based API migration.

Comment on lines +21 to +22
readonly knowledgeAreaTemplate = contentChild(TemplateRef<{ knowledgeArea: KnowledgeAreaForTree }>);
readonly competencyTemplate = contentChild(TemplateRef<{ competency: StandardizedCompetencyForTree; knowledgeArea: KnowledgeAreaForTree }>);
Copy link
Contributor

@coderabbitai coderabbitai bot Oct 10, 2025

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Incorrect selector migration breaks template matching.

The original decorators used string selectors ('knowledgeAreaTemplate', 'competencyTemplate') to match specific template reference variables. The new code uses type-based selectors (TemplateRef<...>), which matches any projected TemplateRef of that type, not the specifically named template. This changes the matching behavior and could break the component if multiple templates are projected.

Apply this diff to preserve the original selector behavior:

-    readonly knowledgeAreaTemplate = contentChild(TemplateRef<{ knowledgeArea: KnowledgeAreaForTree }>);
-    readonly competencyTemplate = contentChild(TemplateRef<{ competency: StandardizedCompetencyForTree; knowledgeArea: KnowledgeAreaForTree }>);
+    readonly knowledgeAreaTemplate = contentChild<TemplateRef<{ knowledgeArea: KnowledgeAreaForTree }>>('knowledgeAreaTemplate');
+    readonly competencyTemplate = contentChild<TemplateRef<{ competency: StandardizedCompetencyForTree; knowledgeArea: KnowledgeAreaForTree }>>('competencyTemplate');
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
readonly knowledgeAreaTemplate = contentChild(TemplateRef<{ knowledgeArea: KnowledgeAreaForTree }>);
readonly competencyTemplate = contentChild(TemplateRef<{ competency: StandardizedCompetencyForTree; knowledgeArea: KnowledgeAreaForTree }>);
readonly knowledgeAreaTemplate = contentChild<TemplateRef<{ knowledgeArea: KnowledgeAreaForTree }>>('knowledgeAreaTemplate');
readonly competencyTemplate = contentChild<TemplateRef<{ competency: StandardizedCompetencyForTree; knowledgeArea: KnowledgeAreaForTree }>>('competencyTemplate');
🤖 Prompt for AI Agents
In
src/main/webapp/app/atlas/shared/standardized-competencies/knowledge-area-tree.component.ts
around lines 21-22, the ContentChild selectors were changed from string names to
type-based TemplateRef selectors which matches any TemplateRef and breaks
matching when multiple templates are projected; revert to using the original
string selectors (e.g. 'knowledgeAreaTemplate' and 'competencyTemplate') and use
the read option to obtain a TemplateRef with the appropriate generic types so
the decorator targets the specific template reference variable rather than any
TemplateRef.

Copy link
Contributor

@MarcosOlivaKaczmarek MarcosOlivaKaczmarek Oct 10, 2025

Choose a reason for hiding this comment

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

I wouldn't have caught it on my own, but I think we should make this change. Currently the build is failing because of this.

Copy link
Contributor

Choose a reason for hiding this comment

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

@MarcosOlivaKaczmarek, thank you for confirming! I'm glad this caught the issue before it could cause problems with template matching. The string selector approach will ensure the component continues to work correctly when templates are projected. 🐰


__   __

/ \ /
( •.• )

^ <
/| |
(| |)

Happy to help catch this one! 🥕

@github-project-automation github-project-automation bot moved this from Work In Progress to Ready For Review in Artemis Development Oct 10, 2025
Copy link
Contributor

@MarcosOlivaKaczmarek MarcosOlivaKaczmarek left a comment

Choose a reason for hiding this comment

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

Just that one small thing, apart from that, it looks great to me.

Comment on lines +21 to +22
readonly knowledgeAreaTemplate = contentChild(TemplateRef<{ knowledgeArea: KnowledgeAreaForTree }>);
readonly competencyTemplate = contentChild(TemplateRef<{ competency: StandardizedCompetencyForTree; knowledgeArea: KnowledgeAreaForTree }>);
Copy link
Contributor

@MarcosOlivaKaczmarek MarcosOlivaKaczmarek Oct 10, 2025

Choose a reason for hiding this comment

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

I wouldn't have caught it on my own, but I think we should make this change. Currently the build is failing because of this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

atlas Pull requests that affect the corresponding module client Pull requests that update TypeScript code. (Added Automatically!)

Projects

Status: Ready For Review
Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants