Skip to content

Conversation

@florian-glombik
Copy link
Contributor

@florian-glombik florian-glombik commented Jan 25, 2026

Checklist

General

Server

  • 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 documented the Java code using JavaDoc style.

Motivation and Context

@Nayer-kotry and @florian-glombik are going to develop a global keyword and semantic search within Artemis in the upcoming months.

After adding a general Setup for Weaviate in the Artemis environment in #11962, we do now integrate it into Artemis and configure a client that can communicate with Artemis.

This currently is a development only setup, not production ready.

Description

  • ⚠️ Added dependency for latests weaviate java client https://docs.weaviate.io/weaviate/release-notes, https://github.com/weaviate/java-client/releases
  • Added default configuration (disabled) for developers at application-dev.yml
  • Added failure analyzer for faulty weaviate configuration
  • Added failure analyzer in case weviate is active but the connection cannot be build
  • Added customization of DeferredEagerBeanInitializer.java, that allows to still use the FailureAnalyzer even, if the DeferredEagerBeanInitializer.java catches an exception
  • The actual added logic in this PR is mainly in WeaviateClientConfiguration.java (other changes are just just required to make it configurable right away)

Steps for Testing

⚠️ This PR needs to be tested locally and cannot be tested on a testserver

  1. Start the Artemis Server (sever is enough, you do not need the client)
  2. See that is starts up as ususal
  3. Now set artemis.weaviate.enabled to true in your application-local.yml
  4. Restart the server and see that the server startup fails shortly after the URL is printed
  5. You should see a nicely configured error message, hinting that the weaviate container might not be running
  6. Start the Weaviate container https://docs.artemis.tum.de/developer/weaviate-setup
  7. Restart the server, see that the server starts up properly now
  8. In the server logs you should find something like Connected to Weaviate at in the first 5-15 seconds after the URl was printed

Review Progress

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1

Test Coverage

Server

Class/File Line Coverage Lines
ConfigurationValidator.java 43.59% 149
DeferredEagerBeanInitializer.java 43.40% 108
WeaviateClientConfiguration.java 93.33% 42
WeaviateConfigurationProperties.java 76.92% 32
WeaviateConfigurationException.java 100.00% 16
WeaviateConnectionException.java 100.00% 30
WeaviateConfigurationFailureAnalyzer.java 100.00% 37
WeaviateConnectionFailureAnalyzer.java 100.00% 49

Last updated: 2026-01-27 12:45:37 UTC

Screenshots

Summary by CodeRabbit

  • New Features

    • Optional Weaviate vector-database integration with configurable host/port/gRPC and secure mode; startup validation for Weaviate settings.
    • Enhanced startup diagnostics that emit structured failure reports with actionable guidance for configuration and connectivity issues.
  • Documentation

    • Updated Weaviate setup docs and configuration examples; added environment variable and CLI enablement options.
  • Tests

    • Added comprehensive unit tests for configuration, client creation, exceptions, failure analyzers, and startup initializer behavior.
  • Chores

    • Added Weaviate client dependency, explicit Gson version, and Gradle property to pin the client version.

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

- Add WeaviateConfigurationProperties for configuration management
- Add WeaviateClientConfiguration for client bean creation
- Add WeaviateService for basic operations
- Add Weaviate Java client v6 dependency to build.gradle
- Configure Weaviate settings in application.yml (disabled by default)
- Enable Weaviate in application-dev.yml for development
- Add configuration properties test
- Support both secure and non-secure connections
- Use gRPC port for better performance
@github-project-automation github-project-automation bot moved this to Work In Progress in Artemis Development Jan 25, 2026
@github-actions github-actions bot added tests server Pull requests that update Java 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 labels Jan 25, 2026
@github-actions
Copy link

@florian-glombik Test coverage could not be fully measured because some tests failed. Please check the workflow logs for details.

@florian-glombik florian-glombik added this to the 8.8.0 milestone Jan 25, 2026
…e-configuration

# Conflicts:
#	src/main/java/de/tum/cit/aet/artemis/core/config/ConfigurationValidator.java
#	src/main/resources/META-INF/spring.factories
@github-actions
Copy link

