Skip to content

Conversation

@FelixTJDietrich
Copy link
Collaborator

@FelixTJDietrich FelixTJDietrich commented Jan 23, 2026

Motivation and Context

Similar to PR #12003 for LTI, this change migrates the Athena module from using @Profile("athena") annotation to @Conditional(AthenaEnabled.class) with yml-based configuration (artemis.athena.enabled property).

This provides a more consistent and unified approach to feature configuration across the Artemis platform.

Description

This PR migrates the Athena module from Spring profile-based activation to a yml-based configuration using @Conditional.

Changes:

  • Added AthenaEnabled condition class that checks artemis.athena.enabled property
  • Replaced @Profile(PROFILE_ATHENA) with @Conditional(AthenaEnabled.class) in all Athena-related classes:
    • AthenaResource, AthenaInternalResource
    • AthenaApi, AthenaFeedbackApi
    • All Athena services: AthenaModuleService, AthenaFeedbackSendingService, AthenaFeedbackSuggestionsService, AthenaSubmissionSendingService, AthenaSubmissionSelectionService, AthenaDTOConverterService, AthenaRepositoryExportService, AthenaScheduleService
    • AthenaHealthIndicator, AthenaAuthorizationInterceptor
    • Athena RestTemplate beans in RestTemplateConfiguration
    • AthenaRequestMockProvider test component
  • Added artemis.athena.enabled: false property to application-core.yml
  • Updated ArtemisConfigHelper with isAthenaEnabled() method
  • Updated ModuleFeatureService with isAthenaEnabled() method
  • Updated test base classes to use property instead of profile
  • Moved Athena from profiles to modules in admin feature toggle UI
  • Updated translations for module feature display
  • Added MODULE_FEATURE_ATHENA constant

Special handling for AthenaScheduleService:
This service previously used @Profile("athena & scheduling"). It now uses both @Conditional(AthenaEnabled.class) and @Profile(PROFILE_SCHEDULING) to maintain the same behavior.

Steps for Testing

  1. Deploy with artemis.athena.enabled=true → Athena features should be available
  2. Deploy with artemis.athena.enabled=false (default) → Athena features should not be available
  3. Check admin feature toggle page shows Athena under "Module Features" instead of "Profile Features"
  4. Run tests to ensure all Athena-related tests still pass

Testserver States

Note

Tutors on test servers can't reset the database.

State Testserver
Unchecked ts1

Review Progress

Performance Review

  • Performance review not required

Code Review

  • Code Review 1
  • Code Review 2

Maintainer

Summary by Claude

This PR migrates the Athena module from Spring profile-based configuration (@Profile("athena")) to yml-based configuration using @Conditional(AthenaEnabled.class) and the artemis.athena.enabled property. This change aligns with the pattern established in PR #12003 for LTI and provides a more consistent configuration approach across the platform.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Refactor

    • Activation for Athena and Apollon moved from profile-based to runtime module-feature conditionals across backend and frontend.
  • New Features

    • New module feature flags for Athena and Apollon plus public APIs to query their enabled state.
  • UI / Localization

    • Admin feature toggle, feature lists, tests, and translations updated to show Athena and Apollon as module features and gate UI via module-feature checks.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 23, 2026

Walkthrough

Replaces profile-based activation for Athena and Apollon with custom Spring Conditions (AthenaEnabled, ApollonEnabled); introduces module-feature constants/properties and checks (MODULE_FEATURE_ATHENA, MODULE_FEATURE_APOLLON, artemis.athena.enabled, artemis.apollon.enabled); updates backend conditional annotations, new Athena-specific exception, frontend feature flags/UI, i18n, and tests.

Changes