@florian-glombik Test coverage could not be fully measured because some tests failed. Please check the workflow logs for details.

@github-actions
Copy link

@florian-glombik Test coverage could not be fully measured because some tests failed. Please check the workflow logs for details.

@github-actions
Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report223 ran220 passed1 skipped2 failed1h 45m 22s 400ms
TestResultTime ⏱
End-to-End (E2E) Test Report
e2e/exam/ExamTestRun.spec.ts
ts.Exam test run › Delete a test run › Deletes a test run❌ failure3m 9s 612ms
e2e/exercise/modeling/ModelingExerciseManagement.spec.ts
ts.Modeling Exercise Management › Create Modeling Exercise › Create a new modeling exercise❌ failure1m 57s 825ms

@github-actions
Copy link

@florian-glombik Test coverage could not be fully measured because some tests failed. Please check the workflow logs for details.

@florian-glombik florian-glombik changed the title Development: Add weaviate setting to configuration Development: Add weaviate client on startup when configured Jan 25, 2026
@github-actions
Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report223 ran219 passed2 skipped2 failed1h 45m 46s 807ms
TestResultTime ⏱
End-to-End (E2E) Test Report
e2e/exercise/modeling/ModelingExerciseManagement.spec.ts
ts.Modeling Exercise Management › Create Modeling Exercise › Create a new modeling exercise❌ failure1m 48s 757ms
e2e/exam/ExamAssessment.spec.ts
ts.Exam assessment › Text exercise assessment › Complaints about text exercises assessment❌ failure4m 24s 153ms

coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 26, 2026
coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 26, 2026
@github-actions
Copy link

@florian-glombik Test coverage has been automatically updated in the PR description.

@github-actions
Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report223 ran220 passed1 skipped2 failed1h 48m 21s 121ms
TestResultTime ⏱
End-to-End (E2E) Test Report
e2e/exam/ExamTestRun.spec.ts
ts.Exam test run › Delete a test run › Deletes a test run❌ failure3m 8s 880ms
e2e/exam/test-exam/TestExamParticipation.spec.ts
ts.Test exam participation › Early Hand-in › Using exercise overview to navigate within exam❌ failure4m 23s 376ms

@florian-glombik florian-glombik changed the title Development: Add weaviate client on startup when weaviate is configured Development: Add weaviate client configuration Jan 27, 2026
coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 27, 2026
@github-actions
Copy link

@florian-glombik Test coverage has been automatically updated in the PR description.

@github-actions
Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ✅Skipped ⚠️FailedTime ⏱
End-to-End (E2E) Test Report223 ran222 passed1 skipped0 failed1h 33m 28s 116ms
TestResultTime ⏱
No test annotations available

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.

Code looks good overall, just some questions and an optional readability improvement

@github-actions
Copy link

@florian-glombik Test coverage has been automatically updated in the PR description.

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.

Code LGTM

Copy link
Contributor

@jerrycai0006 jerrycai0006 left a comment

Choose a reason for hiding this comment

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

Code LGTM

Copy link
Contributor

@SamuelRoettgermann SamuelRoettgermann left a comment

Choose a reason for hiding this comment

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

code review

*/
@Lazy
@Configuration
@ConditionalOnProperty(prefix = "artemis.weaviate", name = "enabled", havingValue = "true")
Copy link
Contributor

Choose a reason for hiding this comment

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

Why use this over the common pattern:

@Conditional(WeaviateEnabled.class)

You'd need to add the WeaviateEnabled class, check other, similar @Conditional usages to see how it's usually implemented

*
* @param enabled whether Weaviate integration is enabled
* @param host the Weaviate server host
* @param port the Weaviate HTTP port
Copy link
Contributor

Choose a reason for hiding this comment

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

I would call this httpPort to make the distinction to the grpcPort more immediately obvious.

Comment on lines +22 to +26
private static final String DEFAULT_HOST = "localhost";

private static final int DEFAULT_HTTP_PORT = 8001;

private static final int DEFAULT_GRPC_PORT = 50051;
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd much prefer if these values were loaded from the respective config file, rather than being hardcoded. Imagine we want to change this in the future, adapt it in the config file, but forget to change it here... this will lead to confusion, pretty sure

Comment on lines +45 to +51
private static final int MIN_PORT = 1;

private static final int MAX_PORT = 65535;

public static final String HTTP_SCHEME = "http";

public static final String HTTPS_SCHEME = "https";
Copy link
Contributor

Choose a reason for hiding this comment

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

Again I'd much prefer if these were loaded from some config file. Sure, the HTTP[S]_SCHEME may not be required here, but the min and max ports probably should be

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We are loading the values from the config file - these are just static constants for comparison and validation reasons

Max and Min port are statically defined values https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers

    public ConfigurationValidator(Environment environment,
            @Value("${" + Constants.PASSKEY_REQUIRE_FOR_ADMINISTRATOR_FEATURES_PROPERTY_NAME + ":false}") boolean isPasskeyRequiredForAdministratorFeatures,
            @Value("${artemis.user-management.internal-admin.username:#{null}}") String internalAdminUsername,
            @Value("${artemis.user-management.internal-admin.password:#{null}}") String internalAdminPassword, @Value("${artemis.weaviate.enabled:false}") boolean weaviateEnabled,
            @Value("${artemis.weaviate.host:#{null}}") String weaviateHost, @Value("${artemis.weaviate.port:8080}") int weaviatePort,
            @Value("${artemis.weaviate.grpc-port:50051}") int weaviateGrpcPort, @Value("${artemis.weaviate.scheme:#{null}}") String weaviateScheme) {
        this.environment = environment;
        this.artemisConfigHelper = new ArtemisConfigHelper();
        this.isPasskeyRequiredForAdministratorFeatures = isPasskeyRequiredForAdministratorFeatures;

        this.internalAdminUsername = internalAdminUsername;
        this.internalAdminPassword = internalAdminPassword;

        this.weaviateEnabled = weaviateEnabled;
        this.weaviateHost = weaviateHost;
        this.weaviatePort = weaviatePort;
        this.weaviateGrpcPort = weaviateGrpcPort;
        this.weaviateScheme = weaviateScheme;
    }

Comment on lines +8 to +13
/**
* FailureAnalyzer that provides helpful error messages when the Weaviate configuration is invalid.
* This analyzer catches {@link WeaviateConfigurationException} and formats it into a user-friendly message
* with both a description of the problem and recommended actions to fix it.
*/
public class WeaviateConfigurationFailureAnalyzer extends AbstractFailureAnalyzer<WeaviateConfigurationException> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should probably add a conditional so this is only enabled when Weaviate is also enabled

*/
class WeaviateConfigurationFailureAnalyzerTest {

private final WeaviateConfigurationFailureAnalyzer analyzer = new WeaviateConfigurationFailureAnalyzer();
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be done via @Autowired?

Comment on lines +69 to +70
assertThat(analysis.getAction()).contains("enabled: true");
assertThat(analysis.getAction()).contains("enabled: false");
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a very confusing test. Why does it require the action to contain both enabled: true and enabled: false? You should probably simplify this test, or comment what you are testing here exactly

*/
class WeaviateConnectionFailureAnalyzerTest {

private final WeaviateConnectionFailureAnalyzer analyzer = new WeaviateConnectionFailureAnalyzer();
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not with @Autowired?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm a bit sceptical about these tests, because they do really just "ensure" that you can't majorly edit the descriptive texts

@github-actions
Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report223 ran219 passed1 skipped3 failed1h 46m 48s 683ms
TestResultTime ⏱
End-to-End (E2E) Test Report
e2e/course/CourseMessages.spec.ts
ts.Course messages › Channel messages › Write/edit/delete message in channel › Student should be able to write message in channel❌ failure2m 20s 548ms
e2e/exam/ExamTestRun.spec.ts
ts.Exam test run › Delete a test run › Deletes a test run❌ failure3m 7s 452ms
e2e/exam/test-exam/TestExamParticipation.spec.ts
ts.Test exam participation › Early Hand-in › Using exercise overview to navigate within exam❌ failure4m 28s 838ms

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

Labels

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 docker documentation ready for review server Pull requests that update Java code. (Added Automatically!) tests

Projects

Status: Ready For Review

Development

Successfully merging this pull request may close these issues.

5 participants