Cohort / File(s) Summary
Core Conditions & Constants
src/main/java/.../athena/config/AthenaEnabled.java, src/main/java/.../modeling/config/ApollonEnabled.java, src/main/java/de/tum/cit/aet/artemis/core/config/Constants.java, src/main/java/de/tum/cit/aet/artemis/core/config/ArtemisConfigHelper.java
Add AthenaEnabled and ApollonEnabled condition classes; add MODULE_FEATURE_ATHENA/MODULE_FEATURE_APOLLON and ATHENA_ENABLED_PROPERTY_NAME/APOLLON_ENABLED_PROPERTY_NAME; add isAthenaEnabled/isApollonEnabled and include them in enabled-features aggregation.
Backend Conditional Annotations
src/main/java/.../athena/**/*, src/main/java/.../modeling/**/*, src/main/java/de/tum/cit/aet/artemis/core/config/RestTemplateConfiguration.java
Replace many `@Profile(PROFILE_ATHENA
Backend API availability / Exception
src/main/java/de/tum/cit/aet/artemis/athena/config/AthenaApiNotPresentException.java
Add AthenaApiNotPresentException to indicate Athena API absence tied to the ATHENA enabled property.
Backend callsites using new exception
src/main/java/.../modeling/service/ModelingExerciseFeedbackService.java, src/main/java/.../programming/service/ProgrammingExerciseCodeReviewFeedbackService.java, src/main/java/.../text/service/TextExerciseFeedbackService.java
Replace throws of ApiProfileNotPresentException (profile-based) with AthenaApiNotPresentException when Athena API is not present.
Module Feature Service
src/main/java/de/tum/cit/aet/artemis/core/service/ModuleFeatureService.java
Add isAthenaEnabled() and isApollonEnabled() delegating to ArtemisConfigHelper.
Frontend constants
src/main/webapp/app/app.constants.ts
Remove PROFILE_APOLLON/profile usage; add MODULE_FEATURE_ATHENA and MODULE_FEATURE_APOLLON; update ModuleFeature/ProfileFeature types.
Frontend feature checks & UI
src/main/webapp/app/** (assessment, course, admin, feedback-suggestion, programming lifecycle, settings, modeling, shared components)
Replace profile-based checks/imports (PROFILE_ATHENA/PROFILE_APOLLON and isProfileActive) with module-feature checks (MODULE_FEATURE_ATHENA/MODULE_FEATURE_APOLLON and isModuleFeatureActive); update admin UI lists and some internal flags (e.g., isApollonProfileActiveisApollonEnabled).
i18n feature toggles
src/main/webapp/i18n/de/featureToggles.json, src/main/webapp/i18n/en/featureToggles.json
Move Apollon/Athena entries from profiles to modules; add module entries for apollon and athena (name + description); remove Apollon from Iris profile.
Frontend & backend tests / test config
src/test/java/..., src/main/webapp/app/.../*.spec.ts (many)
Update tests to use activeModuleFeatures and MODULE_FEATURE_ATHENA/MODULE_FEATURE_APOLLON; adjust mocks/expectations; replace profile-based test annotations/usages with property-based flags and @Conditional where applicable.
Test mock providers
src/test/java/.../AthenaRequestMockProvider.java, src/test/java/.../ApollonRequestMockProvider.java
Switch provider class annotations from profile gates to conditional gates (add @Conditional(AthenaEnabled.class) / @Conditional(ApollonEnabled.class)); adjust profile annotations/imports as needed.
Minor comments / small refactors
src/main/java/.../DataExportExerciseCreationService.java, src/main/webapp/app/shared/detail-overview-list/*, src/main/webapp/app/shared/detail-overview-list/detail.model.ts
Update comments and internal flag/property names/types to reflect module-feature naming; small HTML/TS renames (no logic changes).

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 52.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title clearly summarizes the main change: migrating Athena from Spring profile-based activation to YAML/property-based configuration, which aligns with the comprehensive changeset across multiple files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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/development/migrate-athena-to-yml-configuration

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.

@github-actions github-actions bot added tests server Pull requests that update Java code. (Added Automatically!) client Pull requests that update TypeScript code. (Added Automatically!) config-change Pull requests that change the config in a way that they require a deployment via Ansible. athena Pull requests that affect the corresponding module core Pull requests that affect the corresponding module labels Jan 23, 2026
@FelixTJDietrich FelixTJDietrich changed the title Development: Migrate Athena from profile to yml configuration Development: Migrate Athena from profile to yml configuration Jan 23, 2026
@FelixTJDietrich FelixTJDietrich force-pushed the chore/development/migrate-athena-to-yml-configuration branch from d8ad84a to 4ec8863 Compare January 27, 2026 19:35
@FelixTJDietrich FelixTJDietrich requested a review from a team as a code owner January 27, 2026 19:35
@github-actions github-actions bot added assessment Pull requests that affect the corresponding module exercise Pull requests that affect the corresponding module programming Pull requests that affect the corresponding module labels Jan 27, 2026
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: 2

🤖 Fix all issues with AI agents
In
`@src/main/webapp/app/core/admin/features/admin-feature-toggle.component.spec.ts`:
- Line 15: The import list in admin-feature-toggle.component.spec.ts includes an
unused symbol MODULE_FEATURE_ATHENA; remove MODULE_FEATURE_ATHENA from the
import statement that currently reads "import { MODULE_FEATURE_ATHENA,
MODULE_FEATURE_ATLAS, MODULE_FEATURE_EXAM, PROFILE_IRIS } ..." so that only
MODULE_FEATURE_ATLAS, MODULE_FEATURE_EXAM, and PROFILE_IRIS remain, ensuring
there are no unused imports referenced in the test file.
- Line 111: The test assertion lengths are wrong: the component's ngOnInit
populates profileFeatures() from displayedProfiles (8 items) and
moduleFeatures() from displayedModuleFeatures (15 items), so update the spec to
assert the actual sizes (e.g., expect(comp.profileFeatures()).toHaveLength(8)
and expect(comp.moduleFeatures()).toHaveLength(15)) or, better, assert against
the source arrays (e.g.,
expect(comp.profileFeatures()).toHaveLength(component.displayedProfiles.length)
and
expect(comp.moduleFeatures()).toHaveLength(component.displayedModuleFeatures.length))
so the expectations stay correct if those arrays change.

import { MockTranslateService } from 'test/helpers/mocks/service/mock-translate.service';
import { MockProfileService } from 'test/helpers/mocks/service/mock-profile.service';
import { MODULE_FEATURE_ATLAS, MODULE_FEATURE_EXAM, PROFILE_ATHENA, PROFILE_IRIS } from 'app/app.constants';
import { MODULE_FEATURE_ATHENA, MODULE_FEATURE_ATLAS, MODULE_FEATURE_EXAM, PROFILE_IRIS } from 'app/app.constants';
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Remove unused import MODULE_FEATURE_ATHENA.

The static analysis correctly identifies that MODULE_FEATURE_ATHENA is imported but never used in this test file.

🔧 Proposed fix
-import { MODULE_FEATURE_ATHENA, MODULE_FEATURE_ATLAS, MODULE_FEATURE_EXAM, PROFILE_IRIS } from 'app/app.constants';
+import { MODULE_FEATURE_ATLAS, MODULE_FEATURE_EXAM, PROFILE_IRIS } from 'app/app.constants';
📝 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
import { MODULE_FEATURE_ATHENA, MODULE_FEATURE_ATLAS, MODULE_FEATURE_EXAM, PROFILE_IRIS } from 'app/app.constants';
import { MODULE_FEATURE_ATLAS, MODULE_FEATURE_EXAM, PROFILE_IRIS } from 'app/app.constants';
🧰 Tools
🪛 GitHub Check: client-tests-selected

[failure] 15-15:
'MODULE_FEATURE_ATHENA' is declared but its value is never read.

🤖 Prompt for AI Agents
In
`@src/main/webapp/app/core/admin/features/admin-feature-toggle.component.spec.ts`
at line 15, The import list in admin-feature-toggle.component.spec.ts includes
an unused symbol MODULE_FEATURE_ATHENA; remove MODULE_FEATURE_ATHENA from the
import statement that currently reads "import { MODULE_FEATURE_ATHENA,
MODULE_FEATURE_ATLAS, MODULE_FEATURE_EXAM, PROFILE_IRIS } ..." so that only
MODULE_FEATURE_ATLAS, MODULE_FEATURE_EXAM, and PROFILE_IRIS remain, ensuring
there are no unused imports referenced in the test file.

@github-project-automation github-project-automation bot moved this from Work In Progress to Ready For Review in Artemis Development Jan 27, 2026
@FelixTJDietrich FelixTJDietrich requested a review from a team as a code owner January 27, 2026 21:13
@github-actions github-actions bot added modeling Pull requests that affect the corresponding module text Pull requests that affect the corresponding module labels Jan 27, 2026
FelixTJDietrich and others added 6 commits January 27, 2026 22:35
This PR migrates the Apollon feature from Spring Profile to YML-based
configuration, consistent with the approach used for LTI and other modules.

Server Changes:
- Added MODULE_FEATURE_APOLLON and APOLLON_ENABLED_PROPERTY_NAME constants
- Added artemis.apollon.enabled: false to application-core.yml
- Added isApollonEnabled() method to ArtemisConfigHelper and ModuleFeatureService
- Created ApollonEnabled condition class for conditional bean loading
- Replaced @Profile(PROFILE_APOLLON) with @conditional(ApollonEnabled.class) in:
  - ApollonConversionResource
  - ApollonConversionService
  - ApollonHealthIndicator
  - ModelingApollonApi
  - RestTemplate beans (apollonRestTemplate, shortTimeoutApollonRestTemplate)

Client Changes:
- Added MODULE_FEATURE_APOLLON constant to app.constants.ts
- Removed PROFILE_APOLLON from ProfileFeature type
- Updated admin feature toggle to show Apollon in modules section
- Updated translations (EN/DE) to move Apollon from profiles to modules

Test Changes:
- Updated test base classes to use artemis.apollon.enabled=true property
- Updated ApollonRequestMockProvider to use @conditional(ApollonEnabled.class)
- Updated bean-instantiations.yml workflow

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Add artemis.apollon.enabled=true to the example configuration files
(application-artemis.yml) to make it clear to administrators how to
enable the Apollon PDF conversion feature.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Update translations and configuration comments to accurately describe
that the Apollon module feature only controls PDF export functionality,
not the modeling editor itself. Modeling exercises work normally without
Apollon enabled - only the export button is affected.

This prevents administrators from being misled into thinking disabling
Apollon would disable the entire modeling functionality.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
All docstrings and comments now accurately describe that:
- artemis.apollon.enabled only controls PDF export
- The modeling editor is controlled by artemis.modeling.enabled
- Disabling Apollon only affects the export button, not the editor

Updated files:
- ApollonEnabled.java: Clarified it's for PDF export only
- Constants.java: Updated MODULE_FEATURE_APOLLON and property docs
- ArtemisConfigHelper.java: Updated isApollonEnabled() javadoc
- ModuleFeatureService.java: Updated isApollonEnabled() javadoc
- DataExportExerciseCreationService.java: Fixed comment about "profile"

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Add ApollonEnabled to ignored classes in ModelingApiArchitectureTest
  (needed for RestTemplateConfiguration's conditional bean creation)
- Update admin-feature-toggle test counts:
  - Profile features: 10 -> 9 (PROFILE_APOLLON removed)
  - Module features: 13 -> 14 (MODULE_FEATURE_APOLLON added)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
This prevents the ApollonEnabled condition from being evaluated
during buildagent profile tests, which don't have the apollon.enabled
property configured. The condition should only be evaluated when
the core profile is active.

Follows the same pattern as AtlasMLRequestMockProvider.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Add artemis.apollon.enabled=false to application-buildagent.yml
- Add artemis.apollon.enabled=false to AbstractArtemisBuildAgentTest
- Add APOLLON_ENABLED_PROPERTY_NAME to ModuleFeatureInfoContributorTest
- Add MODULE_FEATURE_APOLLON to ModuleFeatureInfoContributorTest

This ensures the apollon property is properly configured for buildagent
tests and the ModuleFeatureInfoContributor unit tests.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
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: 5

🤖 Fix all issues with AI agents
In
`@src/main/java/de/tum/cit/aet/artemis/core/service/export/DataExportExerciseCreationService.java`:
- Around line 87-88: Update wording to consistently use the new "Apollon PDF
export" enablement model across DataExportExerciseCreationService: replace
occurrences of "apollon profile" or similar phrases in Javadoc, log messages,
and comments with "Apollon PDF export" or "Apollon PDF export enabled/disabled"
(references: the optional field modelingApollonApi and any Javadoc/logging
around the constructor and methods in DataExportExerciseCreationService,
including the block around lines 235-249). Ensure messages still clearly state
enabled vs. not enabled and adjust capitalization to match the existing "Apollon
PDF export" phrasing.

In `@src/main/webapp/app/core/admin/features/admin-feature-toggle.component.ts`:
- Around line 14-15: The displayedProfiles and profileDocumentationLinks arrays
still include PROFILE_ATHENA which is now represented by MODULE_FEATURE_ATHENA,
causing a duplicate/inactive Athena entry; remove PROFILE_ATHENA from
displayedProfiles and from profileDocumentationLinks (and any corresponding
references around the same component such as where PROFILE_ATHENA is used at
lines ~118-119 and ~166-167) so the UI and docs only reference
MODULE_FEATURE_ATHENA; ensure any display logic or tests that referenced
PROFILE_ATHENA are updated to use MODULE_FEATURE_ATHENA instead.

In `@src/main/webapp/i18n/en/featureToggles.json`:
- Around line 119-126: Remove the duplicate "athena" entry from the profiles
feature list in featureToggles.json: locate the JSON object with the "athena"
key under the profiles/features section and delete that object so Athena is only
defined as a module feature; ensure no other profile-scoped references remain
and that the adjacent "apollon" entry and JSON structure remain valid (commas,
braces) after removal.

In
`@src/test/java/de/tum/cit/aet/artemis/shared/base/AbstractSpringIntegrationIndependentTest.java`:
- Line 64: Remove the PROFILE_ATHENA constant from the `@ActiveProfiles`
annotation on the AbstractSpringIntegrationIndependentTest class so the
annotation no longer activates that profile; locate the `@ActiveProfiles`(...)
declaration in AbstractSpringIntegrationIndependentTest and delete
PROFILE_ATHENA from the array while leaving the other profile constants
unchanged.

In
`@src/test/java/de/tum/cit/aet/artemis/shared/base/AbstractSpringIntegrationJenkinsLocalVCTest.java`:
- Line 26: Remove PROFILE_ATHENA from the `@ActiveProfiles` annotation in
AbstractSpringIntegrationJenkinsLocalVCTest to avoid masking
`@Conditional`(AthenaEnabled.class) migrations; update the annotation on the class
(the `@ActiveProfiles` declaration referencing SPRING_PROFILE_TEST,
PROFILE_ARTEMIS, PROFILE_CORE, PROFILE_SCHEDULING, PROFILE_LOCALVC,
PROFILE_JENKINS, PROFILE_ATHENA) to omit PROFILE_ATHENA so tests rely on
property-based activation instead.
🧹 Nitpick comments (2)
src/test/java/de/tum/cit/aet/artemis/shared/base/AbstractSpringIntegrationJenkinsLocalVCBatchTest.java (1)

29-29: Remove PROFILE_ATHENA here to validate property‑based gating.
With artemis.athena.enabled=true already set below, keeping the profile can unintentionally load profile-specific config and hide leftover @Profile("athena") usage. Dropping it makes this test suite a better guard for the migration.

♻️ Suggested change
-@ActiveProfiles({ SPRING_PROFILE_TEST, PROFILE_ARTEMIS, PROFILE_CORE, PROFILE_SCHEDULING, PROFILE_LOCALVC, PROFILE_JENKINS, PROFILE_ATHENA, PROFILE_AEOLUS })
+@ActiveProfiles({ SPRING_PROFILE_TEST, PROFILE_ARTEMIS, PROFILE_CORE, PROFILE_SCHEDULING, PROFILE_LOCALVC, PROFILE_JENKINS, PROFILE_AEOLUS })
src/main/webapp/app/core/layouts/profiles/shared/profile.service.spec.ts (1)

3-3: Align fixture with module-feature activation.

Now that Athena/Apollon are module features, keeping PROFILE_ATHENA in activeProfiles can imply profile-based activation and mask regressions in profile handling. Consider removing it from the fixture (and its import).

♻️ Proposed update
-import { MODULE_FEATURE_APOLLON, MODULE_FEATURE_ATHENA, PROFILE_ATHENA, PROFILE_DEV, PROFILE_JENKINS, PROFILE_PROD } from 'app/app.constants';
+import { MODULE_FEATURE_APOLLON, MODULE_FEATURE_ATHENA, PROFILE_DEV, PROFILE_JENKINS, PROFILE_PROD } from 'app/app.constants';
@@
-    activeProfiles: [PROFILE_PROD, PROFILE_JENKINS, PROFILE_ATHENA],
+    activeProfiles: [PROFILE_PROD, PROFILE_JENKINS],

Also applies to: 92-94

Comment on lines +87 to 88
// we define the field as optional to allow the application to start even if Apollon PDF export is not enabled
private final Optional<ModelingApollonApi> modelingApollonApi;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Align Apollon wording with new enablement model.
The updated comment uses “PDF export not enabled”, but the Javadoc/logs below still refer to the “apollon profile”. Consider aligning those strings to avoid mixed terminology.

✅ Suggested wording cleanup
-     * Stores the modeling submission as pdf if the apollon profile is active and the apollon conversion service works, otherwise stores it as json file.
+     * Stores the modeling submission as pdf if the Apollon PDF export is enabled and the conversion service works, otherwise stores it as JSON file.

-            log.warn("Cannot include modeling submission content in data export as pdf because apollon profile is not active. Going to include the json file");
+            log.warn("Cannot include modeling submission content in data export as pdf because Apollon PDF export is not enabled. Going to include the JSON file");

Also applies to: 235-249

🤖 Prompt for AI Agents
In
`@src/main/java/de/tum/cit/aet/artemis/core/service/export/DataExportExerciseCreationService.java`
around lines 87 - 88, Update wording to consistently use the new "Apollon PDF
export" enablement model across DataExportExerciseCreationService: replace
occurrences of "apollon profile" or similar phrases in Javadoc, log messages,
and comments with "Apollon PDF export" or "Apollon PDF export enabled/disabled"
(references: the optional field modelingApollonApi and any Javadoc/logging
around the constructor and methods in DataExportExerciseCreationService,
including the block around lines 235-249). Ensure messages still clearly state
enabled vs. not enabled and adjust capitalization to match the existing "Apollon
PDF export" phrasing.

Comment on lines +14 to +15
MODULE_FEATURE_APOLLON,
MODULE_FEATURE_ATHENA,
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Avoid duplicate Athena entries in the admin feature list.

With Athena now a module feature, keeping PROFILE_ATHENA in the profile list/documentation can show a misleading inactive entry. Consider removing it from displayedProfiles and profileDocumentationLinks.

♻️ Proposed cleanup
@@
-    private readonly displayedProfiles: ProfileFeature[] = [
-        PROFILE_IRIS,
-        PROFILE_ATHENA,
+    private readonly displayedProfiles: ProfileFeature[] = [
+        PROFILE_IRIS,
         PROFILE_THEIA,
@@
-    private readonly profileDocumentationLinks: Partial<Record<ProfileFeature, string>> = {
-        [PROFILE_IRIS]: 'https://docs.artemis.tum.de/admin/extensions-setup#iris--pyris-setup-guide',
-        [PROFILE_ATHENA]: 'https://docs.artemis.tum.de/admin/extensions-setup#athena-service',
+    private readonly profileDocumentationLinks: Partial<Record<ProfileFeature, string>> = {
+        [PROFILE_IRIS]: 'https://docs.artemis.tum.de/admin/extensions-setup#iris--pyris-setup-guide',
         [PROFILE_THEIA]: 'https://docs.artemis.tum.de/developer/setup#run-the-server-via-a-run-configuration-in-intellij',

Also applies to: 118-119, 166-167

🤖 Prompt for AI Agents
In `@src/main/webapp/app/core/admin/features/admin-feature-toggle.component.ts`
around lines 14 - 15, The displayedProfiles and profileDocumentationLinks arrays
still include PROFILE_ATHENA which is now represented by MODULE_FEATURE_ATHENA,
causing a duplicate/inactive Athena entry; remove PROFILE_ATHENA from
displayedProfiles and from profileDocumentationLinks (and any corresponding
references around the same component such as where PROFILE_ATHENA is used at
lines ~118-119 and ~166-167) so the UI and docs only reference
MODULE_FEATURE_ATHENA; ensure any display logic or tests that referenced
PROFILE_ATHENA are updated to use MODULE_FEATURE_ATHENA instead.

Comment on lines 119 to 126
},
"athena": {
"name": "Athena (AI Assessment)",
"description": "Enables Athena ML-based automated feedback suggestions for text and programming exercises."
},
"apollon": {
"name": "Apollon PDF Export",
"description": "Enables PDF export of UML diagrams via the external Apollon conversion service. Modeling exercises work without this; only the export button is affected."
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Remove Athena from profile features to avoid duplicate/misleading listing.
Since Athena is now a module feature, keeping it under profiles (Lines 34-37) will show it twice and suggests profile-based activation.

🛠️ Proposed fix
             "profiles": {
                 "iris": {
                     "name": "Iris (AI Assistant)",
                     "description": "Enables the Iris AI virtual tutor powered by LLMs for personalized student support and code assistance."
                 },
-                "athena": {
-                    "name": "Athena (AI Assessment)",
-                    "description": "Enables Athena ML-based automated feedback suggestions for text and programming exercises."
-                },
                 "theia": {
                     "name": "Theia (Online IDE)",
                     "description": "Enables the Theia cloud-based IDE for programming exercises, allowing students to code in the browser."
                 },
🤖 Prompt for AI Agents
In `@src/main/webapp/i18n/en/featureToggles.json` around lines 119 - 126, Remove
the duplicate "athena" entry from the profiles feature list in
featureToggles.json: locate the JSON object with the "athena" key under the
profiles/features section and delete that object so Athena is only defined as a
module feature; ensure no other profile-scoped references remain and that the
adjacent "apollon" entry and JSON structure remain valid (commas, braces) after
removal.

// NOTE: we use a common set of active profiles to reduce the number of application launches during testing. This significantly saves time and memory!
// TODO: PROFILE_AEOLUS is bound to PROGRAMMING and LOCAL_VC and should not be active in an independent test context.
@ActiveProfiles({ SPRING_PROFILE_TEST, PROFILE_TEST_INDEPENDENT, PROFILE_ARTEMIS, PROFILE_CORE, PROFILE_SCHEDULING, PROFILE_ATHENA, PROFILE_APOLLON, PROFILE_IRIS, PROFILE_AEOLUS })
@ActiveProfiles({ SPRING_PROFILE_TEST, PROFILE_TEST_INDEPENDENT, PROFILE_ARTEMIS, PROFILE_CORE, PROFILE_SCHEDULING, PROFILE_ATHENA, PROFILE_IRIS, PROFILE_AEOLUS })
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Consider dropping PROFILE_ATHENA from @ActiveProfiles.
Line 64: with property-based enablement in place, the profile can hide remaining profile-gated beans.

Suggested change
-@ActiveProfiles({ SPRING_PROFILE_TEST, PROFILE_TEST_INDEPENDENT, PROFILE_ARTEMIS, PROFILE_CORE, PROFILE_SCHEDULING, PROFILE_ATHENA, PROFILE_IRIS, PROFILE_AEOLUS })
+@ActiveProfiles({ SPRING_PROFILE_TEST, PROFILE_TEST_INDEPENDENT, PROFILE_ARTEMIS, PROFILE_CORE, PROFILE_SCHEDULING, PROFILE_IRIS, PROFILE_AEOLUS })
📝 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
@ActiveProfiles({ SPRING_PROFILE_TEST, PROFILE_TEST_INDEPENDENT, PROFILE_ARTEMIS, PROFILE_CORE, PROFILE_SCHEDULING, PROFILE_ATHENA, PROFILE_IRIS, PROFILE_AEOLUS })
`@ActiveProfiles`({ SPRING_PROFILE_TEST, PROFILE_TEST_INDEPENDENT, PROFILE_ARTEMIS, PROFILE_CORE, PROFILE_SCHEDULING, PROFILE_IRIS, PROFILE_AEOLUS })
🤖 Prompt for AI Agents
In
`@src/test/java/de/tum/cit/aet/artemis/shared/base/AbstractSpringIntegrationIndependentTest.java`
at line 64, Remove the PROFILE_ATHENA constant from the `@ActiveProfiles`
annotation on the AbstractSpringIntegrationIndependentTest class so the
annotation no longer activates that profile; locate the `@ActiveProfiles`(...)
declaration in AbstractSpringIntegrationIndependentTest and delete
PROFILE_ATHENA from the array while leaving the other profile constants
unchanged.

@ResourceLock("AbstractSpringIntegrationJenkinsLocalVCTest")
// NOTE: we use a common set of active profiles to reduce the number of application launches during testing. This significantly saves time and memory!
@ActiveProfiles({ SPRING_PROFILE_TEST, PROFILE_ARTEMIS, PROFILE_CORE, PROFILE_SCHEDULING, PROFILE_LOCALVC, PROFILE_JENKINS, PROFILE_ATHENA, PROFILE_AEOLUS, PROFILE_APOLLON })
@ActiveProfiles({ SPRING_PROFILE_TEST, PROFILE_ARTEMIS, PROFILE_CORE, PROFILE_SCHEDULING, PROFILE_LOCALVC, PROFILE_JENKINS, PROFILE_ATHENA, PROFILE_AEOLUS })
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Consider dropping PROFILE_ATHENA from @ActiveProfiles.
Line 26: with property-based activation, keeping the profile can mask missed migrations to @Conditional(AthenaEnabled.class).

Suggested change
-@ActiveProfiles({ SPRING_PROFILE_TEST, PROFILE_ARTEMIS, PROFILE_CORE, PROFILE_SCHEDULING, PROFILE_LOCALVC, PROFILE_JENKINS, PROFILE_ATHENA, PROFILE_AEOLUS })
+@ActiveProfiles({ SPRING_PROFILE_TEST, PROFILE_ARTEMIS, PROFILE_CORE, PROFILE_SCHEDULING, PROFILE_LOCALVC, PROFILE_JENKINS, PROFILE_AEOLUS })
📝 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
@ActiveProfiles({ SPRING_PROFILE_TEST, PROFILE_ARTEMIS, PROFILE_CORE, PROFILE_SCHEDULING, PROFILE_LOCALVC, PROFILE_JENKINS, PROFILE_ATHENA, PROFILE_AEOLUS })
`@ActiveProfiles`({ SPRING_PROFILE_TEST, PROFILE_ARTEMIS, PROFILE_CORE, PROFILE_SCHEDULING, PROFILE_LOCALVC, PROFILE_JENKINS, PROFILE_AEOLUS })
🤖 Prompt for AI Agents
In
`@src/test/java/de/tum/cit/aet/artemis/shared/base/AbstractSpringIntegrationJenkinsLocalVCTest.java`
at line 26, Remove PROFILE_ATHENA from the `@ActiveProfiles` annotation in
AbstractSpringIntegrationJenkinsLocalVCTest to avoid masking
`@Conditional`(AthenaEnabled.class) migrations; update the annotation on the class
(the `@ActiveProfiles` declaration referencing SPRING_PROFILE_TEST,
PROFILE_ARTEMIS, PROFILE_CORE, PROFILE_SCHEDULING, PROFILE_LOCALVC,
PROFILE_JENKINS, PROFILE_ATHENA) to omit PROFILE_ATHENA so tests rely on
property-based activation instead.

FelixTJDietrich and others added 3 commits January 27, 2026 22:44
Similar to PR #12003 for LTI, this change migrates the Athena module
from using @Profile("athena") annotation to @conditional(AthenaEnabled.class)
with yml-based configuration (artemis.athena.enabled property).

This provides a more consistent and unified approach to feature configuration
across the Artemis platform.

Changes:
- Added AthenaEnabled condition class
- Replaced @Profile(PROFILE_ATHENA) with @conditional(AthenaEnabled.class)
- Added artemis.athena.enabled property to application-core.yml
- Updated ArtemisConfigHelper and ModuleFeatureService
- Updated RestTemplateConfiguration for Athena beans
- Updated test base classes to use property instead of profile
- Moved Athena from profiles to modules in admin feature toggle UI
- Updated translations for module feature display

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Client-side fixes:
- Migrate all PROFILE_ATHENA references to MODULE_FEATURE_ATHENA
- Change isProfileActive() calls to isModuleFeatureActive()
- Update test mocks to use activeModuleFeatures instead of activeProfiles
- Fix admin-feature-toggle test: 10->9 profiles, 13->14 module features

Server-side fixes:
- Add athena.enabled: false to application-buildagent.yml
- Add artemis.athena.enabled=false to AbstractArtemisBuildAgentTest
- Add ATHENA_ENABLED_PROPERTY_NAME and MODULE_FEATURE_ATHENA to
  ModuleFeatureInfoContributorTest

Files migrated from PROFILE_ATHENA to MODULE_FEATURE_ATHENA:
- athena.service.ts
- course-detail.component.ts
- course-update.component.ts
- request-feedback-button.component.ts (and spec)
- exercise-details-student-actions.component.ts
- external-data.guard.ts
- user-settings-container.component.spec.ts
- exercise-feedback-suggestion-options.component.ts (and spec)
- programming-exercise-lifecycle.component.ts
- admin-feature-toggle.component.spec.ts

Co-Authored-By: Claude Opus 4.5 <[email protected]>
…tion issues

- Add dedicated AthenaApiNotPresentException for proper error messages
- Update all Athena service files to use the new exception class
- Fix Apollon profile check to use module feature in modeling detail component

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@FelixTJDietrich FelixTJDietrich force-pushed the chore/development/migrate-athena-to-yml-configuration branch from 9aa3ef1 to 108bf9f Compare January 27, 2026 21:46
@github-actions
Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ✅SkippedFailedTime ⏱
End-to-End (E2E) Test Report1 ran1 passed0 skipped0 failed2s 121ms
TestResultTime ⏱
No test annotations available

@github-actions
Copy link

@FelixTJDietrich Your PR description needs attention before it can be reviewed:

Issues Found

  1. No checkboxes are checked in the PR description
  2. Screenshots are missing but this PR contains visual/UI changes

How to Fix

  • Check the boxes that apply to your changes in the Checklist section
  • Add screenshots of the UI changes.

This check validates that your PR description follows the PR template. A complete description helps reviewers understand your changes and speeds up the review process.

Note: This description validation is an experimental feature. If you observe false positives, please send a DM with a link to the wrong comment to Patrick Bassner on Slack. Thank you!

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

🤖 Fix all issues with AI agents
In `@src/main/webapp/app/core/layouts/profiles/shared/profile.service.spec.ts`:
- Line 3: The test fixture includes PROFILE_ATHENA in activeProfiles which is
misleading now that Athena is enabled via module flag; remove PROFILE_ATHENA
from any activeProfiles arrays in profile.service.spec.ts and update any
assertions that expect that profile to instead check the module flag
(MODULE_FEATURE_ATHENA) or the module-feature API path; search for the
activeProfiles fixture and occurrences around lines ~92-93 and replace
profile-based checks for Athena with checks against MODULE_FEATURE_ATHENA (or
mock the module flag) so tests reflect module-based enablement rather than a
legacy profile constant.
🧹 Nitpick comments (2)
src/test/java/de/tum/cit/aet/artemis/shared/base/AbstractSpringIntegrationJenkinsLocalVCTemplateTest.java (1)

29-29: Drop PROFILE_ATHENA to avoid masking missing migrations.
Since the test already enables Athena via properties, keeping the profile can hide leftover @Profile("athena") usage and reduce coverage of the new conditional path.

♻️ Suggested adjustment
-import static de.tum.cit.aet.artemis.core.config.Constants.PROFILE_ATHENA;
@@
-@ActiveProfiles({ SPRING_PROFILE_TEST, PROFILE_ARTEMIS, PROFILE_CORE, PROFILE_SCHEDULING, PROFILE_LOCALVC, PROFILE_JENKINS, PROFILE_ATHENA, PROFILE_AEOLUS })
+@ActiveProfiles({ SPRING_PROFILE_TEST, PROFILE_ARTEMIS, PROFILE_CORE, PROFILE_SCHEDULING, PROFILE_LOCALVC, PROFILE_JENKINS, PROFILE_AEOLUS })
src/test/java/de/tum/cit/aet/artemis/shared/base/AbstractSpringIntegrationJenkinsLocalVCBatchTest.java (1)

29-29: Consider removing PROFILE_ATHENA from @ActiveProfiles.

Same concern as the non-batch variant: with artemis.athena.enabled=true in @TestPropertySource, the profile becomes redundant and may hide incomplete migrations to @Conditional(AthenaEnabled.class).

Suggested change
-@ActiveProfiles({ SPRING_PROFILE_TEST, PROFILE_ARTEMIS, PROFILE_CORE, PROFILE_SCHEDULING, PROFILE_LOCALVC, PROFILE_JENKINS, PROFILE_ATHENA, PROFILE_AEOLUS })
+@ActiveProfiles({ SPRING_PROFILE_TEST, PROFILE_ARTEMIS, PROFILE_CORE, PROFILE_SCHEDULING, PROFILE_LOCALVC, PROFILE_JENKINS, PROFILE_AEOLUS })

import { TestBed } from '@angular/core/testing';
import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing';
import { PROFILE_APOLLON, PROFILE_ATHENA, PROFILE_DEV, PROFILE_JENKINS, PROFILE_PROD } from 'app/app.constants';
import { MODULE_FEATURE_APOLLON, MODULE_FEATURE_ATHENA, PROFILE_ATHENA, PROFILE_DEV, PROFILE_JENKINS, PROFILE_PROD } from 'app/app.constants';
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Align activeProfiles fixture with module-based Athena enablement.

If Athena is now only a module feature, keeping PROFILE_ATHENA in activeProfiles can mix activation models and make the fixture misleading. Consider removing it if the backend no longer exposes that profile.

🛠️ Suggested update
-import { MODULE_FEATURE_APOLLON, MODULE_FEATURE_ATHENA, PROFILE_ATHENA, PROFILE_DEV, PROFILE_JENKINS, PROFILE_PROD } from 'app/app.constants';
+import { MODULE_FEATURE_APOLLON, MODULE_FEATURE_ATHENA, PROFILE_DEV, PROFILE_JENKINS, PROFILE_PROD } from 'app/app.constants';

-    activeProfiles: [PROFILE_PROD, PROFILE_JENKINS, PROFILE_ATHENA],
+    activeProfiles: [PROFILE_PROD, PROFILE_JENKINS],

Also applies to: 92-93

🤖 Prompt for AI Agents
In `@src/main/webapp/app/core/layouts/profiles/shared/profile.service.spec.ts` at
line 3, The test fixture includes PROFILE_ATHENA in activeProfiles which is
misleading now that Athena is enabled via module flag; remove PROFILE_ATHENA
from any activeProfiles arrays in profile.service.spec.ts and update any
assertions that expect that profile to instead check the module flag
(MODULE_FEATURE_ATHENA) or the module-feature API path; search for the
activeProfiles fixture and occurrences around lines ~92-93 and replace
profile-based checks for Athena with checks against MODULE_FEATURE_ATHENA (or
mock the module flag) so tests reflect module-based enablement rather than a
legacy profile constant.

@github-actions
Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report223 ran221 passed1 skipped1 failed1h 46m 30s 831ms
TestResultTime ⏱
End-to-End (E2E) Test Report
e2e/exam/test-exam/TestExamTestRun.spec.ts
ts.Test exam test run › Manage a test run › Conducts a test run❌ failure2m 39s 687ms

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

Labels

assessment Pull requests that affect the corresponding module athena Pull requests that affect the corresponding module client Pull requests that update TypeScript code. (Added Automatically!) config-change Pull requests that change the config in a way that they require a deployment via Ansible. core Pull requests that affect the corresponding module exercise Pull requests that affect the corresponding module modeling Pull requests that affect the corresponding module programming Pull requests that affect the corresponding module server Pull requests that update Java code. (Added Automatically!) tests text Pull requests that affect the corresponding module

Projects

Status: Ready For Review

Development

Successfully merging this pull request may close these issues.

2 participants