Skip to content

Hyperion: Prepare service for Artemis integration #176

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

Merged
merged 32 commits into from
Jun 27, 2025

Conversation

FelixTJDietrich
Copy link
Contributor

@FelixTJDietrich FelixTJDietrich commented Jun 17, 2025

Description

  • Add sync_proto_artemis script to copy the proto file to the Artemis repo
  • Renamed grpc script to generate-proto
  • Rename VerifyConfiguration servicer to ReviewAndRefine and add RewriteProblemStatement RPC
  • Simplify compose and docker setup
  • Add mTLS for security
  • Remove Traefik proxy
  • Refactor to standardized health check (and remove unused project_meta.py)
  • Remove playground check_health.py
  • Add Artemis hyperion.code-workspace as sibling repository path for convenience

Note

We are no longer publishing a dependency the proto file is synchronized to the Artemis repo via a script

Summary by CodeRabbit

  • New Features

    • Introduced support for TLS and mutual TLS (mTLS) for secure gRPC communication, with new configuration options and a certificate generation script.
    • Added a new gRPC service, "ReviewAndRefine," including an AI-powered method to rewrite programming exercise problem statements.
    • Released a Java gRPC client library with Maven and GitHub Packages publishing, dynamic versioning, and comprehensive usage documentation.
    • Added Docker Compose files for streamlined local and production deployments, including health checks and environment configuration.
  • Improvements

    • Enhanced server reliability with dynamic service registration, official gRPC health checks, TLS support, and graceful shutdown handling.
    • Expanded and clarified documentation, including setup, TLS configuration, Java client integration, and deployment instructions.
    • Upgraded gRPC dependencies and protobuf runtime to latest versions for improved compatibility.
  • Bug Fixes

    • Updated dependencies for improved compatibility and security.
  • Chores

    • Simplified and consolidated deployment workflows and Docker Compose configurations.
    • Improved environment variable templates and example files for easier setup.
    • Refined Dockerfile for better build and runtime efficiency.
    • Added GitHub Actions workflow for Java client CI/CD with versioning and publishing automation.
  • Removals

    • Removed legacy health check service, related protobuf messages, and client scripts.
    • Deleted unused project metadata and redundant Docker Compose files.

- Introduced build_java_client.py for building the Java gRPC client.
- Added README.md for Java client usage and setup instructions.
- Created build.gradle for Java project configuration.
- Included gradle wrapper files for easier Gradle management.
- Updated .gitignore to exclude build artifacts and generated proto files.
- Enhanced pyproject.toml to include build-java-client command.
- Updated grpcio and grpcio-tools to version 1.73.0 in pyproject.toml.
- Added grpcio-health-checking dependency for enhanced health checking.
- Introduced a new script (generate-certs.sh) for generating self-signed TLS certificates for Hyperion gRPC service, including CA and server/client certificates for development/testing.
@FelixTJDietrich FelixTJDietrich requested review from a team as code owners June 17, 2025 16:49
Copy link
Contributor

coderabbitai bot commented Jun 17, 2025

Warning

Rate limit exceeded

@FelixTJDietrich has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 15 minutes and 41 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 7159cb4 and eb06a8e.

📒 Files selected for processing (10)
  • hyperion/.gitignore (1 hunks)
  • hyperion/README.md (5 hunks)
  • hyperion/app/creation_steps/step8_review_and_refine/models.py (1 hunks)
  • hyperion/app/creation_steps/step8_review_and_refine/prompts.py (1 hunks)
  • hyperion/app/grpc/hyperion_pb2.py (3 hunks)
  • hyperion/app/grpc/hyperion_pb2.pyi (2 hunks)
  • hyperion/app/grpc/hyperion_pb2_grpc.py (12 hunks)
  • hyperion/app/protos/hyperion.proto (3 hunks)
  • hyperion/app/scripts/sync_proto_artemis.py (1 hunks)
  • hyperion/pyproject.toml (2 hunks)

Walkthrough

This update introduces significant changes to the Hyperion project, focusing on production readiness, enhanced security, and improved developer workflows. Key updates include the removal of custom health checks in favor of standard gRPC health checking, the addition of TLS/mTLS support with certificate management, a refactored gRPC server with graceful shutdown, and the introduction of a Java client library with automated CI/CD for publishing. Docker Compose and workflow files were streamlined, and new protobuf messages and services were added for advanced problem statement rewriting.

Changes

File(s) / Path(s) Change Summary
.github/workflows/hyperion_deploy-test.yml
.github/workflows/hyperion_deploy-with-helios.yml
Simplified deployment workflows: removed conditional deploy flags, merged jobs, updated Docker Compose paths, and eliminated proxy deployment.
.github/workflows/hyperion_java-client_publish.yml Added a new CI/CD workflow for building, testing, and publishing the Java client to Maven Central and GitHub Packages with dynamic versioning and summaries.
hyperion.code-workspace Simplified workspace folder paths, added Artemis folder, and updated Java configuration.
hyperion/Dockerfile Switched to Debian slim base, added TLS health probe, non-root user, simplified build, and changed entrypoint to direct Python execution.
hyperion/README.md Major rewrite: added features, setup, TLS instructions, Java client integration, usage examples, and mermaid diagrams.
hyperion/app/grpc/hyperion_pb2.py
hyperion/app/grpc/hyperion_pb2.pyi
hyperion/app/grpc/hyperion_pb2_grpc.py
hyperion/app/protos/hyperion.proto
Updated protobufs: removed Health service/messages, renamed VerifyConfiguration to ReviewAndRefine, added RewriteProblemStatement RPC/messages, updated Java package, regenerated Python stubs, and removed PingRequest/Response.
hyperion/app/creation_steps/step8_review_and_refine/models.py
hyperion/app/creation_steps/step8_review_and_refine/prompts.py
hyperion/app/creation_steps/step8_review_and_refine/servicer.py
Added models and prompt for problem statement rewriting, implemented new ReviewAndRefineServicer with RewriteProblemStatement RPC.
hyperion/app/main.py Refactored gRPC server: dynamic service registration, TLS/mTLS support, graceful shutdown, signal handling, improved logging, and health checking integration.
hyperion/app/settings.py Added TLS config fields, validators for cert/key/CA paths, and a computed GRPC_ADDRESS property.
hyperion/compose.yaml
hyperion/compose.local.yaml
Introduced new Docker Compose files: single app service, TLS/mTLS support, health checks using grpc_health_probe, updated environment variables, and logging.
hyperion/scripts/generate-certs.sh New script to generate self-signed TLS and mTLS certificates for development and testing.
hyperion/.env.example
hyperion/java-client/.env.example
Added TLS/mTLS environment variable examples for server and Java client credential templates.
hyperion/java-client/pom.xml
hyperion/java-client/settings.xml
hyperion/java-client/.gitignore
Added new Maven project for Java gRPC client, with dynamic versioning, publishing profiles, and credential management.
hyperion/docker/compose.hyperion.yaml
hyperion/docker/compose.hyperion.local.yaml
hyperion/docker/compose.proxy.yaml
Removed legacy Docker Compose files for Hyperion and proxy services.
hyperion/app/health/servicer.py
hyperion/app/project_meta.py
hyperion/playground/check_health.py
Removed custom health servicer, project metadata loader, and playground health check script.
hyperion/pyproject.toml Upgraded grpcio dependencies, added grpcio-health-checking, and removed health-check script entry point.

Sequence Diagram(s)

Review and Refine Service: Rewrite Problem Statement Flow

sequenceDiagram
    participant Client
    participant gRPC Server
    participant ReviewAndRefineServicer
    participant LanguageModel

    Client->>gRPC Server: RewriteProblemStatement(request)
    gRPC Server->>ReviewAndRefineServicer: Forward request
    ReviewAndRefineServicer->>LanguageModel: Generate rewritten text (with prompt)
    LanguageModel-->>ReviewAndRefineServicer: Rewritten text
    ReviewAndRefineServicer-->>gRPC Server: RewriteProblemStatementResponse
    gRPC Server-->>Client: Response (rewritten problem statement)
Loading

gRPC Server Startup with TLS and Health Checking

sequenceDiagram
    participant OS/Container
    participant GrpcServer
    participant HealthServicer

    OS/Container->>GrpcServer: Start process
    GrpcServer->>GrpcServer: Read settings (TLS, cert paths, etc.)
    GrpcServer->>GrpcServer: Register services
    GrpcServer->>HealthServicer: Register health checking
    GrpcServer->>GrpcServer: Configure TLS/mTLS (if enabled)
    GrpcServer->>GrpcServer: Start server, listen on port
    Note over GrpcServer: Wait for requests, handle signals for graceful shutdown
Loading

Poem

In the warren, code hops anew,
With TLS and health checks too!
Java clients leap with pride,
Secure and swift, they now reside.
Compose files trimmed, the garden neat—
Hyperion’s heart skips a beat!
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @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 anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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

🔭 Outside diff range comments (1)
hyperion/README.md (1)

71-72: Update Docker Compose references

The README still points to the old docker/compose.hyperion.yaml and docker/compose.proxy.yaml. Since these were replaced by hyperion/compose.yaml (and hyperion/compose.local.yaml for local dev), please update all cd docker and docker compose -f ... commands accordingly.

Also applies to: 83-85, 157-158

🧹 Nitpick comments (18)
hyperion/java-client/.gitignore (1)

1-10: Extend ignore list to cover common IDE / OS artefacts

proto/ and Gradle artefacts are covered, but you may want to add the usual suspects (.idea/, *.iml, *.DS_Store, etc.) to avoid accidental commits from contributors using different tooling.

hyperion/app/settings.py (1)

18-23: TLS paths should be Path objects – not plain strings

Using pathlib.Path for the three file locations removes the need for repeated casting in validators and downstream code.

-    TLS_CERT_PATH: str = ""
-    TLS_KEY_PATH: str = ""
-    TLS_CA_PATH: str = ""  # For client certificate verification
+    TLS_CERT_PATH: Path = Path("")
+    TLS_KEY_PATH: Path = Path("")
+    TLS_CA_PATH: Path = Path("")  # For client certificate verification
hyperion/java-client/settings.gradle (1)

1-1: Avoid name clash with the root project

If the repository’s top-level Gradle build is ever executed, having two independent projects both called hyperion will create confusion and break IDE import.
Consider renaming to something unique, e.g.:

-rootProject.name = 'hyperion'
+rootProject.name = 'hyperion-java-client'
hyperion/pyproject.toml (1)

22-24: Pin grpcio* trio to the exact same version

You already upgraded to 1.73.0; keep them in lock-step during future bumps to avoid ABI mismatches (native wheels are compiled per minor). A single variable or Poetry extras can help.

No action required now—just a reminder.

hyperion/app/grpc/hyperion_pb2_grpc.py (1)

1-325: Heads-up: large generated file checked into VCS

hyperion_pb2_grpc.py is pure generated code (~300 lines added/removed). Keeping generated artefacts in the repo quickly causes merge noise and bloats diffs. Consider:

• add it to .gitignore,
• build it in CI / the Docker image instead.

hyperion/compose.local.yaml (2)

1-11: Missing final newline – YAML-Lint error

The file violates new-line-at-end-of-file. Many editors show this as a warning and some CI pipelines fail linting.

-      - .env
+      - .env
+

5-9: Optional: mount source for live-reload while developing

For local development you typically want code changes to be reflected immediately without rebuilding the image.

     build:
       context: ..
       dockerfile: hyperion/Dockerfile
+    volumes:
+      - ..:/workspace:cached  # mount source tree read-only or cached
hyperion/app/grpc/hyperion_pb2.pyi (1)

5-6: Nit: unused import aliases

_Iterable and _Mapping are referenced, but _Union isn’t after the health-service deletion. You can drop the import to silence type-checkers.

-from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union
+from typing import ClassVar as _ClassVar, Optional as _Optional
.github/workflows/hyperion_deploy-test.yml (1)

19-19: Add newline at end of file

YAMLlint reports a missing newline at EOF. Please append a blank line to satisfy the linter.

hyperion/compose.yaml (2)

14-14: Remove trailing whitespace

Line 14 has unnecessary spaces at end; please trim them.


20-20: Remove trailing whitespace

Line 20 has unnecessary spaces at end; please trim them.

hyperion/README.md (1)

17-17: Fix typo in "Poetry"

Correct "Install Peotry" to "Install Poetry".

hyperion/scripts/generate-certs.sh (2)

8-15: Expose validity & output dir as CLI flags

CERT_DIR, DOMAIN, and DAYS are hard-coded. Turning them into getopt/flag parameters would let CI pipelines reuse the script without edits.

-DAYS=365
+DAYS="${2:-365}"

A small getopt block would keep backward compatibility.


68-74: Consider encrypting private keys or restricting fs traversal

All *.key files are world-readable until chmod runs; moving the chmod immediately after key generation (or generating to a tmp dir and mv) minimises the window where weak permissions exist.
If the keys ever leave the dev machine, consider -aes256 or -aes128 on genrsa.

hyperion/Dockerfile (2)

4-9: Trim build deps after poetry install to slim image

gcc & friends remain in the final layer. Either switch to a multi-stage build or run:

RUN apt-get purge -y --auto-remove gcc libpq-dev && \
    apt-get clean && rm -rf /var/lib/apt/lists/*

after dependency compilation to cut ~120 MB.


11-15: Verify grpc_health_probe binary before executing

Blind wget can introduce supply-chain risk.
Fetch checksum and validate or pin the exact commit hash.

RUN wget -q https://.../grpc_health_probe-linux-amd64.sha256 && \
    echo "$(cat *.sha256)  /bin/grpc_health_probe" | sha256sum -c - && \
    chmod +x /bin/grpc_health_probe
hyperion/java-client/build.gradle (1)

24-25: javax.annotation-api is obsolete on Java 17

The module is included in JDK ≥ 9. Dropping the dependency avoids warnings.

-    implementation 'javax.annotation:javax.annotation-api:1.3.2'
hyperion/app/main.py (1)

136-139: Health service name should be fully-qualified

gRPC health convention expects the full package + service name (package.Service).
Using just DefineBoundaryCondition may cause false NOT_FOUND results when clients probe.

Consider:

service_name = f"{hyperion_pb2.DESCRIPTOR.package}.{service_name}"
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4b00f13 and b59c74a.

⛔ Files ignored due to path filters (2)
  • hyperion/java-client/gradle/wrapper/gradle-wrapper.jar is excluded by !**/*.jar
  • hyperion/poetry.lock is excluded by !**/*.lock
📒 Files selected for processing (27)
  • .github/workflows/hyperion_deploy-test.yml (1 hunks)
  • .github/workflows/hyperion_deploy-with-helios.yml (1 hunks)
  • hyperion.code-workspace (1 hunks)
  • hyperion/Dockerfile (1 hunks)
  • hyperion/README.md (4 hunks)
  • hyperion/app/grpc/hyperion_pb2.py (4 hunks)
  • hyperion/app/grpc/hyperion_pb2.pyi (1 hunks)
  • hyperion/app/grpc/hyperion_pb2_grpc.py (1 hunks)
  • hyperion/app/health/servicer.py (0 hunks)
  • hyperion/app/main.py (2 hunks)
  • hyperion/app/project_meta.py (0 hunks)
  • hyperion/app/protos/hyperion.proto (0 hunks)
  • hyperion/app/settings.py (4 hunks)
  • hyperion/compose.local.yaml (1 hunks)
  • hyperion/compose.yaml (1 hunks)
  • hyperion/docker/compose.hyperion.local.yaml (0 hunks)
  • hyperion/docker/compose.hyperion.yaml (0 hunks)
  • hyperion/docker/compose.proxy.yaml (0 hunks)
  • hyperion/java-client/.gitignore (1 hunks)
  • hyperion/java-client/build.gradle (1 hunks)
  • hyperion/java-client/gradle/wrapper/gradle-wrapper.properties (1 hunks)
  • hyperion/java-client/gradlew (1 hunks)
  • hyperion/java-client/gradlew.bat (1 hunks)
  • hyperion/java-client/settings.gradle (1 hunks)
  • hyperion/playground/check_health.py (0 hunks)
  • hyperion/pyproject.toml (1 hunks)
  • hyperion/scripts/generate-certs.sh (1 hunks)
💤 Files with no reviewable changes (7)
  • hyperion/app/protos/hyperion.proto
  • hyperion/docker/compose.hyperion.yaml
  • hyperion/docker/compose.hyperion.local.yaml
  • hyperion/docker/compose.proxy.yaml
  • hyperion/playground/check_health.py
  • hyperion/app/project_meta.py
  • hyperion/app/health/servicer.py
🧰 Additional context used
🪛 YAMLlint (1.37.1)
hyperion/compose.local.yaml

[error] 11-11: no new line character at the end of file

(new-line-at-end-of-file)

hyperion/compose.yaml

[error] 14-14: trailing spaces

(trailing-spaces)


[error] 20-20: trailing spaces

(trailing-spaces)

.github/workflows/hyperion_deploy-test.yml

[error] 19-19: no new line character at the end of file

(new-line-at-end-of-file)

🪛 Ruff (0.11.9)
hyperion/app/main.py

202-202: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling

(B904)

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Hyperion / Build linux/amd64 Docker Image for ghcr.io/ls1intum/edutelligence/hyperion
  • GitHub Check: Hyperion / Build linux/arm64 Docker Image for ghcr.io/ls1intum/edutelligence/hyperion
🔇 Additional comments (9)
.github/workflows/hyperion_deploy-with-helios.yml (1)

23-31: Verify compose-file path is correct inside the Helios runner

docker-compose-file: "./hyperion/compose.yaml" assumes the checkout path equals the repository root.
If Helios checks out into a sub-path or you later move the compose file, the deployment will silently break. Double-check with a dry-run (the Helios docs accept either absolute or ${{ github.workspace }}-relative paths).

hyperion/java-client/gradle/wrapper/gradle-wrapper.properties (1)

1-7: ```shell
#!/bin/bash

Follow redirects and print the final HTTP status for the Gradle 8.14 distribution

curl -sI -L https://services.gradle.org/distributions/gradle-8.14-bin.zip
| grep -i "^HTTP/"
| tail -n 1


</details>
<details>
<summary>hyperion.code-workspace (1)</summary>

`4-18`: **Path to the new “Artemis” folder depends on repo layout**

The added folder path `"../Artemis"` presumes the Hyperion repo is checked out next to Artemis.  
If someone opens the workspace from a different location (e.g. CI, container, a mono-repo), VS Code will complain that the folder cannot be resolved.


Either document this assumption in the CONTRIBUTING guide or guard it via a `${env:…}` variable.

</details>
<details>
<summary>hyperion/app/grpc/hyperion_pb2_grpc.py (1)</summary>

`8-8`: **Generated code: ensure runtimegrpc ≥ 1.73.0 is available**

The generator bumped `GRPC_GENERATED_VERSION` to 1.73.0. If the runtime image still pins `grpcio<1.73`, the server will crash at startup with the explicit RuntimeError below.


Check the Dockerfile / `requirements.txt` for a corresponding upgrade.

</details>
<details>
<summary>hyperion/java-client/gradlew.bat (1)</summary>

`1-95`: **Skip generated Gradle wrapper script.**

This file is auto-generated by Gradle and should not be manually modified.

</details>
<details>
<summary>.github/workflows/hyperion_deploy-test.yml (1)</summary>

`11-18`: **Consolidated deployment job with updated Compose path**  

The single `deploy-app` job now correctly uses `./hyperion/compose.yaml` and inherits secrets. This aligns with the simplified Docker Compose layout and removes proxy deployment.

</details>
<details>
<summary>hyperion/app/grpc/hyperion_pb2.py (1)</summary>

`1-64`: **Skip generated protobuf code.**

This file is fully generated by `protoc`; manual review is not required.

</details>
<details>
<summary>hyperion/Dockerfile (1)</summary>

`1-1`: **Confirm base image availability**

`python:3.13-slim` may not yet exist on all registries; pinning to the latest released minor (e.g. `3.12`) avoids broken pulls during CI.

</details>
<details>
<summary>hyperion/java-client/gradlew (1)</summary>

`1-252`: **Gradle wrapper looks standard**

No issues spotted. Ensure the file has exec permissions in Git (`chmod +x`).

</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

FelixTJDietrich and others added 2 commits June 21, 2025 07:15
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
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: 0

🧹 Nitpick comments (1)
hyperion/compose.yaml (1)

14-14: Fix trailing whitespace formatting issues.

Remove the trailing spaces on these lines to comply with YAML formatting standards.

-      
+

Also applies to: 20-20

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b59c74a and d8a4250.

📒 Files selected for processing (2)
  • hyperion/app/main.py (2 hunks)
  • hyperion/compose.yaml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
hyperion/compose.yaml

[error] 14-14: trailing spaces

(trailing-spaces)


[error] 20-20: trailing spaces

(trailing-spaces)

🔇 Additional comments (5)
hyperion/compose.yaml (1)

1-41: LGTM! Well-structured Docker Compose configuration.

The compose file provides a comprehensive production-ready setup with:

  • Proper environment variable handling with sensible defaults
  • TLS support for secure gRPC communication
  • Standard health checking with grpc_health_probe
  • Appropriate logging and restart policies
  • Secure certificate volume mounting

The configuration aligns well with the enhanced gRPC server implementation.

hyperion/app/main.py (4)

146-171: LGTM! Excellent graceful shutdown implementation.

The signal handling and graceful shutdown logic is well-implemented with:

  • Proper signal registration for SIGTERM and SIGINT
  • Health status updates during shutdown
  • Configurable grace period for in-flight requests
  • Prevention of duplicate shutdown calls

This follows production best practices for containerized gRPC services.


173-202: LGTM! Robust TLS configuration with proper error handling.

The TLS implementation correctly:

  • Reads certificate files from configurable paths
  • Supports optional client certificate verification
  • Uses proper gRPC SSL server credentials
  • Includes comprehensive error handling with exception chaining (fixed from past review)

The configuration aligns well with the Docker Compose TLS environment variables.


48-103: LGTM! Production-grade server initialization.

The enhanced server initialization provides excellent production features:

  • Configurable worker threads with sensible defaults
  • Proper gRPC keepalive and HTTP/2 settings for connection stability
  • Conditional TLS/insecure port configuration with appropriate warnings
  • Comprehensive error handling with KeyboardInterrupt support

The server is well-prepared for production deployment.


115-142: Verify dynamic service registration logic.

The dynamic service registration approach is clever, but ensure all servicer classes follow the expected naming convention. The code assumes registration functions exist with the pattern add_{servicer_name}_to_server.

#!/bin/bash
# Description: Verify that all expected registration functions exist in the generated gRPC code
# Expected: All servicers should have corresponding add_*_to_server functions

echo "Checking for registration functions in hyperion_pb2_grpc.py..."
rg -A 2 "def add_.*Servicer_to_server" hyperion/app/grpc/hyperion_pb2_grpc.py || echo "File not found - checking proto definitions..."

echo "Checking servicer definitions..."
fd -e py -x rg -l "class.*Servicer" hyperion/app/creation_steps/

…pdate related configurations

- Create a new workflow for publishing snapshots of the Hyperion Java client to GitHub Packages.
- Update Java package name in proto file for consistency.
- Modify .gitignore to include gradle.properties for sensitive data.
- Add README.md for Java client with installation and usage instructions.
- Update build.gradle to include metadata for GitHub Packages and enhance publishing tasks.
- Introduce gradle.properties.template for local development setup.
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

🧹 Nitpick comments (8)
.github/workflows/hyperion_java-client_publish.yml (5)

14-19: Validate force_publish input
You’re using a string default 'false' for force_publish and comparing it as such in the if expression. This works, but consider using a boolean type for clarity, or explicitly document that string comparison is intended.


29-34: Unify JDK distribution
The validate job uses distribution: 'temurin' while publish-snapshot uses eclipse-temurin. Pick one identifier (e.g., temurin) to maintain consistency across jobs.

Also applies to: 69-73


35-43: Cache Gradle dependencies
To speed up builds, consider using actions/cache for the Gradle wrapper and .gradle directories. For example:

- name: Cache Gradle
  uses: actions/cache@v3
  with:
    path: |
      ~/.gradle/caches
      ~/.gradle/wrapper
    key: ${{ runner.os }}-gradle-${{ hashFiles('**/gradle-wrapper.properties') }}

83-101: Refine snapshot versioning
The manual sed approach works but is brittle. Consider using Gradle’s built-in -Drevision property or a dedicated versioning plugin to inject snapshot metadata, reducing CI complexity and avoiding command-line hacks.


102-108: Ensure package publish permissions
Double-check that the publish-snapshot job has permissions: packages: write so the GITHUB_TOKEN can successfully publish to GitHub Packages.

hyperion/java-client/README.md (3)

49-51: Fix list indentation and punctuation
The CI/CD environment variables list is not properly formatted. Add a blank line before the list, ensure each item is on its own line, and prefix with a hyphen and space. For example:

Use environment variables (automatically available in GitHub Actions):

- `GITHUB_ACTOR`: GitHub username  
- `GITHUB_TOKEN`: Automatically provided GitHub token  

25-27: Parameterize the version placeholder
The dependency version is hardcoded as 0.1.0-SNAPSHOT. Consider replacing it with a placeholder (e.g., ${VERSION}) or instructing users to update this to match the current snapshot published by CI.


1-4: Add project badges and summary
Consider inserting status badges (build, Maven Central/GitHub Packages) and a concise one-sentence description under the title for improved visibility and context.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d8a4250 and 717660d.

📒 Files selected for processing (6)
  • .github/workflows/hyperion_java-client_publish.yml (1 hunks)
  • hyperion/app/protos/hyperion.proto (1 hunks)
  • hyperion/java-client/.gitignore (1 hunks)
  • hyperion/java-client/README.md (1 hunks)
  • hyperion/java-client/build.gradle (1 hunks)
  • hyperion/java-client/gradle.properties.template (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • hyperion/java-client/gradle.properties.template
🚧 Files skipped from review as they are similar to previous changes (3)
  • hyperion/java-client/.gitignore
  • hyperion/app/protos/hyperion.proto
  • hyperion/java-client/build.gradle
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/hyperion_java-client_publish.yml

[error] 28-28: trailing spaces

(trailing-spaces)


[error] 34-34: trailing spaces

(trailing-spaces)


[error] 39-39: trailing spaces

(trailing-spaces)


[error] 42-42: trailing spaces

(trailing-spaces)


[error] 46-46: trailing spaces

(trailing-spaces)


[error] 64-64: trailing spaces

(trailing-spaces)


[error] 68-68: trailing spaces

(trailing-spaces)


[error] 74-74: trailing spaces

(trailing-spaces)


[error] 79-79: trailing spaces

(trailing-spaces)


[error] 87-87: trailing spaces

(trailing-spaces)


[error] 95-95: trailing spaces

(trailing-spaces)


[error] 98-98: trailing spaces

(trailing-spaces)


[error] 101-101: trailing spaces

(trailing-spaces)


[error] 108-108: trailing spaces

(trailing-spaces)

🪛 LanguageTool
hyperion/java-client/README.md

[uncategorized] ~49-~49: Loose punctuation mark.
Context: ...le in GitHub Actions): - GITHUB_ACTOR: GitHub username - GITHUB_TOKEN: Autom...

(UNLIKELY_OPENING_PUNCTUATION)

🔇 Additional comments (2)
.github/workflows/hyperion_java-client_publish.yml (1)

3-11: Review path filters
The workflow triggers only on changes under hyperion/java-client/** and hyperion/app/protos/**. Confirm that this matches the intended integration surface; modifications outside these paths (e.g., docs or scripts) won’t run your validation or snapshot publish steps.

hyperion/java-client/README.md (1)

102-104: Verify proto file path accuracy
The README references copying the proto from ../app/protos/hyperion.proto. Please confirm this aligns with the actual repo structure and update the path if it has changed.

… names, streamline conditions, and upgrade Gradle action version.
…ful version with branch name, date, and commit SHA for better traceability.
- Introduced `prompts.py` with prompts for checking inconsistencies, summarizing issues, and rewriting problem statements.
- Implemented `servicer.py` to handle gRPC requests for checking inconsistencies and rewriting problem statements.
- Updated `hyperion_pb2.py` and `hyperion_pb2.pyi` to include new request and response messages for rewriting problem statements.
- Modified `hyperion_pb2_grpc.py` to register the new ReviewAndRefine service and its methods.
- Updated `main.py` to replace the VerifyConfiguration service with the new ReviewAndRefine service.
- Changed the proto file to reflect the new service and added necessary request/response messages.
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

♻️ Duplicate comments (1)
hyperion/app/main.py (1)

173-203: LGTM! The TLS configuration exception handling has been properly addressed.

I see the exception chaining issue mentioned in past reviews has been correctly fixed at line 202 with from e. The TLS implementation is comprehensive with optional client certificate verification.

🧹 Nitpick comments (2)
.github/workflows/hyperion_java-client_publish.yml (2)

19-51: Consider caching Gradle dependencies to speed up CI runs.
Introducing actions/cache for the Gradle wrapper and dependency cache can significantly reduce build times.

Example diff:

      - name: Checkout repository
        uses: actions/checkout@v4

+     - name: Cache Gradle dependencies
+       uses: actions/cache@v3
+       with:
+         path: |
+           ~/.gradle/caches
+           ~/.gradle/wrapper
+         key: gradle-${{ runner.os }}-${{ hashFiles('hyperion/java-client/gradle.lockfile') }}
+         restore-keys: |
+           gradle-${{ runner.os }}-

1-2: Add top-level concurrency to cancel redundant runs.
Cancelling in-progress workflows on the same ref reduces CI waste and speeds up feedback.

Example diff:

 name: Hyperion - Java Client Publish Snapshots
+concurrency:
+  group: ${{ github.workflow }}-${{ github.ref }}
+  cancel-in-progress: true
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 717660d and d790948.

📒 Files selected for processing (9)
  • .github/workflows/hyperion_java-client_publish.yml (1 hunks)
  • hyperion/app/creation_steps/step8_review_and_refine/models.py (1 hunks)
  • hyperion/app/creation_steps/step8_review_and_refine/prompts.py (1 hunks)
  • hyperion/app/creation_steps/step8_review_and_refine/servicer.py (2 hunks)
  • hyperion/app/grpc/hyperion_pb2.py (1 hunks)
  • hyperion/app/grpc/hyperion_pb2.pyi (4 hunks)
  • hyperion/app/grpc/hyperion_pb2_grpc.py (10 hunks)
  • hyperion/app/main.py (3 hunks)
  • hyperion/app/protos/hyperion.proto (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • hyperion/app/protos/hyperion.proto
🧰 Additional context used
🪛 GitHub Actions: Hyperion - Lint
hyperion/app/creation_steps/step8_review_and_refine/models.py

[error] 1-1: Black formatting check failed. File would be reformatted. Run 'black --write' to fix code style issues.

hyperion/app/grpc/hyperion_pb2.pyi

[error] 1-1: Black formatting check failed. File would be reformatted. Run 'black --write' to fix code style issues.


[error] 1-1: Black formatting check failed. File would be reformatted. Run 'black --write' to fix code style issues.

hyperion/app/grpc/hyperion_pb2_grpc.py

[error] 1-1: Black formatting check failed. File would be reformatted. Run 'black --write' to fix code style issues.

hyperion/app/grpc/hyperion_pb2.py

[error] 1-1: Black formatting check failed. File would be reformatted. Run 'black --write' to fix code style issues.


[error] 1-1: Black formatting check failed. File would be reformatted. Run 'black --write' to fix code style issues.

🪛 Pylint (3.3.7)
hyperion/app/creation_steps/step8_review_and_refine/servicer.py

[error] 16-16: Attempted relative import beyond top-level package

(E0402)

hyperion/app/grpc/hyperion_pb2_grpc.py

[refactor] 28-28: Class 'DefineBoundaryConditionStub' inherits from object, can be safely removed from bases in python3

(R0205)


[refactor] 28-28: Too few public methods (0/2)

(R0903)


[refactor] 55-55: Class 'DefineBoundaryCondition' inherits from object, can be safely removed from bases in python3

(R0205)


[refactor] 55-55: Too few public methods (0/2)

(R0903)


[refactor] 60-60: Class 'DraftProblemStatementStub' inherits from object, can be safely removed from bases in python3

(R0205)


[refactor] 60-60: Too few public methods (0/2)

(R0903)


[refactor] 87-87: Class 'DraftProblemStatement' inherits from object, can be safely removed from bases in python3

(R0205)


[refactor] 87-87: Too few public methods (0/2)

(R0903)


[refactor] 92-92: Class 'CreateSolutionRepositoryStub' inherits from object, can be safely removed from bases in python3

(R0205)


[refactor] 92-92: Too few public methods (0/2)

(R0903)


[refactor] 119-119: Class 'CreateSolutionRepository' inherits from object, can be safely removed from bases in python3

(R0205)


[refactor] 119-119: Too few public methods (0/2)

(R0903)


[refactor] 124-124: Class 'CreateTemplateRepositoryStub' inherits from object, can be safely removed from bases in python3

(R0205)


[refactor] 124-124: Too few public methods (0/2)

(R0903)


[refactor] 151-151: Class 'CreateTemplateRepository' inherits from object, can be safely removed from bases in python3

(R0205)


[refactor] 151-151: Too few public methods (0/2)

(R0903)


[refactor] 156-156: Class 'CreateTestRepositoryStub' inherits from object, can be safely removed from bases in python3

(R0205)


[refactor] 156-156: Too few public methods (0/2)

(R0903)


[refactor] 183-183: Class 'CreateTestRepository' inherits from object, can be safely removed from bases in python3

(R0205)


[refactor] 183-183: Too few public methods (0/2)

(R0903)


[refactor] 188-188: Class 'FinalizeProblemStatementStub' inherits from object, can be safely removed from bases in python3

(R0205)


[refactor] 188-188: Too few public methods (0/2)

(R0903)


[refactor] 215-215: Class 'FinalizeProblemStatement' inherits from object, can be safely removed from bases in python3

(R0205)


[refactor] 215-215: Too few public methods (0/2)

(R0903)


[refactor] 220-220: Class 'ConfigureGradingStub' inherits from object, can be safely removed from bases in python3

(R0205)


[refactor] 220-220: Too few public methods (0/2)

(R0903)


[refactor] 247-247: Class 'ConfigureGrading' inherits from object, can be safely removed from bases in python3

(R0205)


[refactor] 247-247: Too few public methods (0/2)

(R0903)


[refactor] 252-252: Class 'ReviewAndRefineStub' inherits from object, can be safely removed from bases in python3

(R0205)


[refactor] 252-252: Too few public methods (0/2)

(R0903)


[error] 264-264: Module 'hyperion.app.grpc.hyperion_pb2' has no 'InconsistencyCheckRequest' member

(E1101)


[error] 265-265: Module 'hyperion.app.grpc.hyperion_pb2' has no 'InconsistencyCheckResponse' member

(E1101)


[error] 269-269: Module 'hyperion.app.grpc.hyperion_pb2' has no 'RewriteProblemStatementRequest' member

(E1101)


[error] 270-270: Module 'hyperion.app.grpc.hyperion_pb2' has no 'RewriteProblemStatementResponse' member

(E1101)


[refactor] 274-274: Class 'ReviewAndRefineServicer' inherits from object, can be safely removed from bases in python3

(R0205)


[error] 295-295: Module 'hyperion.app.grpc.hyperion_pb2' has no 'InconsistencyCheckRequest' member

(E1101)


[error] 296-296: Module 'hyperion.app.grpc.hyperion_pb2' has no 'InconsistencyCheckResponse' member

(E1101)


[error] 300-300: Module 'hyperion.app.grpc.hyperion_pb2' has no 'RewriteProblemStatementRequest' member

(E1101)


[error] 301-301: Module 'hyperion.app.grpc.hyperion_pb2' has no 'RewriteProblemStatementResponse' member

(E1101)


[refactor] 311-311: Class 'ReviewAndRefine' inherits from object, can be safely removed from bases in python3

(R0205)


[refactor] 316-316: Too many arguments (10/5)

(R0913)


[refactor] 316-316: Too many positional arguments (10/5)

(R0917)


[refactor] 343-343: Too many arguments (10/5)

(R0913)


[refactor] 343-343: Too many positional arguments (10/5)

(R0917)


[error] 357-357: Module 'hyperion.app.grpc.hyperion_pb2' has no 'RewriteProblemStatementRequest' member

(E1101)


[error] 358-358: Module 'hyperion.app.grpc.hyperion_pb2' has no 'RewriteProblemStatementResponse' member

(E1101)

hyperion/app/grpc/hyperion_pb2.py

[error] 9-9: No name 'runtime_version' in module 'google.protobuf'

(E0611)

🪛 Ruff (0.11.9)
hyperion/app/grpc/hyperion_pb2_grpc.py

21-21: f-string without any placeholders

Remove extraneous f prefix

(F541)

🪛 YAMLlint (1.37.1)
.github/workflows/hyperion_java-client_publish.yml

[error] 26-26: trailing spaces

(trailing-spaces)


[error] 32-32: trailing spaces

(trailing-spaces)


[error] 37-37: trailing spaces

(trailing-spaces)


[error] 41-41: trailing spaces

(trailing-spaces)


[error] 60-60: trailing spaces

(trailing-spaces)


[error] 66-66: trailing spaces

(trailing-spaces)


[error] 71-71: trailing spaces

(trailing-spaces)


[error] 79-79: trailing spaces

(trailing-spaces)


[error] 88-88: trailing spaces

(trailing-spaces)


[error] 91-91: trailing spaces

(trailing-spaces)


[error] 98-98: trailing spaces

(trailing-spaces)


[error] 101-101: trailing spaces

(trailing-spaces)


[error] 107-107: trailing spaces

(trailing-spaces)


[error] 110-110: trailing spaces

(trailing-spaces)


[error] 117-117: trailing spaces

(trailing-spaces)

⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Publish Snapshot to GitHub Packages
  • GitHub Check: Publish Snapshot to GitHub Packages
  • GitHub Check: Hyperion / Build linux/amd64 Docker Image for ghcr.io/ls1intum/edutelligence/hyperion
  • GitHub Check: Hyperion / Build linux/arm64 Docker Image for ghcr.io/ls1intum/edutelligence/hyperion
🔇 Additional comments (22)
.github/workflows/hyperion_java-client_publish.yml (2)

1-6: Minimal permissions block is correctly scoped.
The permissions section restricts GITHUB_TOKEN to only contents: read and packages: write, following least-privilege principles.


7-18: Trigger paths and events look appropriate.
The workflow fires on pushes and PRs to hyperion/java-client/** and hyperion/app/protos/**, plus manual dispatch.

hyperion/app/creation_steps/step8_review_and_refine/prompts.py (1)

65-82: LGTM! Well-structured prompt for problem statement rewriting.

The new rewrite_prompt is comprehensive and well-designed. It provides clear guidelines for AI-assisted rewriting of programming exercise problem statements, maintaining consistency with the existing prompt patterns in the file.

hyperion/app/creation_steps/step8_review_and_refine/models.py (1)

7-27: Fix Black formatting issue.

The new gRPC message classes are correctly implemented and follow the established patterns. However, the pipeline indicates a Black formatting issue that needs to be resolved.

Please run the following command to fix the formatting:

#!/bin/bash
# Fix Black formatting for the models.py file
black hyperion/app/creation_steps/step8_review_and_refine/models.py
hyperion/app/creation_steps/step8_review_and_refine/servicer.py (3)

21-21: LGTM! Service class renamed appropriately.

The class rename from VerifyConfigurationServicer to ReviewAndRefineServicer aligns with the updated gRPC service definition.


100-118: LGTM! Well-implemented RewriteProblemStatement method.

The new RPC method follows the established patterns:

  • Proper gRPC request/response conversion
  • Appropriate logging
  • Correct use of language model and prompt chain
  • Clean result processing and response generation

13-16: Verify import structure for static analysis concern.

The new imports look correct and follow the established patterns. However, static analysis flagged a potential relative import issue.

#!/bin/bash
# Verify the package structure and import paths
find hyperion/app/creation_steps/step8_review_and_refine -name "*.py" | head -10
ls -la hyperion/app/creation_steps/step8_review_and_refine/
hyperion/app/grpc/hyperion_pb2.py (3)

5-5: Verify protobuf version compatibility.

The protobuf version was updated to 6.31.0. Ensure this version is compatible with the project's dependencies and runtime environment.

#!/bin/bash
# Check installed protobuf version and compatibility
pip show protobuf
python -c "import google.protobuf; print(google.protobuf.__version__)"

1-70: Regenerate protobuf files to fix formatting.

This is a generated file with Black formatting issues. Regenerate the protobuf files using the correct formatter configuration.

#!/bin/bash
# Regenerate protobuf files with proper formatting
cd hyperion
python -m grpc_tools.protoc \
  --python_out=app/grpc \
  --pyi_out=app/grpc \
  --grpc_python_out=app/grpc \
  --proto_path=app/protos \
  app/protos/hyperion.proto

# Apply Black formatting if needed
black app/grpc/hyperion_pb2.py app/grpc/hyperion_pb2.pyi

9-19: Address potential runtime_version import issue.

Static analysis flagged that runtime_version might not exist in google.protobuf. This could indicate a version compatibility issue.

#!/bin/bash
# Verify runtime_version availability in the protobuf module
python -c "from google.protobuf import runtime_version; print('runtime_version available')" || echo "runtime_version not available"
hyperion/app/grpc/hyperion_pb2.pyi (2)

130-140: LGTM! New message type definitions are correct.

The new RewriteProblemStatementRequest and RewriteProblemStatementResponse classes are properly defined with correct type annotations and constructor signatures.


1-141: Fix formatting through protobuf regeneration.

This generated type stub file has Black formatting issues. Address this by regenerating the protobuf files with proper formatting configuration, as suggested for the corresponding .py file.

hyperion/app/main.py (7)

4-4: LGTM! Excellent addition of production-grade imports.

The new imports for signal handling, gRPC health service, and the ReviewAndRefineServicer properly support the enhanced server functionality.

Also applies to: 9-9, 34-36


49-49: LGTM! Constructor refactoring improves configurability.

The simplified constructor with max_workers parameter and addition of _shutdown_event properly supports the new graceful shutdown mechanism.

Also applies to: 51-60


63-96: LGTM! Comprehensive server configuration for production use.

The gRPC server options for keepalive, HTTP/2 settings, and the TLS/insecure port configuration provide excellent production readiness. The warning for insecure mode is appropriate for development environments.


104-145: LGTM! Dynamic service registration with health checking is excellent.

The dynamic registration pattern using the servicers dictionary is clean and maintainable. Integration of the official gRPC health service with per-service health status tracking follows best practices.


146-155: LGTM! Proper signal handling for graceful shutdown.

The signal handlers for SIGTERM and SIGINT are correctly implemented for production deployment scenarios.


156-172: LGTM! Well-implemented graceful shutdown mechanism.

The graceful shutdown properly updates health status to NOT_SERVING and provides a 30-second grace period for in-flight requests to complete.


205-221: LGTM! Clean main function with proper entry point.

The simplified serve() function and addition of the main guard follow Python best practices.

hyperion/app/grpc/hyperion_pb2_grpc.py (3)

8-8: LGTM! gRPC version update is appropriate.

The update to gRPC 1.73.0 aligns with modern gRPC versions and the version compatibility check is properly implemented.

Also applies to: 14-14, 20-25


1-367: Address Black formatting issue.

The pipeline failure indicates this file needs Black formatting. Since this is generated code, consider updating the code generation process to ensure consistent formatting.

#!/bin/bash
# Description: Apply Black formatting to the generated gRPC file
# Expected: Fix formatting issues

echo "Applying Black formatting to hyperion_pb2_grpc.py..."
black --check hyperion/app/grpc/hyperion_pb2_grpc.py || echo "File needs formatting - consider updating code generation process"

252-271: I couldn’t find those message classes in the generated Python stubs—let’s verify whether they exist in your .proto definitions:

#!/bin/bash
# Search all .proto files for the required message definitions
echo "Searching for required protobuf message definitions in .proto files..."
rg -n "message InconsistencyCheckRequest" -g "*.proto"
rg -n "message InconsistencyCheckResponse" -g "*.proto"
rg -n "message RewriteProblemStatementRequest" -g "*.proto"
rg -n "message RewriteProblemStatementResponse" -g "*.proto"

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

🔭 Outside diff range comments (1)
hyperion/README.md (1)

27-30: Python 3.13 is not released yet – please downgrade requirement or clarify.

Specifying an unreleased interpreter version will block both contributors and CI.
Unless you have a private build pipeline for 3.13, change this to the latest stable (3.12.x) or to the minimal version actually required by your code.

🧹 Nitpick comments (6)
hyperion/java-client/.gitignore (2)

7-9: Broaden the pattern for environment files
Only .env is ignored. CI / local setups often use suffixed variants (.env.local, .env.prod, etc.); those would still be committed accidentally.

-# Environment files with credentials
-.env
+# Environment files with credentials
+.env
+.env.*

1-11: Optional: ignore common IDE artefacts to avoid churn
If contributors use IntelliJ/Eclipse/VS Code inside java-client, consider adding the usual patterns so we don’t pollute diffs with IDE metadata.

+# IDE / tooling artefacts
+.idea/
+*.iml
+.classpath
+.project
+.settings/
+.vscode/
+
+# OS artefacts
+.DS_Store
hyperion/README.md (2)

122-135: TLS_CA_PATH missing in the environment-variable table.

The narrative later (lines 162-167) instructs users to set TLS_CA_PATH, but this row is absent from the table rendered here. Add it to keep the documentation self-consistent.

-| `TLS_KEY_PATH`              | TLS private key path           | /certs/server.key        |
+| `TLS_KEY_PATH`              | TLS private key path           | /certs/server.key        |
+| `TLS_CA_PATH`               | CA certificate path (mTLS)     | /certs/ca.crt            |

88-94: Minor wording/comma nit – readability.

“use the local compose file which builds from your local source”

Add a comma after “file” or rephrase; LanguageTool is flagging this.
Not blocking, but improves flow.

.github/workflows/hyperion_java-client_publish.yml (2)

6-13: Trailing spaces – YAML-lint errors will break yamllint / pre-commit hooks.

Static analysis still flags >30 lines. Strip them once to avoid noisy diffs later.

-# - OSSRH_PASSWORD: Sonatype OSSRH password for Maven Central  
+# - OSSRH_PASSWORD: Sonatype OSSRH password for Maven Central

(Apply the same s/[ \t]*$// to the whole file.)


140-154: Indentation inside here-doc writes leading spaces into ~/.m2/settings.xml.

The XML generated will start with 10 spaces, which Maven tolerates but formally invalidates the prolog and is hard to read when debugging.
Use <<'EOF' with no left-padding or pipe through sed -e 's/^ *//'.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d790948 and 9554d13.

📒 Files selected for processing (7)
  • .github/workflows/hyperion_java-client_publish.yml (1 hunks)
  • hyperion/.env.example (1 hunks)
  • hyperion/README.md (5 hunks)
  • hyperion/java-client/.env.example (1 hunks)
  • hyperion/java-client/.gitignore (1 hunks)
  • hyperion/java-client/pom.xml (1 hunks)
  • hyperion/java-client/settings.xml (1 hunks)
✅ Files skipped from review due to trivial changes (3)
  • hyperion/java-client/.env.example
  • hyperion/.env.example
  • hyperion/java-client/settings.xml
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/hyperion_java-client_publish.yml

[error] 6-6: trailing spaces

(trailing-spaces)


[error] 35-35: trailing spaces

(trailing-spaces)


[error] 39-39: trailing spaces

(trailing-spaces)


[error] 45-45: trailing spaces

(trailing-spaces)


[error] 51-51: trailing spaces

(trailing-spaces)


[error] 59-59: trailing spaces

(trailing-spaces)


[error] 67-67: trailing spaces

(trailing-spaces)


[error] 82-82: trailing spaces

(trailing-spaces)


[error] 87-87: trailing spaces

(trailing-spaces)


[error] 93-93: trailing spaces

(trailing-spaces)


[error] 106-106: trailing spaces

(trailing-spaces)


[error] 123-123: trailing spaces

(trailing-spaces)


[error] 127-127: trailing spaces

(trailing-spaces)


[error] 133-133: trailing spaces

(trailing-spaces)


[error] 139-139: trailing spaces

(trailing-spaces)


[error] 154-154: trailing spaces

(trailing-spaces)


[error] 160-160: trailing spaces

(trailing-spaces)


[error] 163-163: trailing spaces

(trailing-spaces)


[error] 172-172: trailing spaces

(trailing-spaces)


[error] 176-176: trailing spaces

(trailing-spaces)


[error] 179-179: trailing spaces

(trailing-spaces)


[error] 181-181: trailing spaces

(trailing-spaces)


[error] 185-185: trailing spaces

(trailing-spaces)


[error] 191-191: trailing spaces

(trailing-spaces)


[error] 197-197: trailing spaces

(trailing-spaces)


[error] 217-217: trailing spaces

(trailing-spaces)


[error] 223-223: trailing spaces

(trailing-spaces)


[error] 229-229: trailing spaces

(trailing-spaces)


[error] 240-240: trailing spaces

(trailing-spaces)


[error] 245-245: trailing spaces

(trailing-spaces)


[error] 263-263: trailing spaces

(trailing-spaces)


[error] 277-277: trailing spaces

(trailing-spaces)


[error] 287-287: trailing spaces

(trailing-spaces)

🪛 LanguageTool
hyperion/README.md

[uncategorized] ~88-~88: Possible missing comma found.
Context: ...pment or testing, use the local compose file which builds from your local source: `...

(AI_HYDRA_LEO_MISSING_COMMA)


[style] ~569-~569: Consider shortening or rephrasing this to strengthen your wording.
Context: ... Artemis 6. Repeat steps 2-5 after making changes to Hyperion ### Java Client Usage #### D...

(MAKE_CHANGES)

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Hyperion / Build linux/amd64 Docker Image for ghcr.io/ls1intum/edutelligence/hyperion
  • GitHub Check: Hyperion / Build linux/arm64 Docker Image for ghcr.io/ls1intum/edutelligence/hyperion
🔇 Additional comments (2)
hyperion/java-client/.gitignore (2)

1-6: Good start – core Maven/Proto artefacts correctly ignored
target/ and proto/ are the main heavyweight build outputs, so excluding them here keeps the repo slim.


10-11: Double-check whether settings.xml can contain credentials
You ignore settings-local.xml, but the committed settings.xml may also embed <server> credentials for GitHub Packages. If that file ever contains real secrets, add it to .gitignore (or commit only a redacted template).

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

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9554d13 and 7159cb4.

📒 Files selected for processing (2)
  • .github/workflows/hyperion_java-client_publish.yml (1 hunks)
  • hyperion/java-client/pom.xml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • hyperion/java-client/pom.xml
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/hyperion_java-client_publish.yml

[error] 6-6: trailing spaces

(trailing-spaces)


[error] 35-35: trailing spaces

(trailing-spaces)


[error] 39-39: trailing spaces

(trailing-spaces)


[error] 45-45: trailing spaces

(trailing-spaces)


[error] 51-51: trailing spaces

(trailing-spaces)


[error] 59-59: trailing spaces

(trailing-spaces)


[error] 67-67: trailing spaces

(trailing-spaces)


[error] 82-82: trailing spaces

(trailing-spaces)


[error] 87-87: trailing spaces

(trailing-spaces)


[error] 93-93: trailing spaces

(trailing-spaces)


[error] 97-97: trailing spaces

(trailing-spaces)


[error] 113-113: trailing spaces

(trailing-spaces)


[error] 130-130: trailing spaces

(trailing-spaces)


[error] 134-134: trailing spaces

(trailing-spaces)


[error] 140-140: trailing spaces

(trailing-spaces)


[error] 146-146: trailing spaces

(trailing-spaces)


[error] 161-161: trailing spaces

(trailing-spaces)


[error] 167-167: trailing spaces

(trailing-spaces)


[error] 170-170: trailing spaces

(trailing-spaces)


[error] 179-179: trailing spaces

(trailing-spaces)


[error] 183-183: trailing spaces

(trailing-spaces)


[error] 186-186: trailing spaces

(trailing-spaces)


[error] 188-188: trailing spaces

(trailing-spaces)


[error] 192-192: trailing spaces

(trailing-spaces)


[error] 198-198: trailing spaces

(trailing-spaces)


[error] 204-204: trailing spaces

(trailing-spaces)


[error] 224-224: trailing spaces

(trailing-spaces)


[error] 230-230: trailing spaces

(trailing-spaces)


[error] 236-236: trailing spaces

(trailing-spaces)


[error] 247-247: trailing spaces

(trailing-spaces)


[error] 252-252: trailing spaces

(trailing-spaces)


[error] 270-270: trailing spaces

(trailing-spaces)


[error] 284-284: trailing spaces

(trailing-spaces)


[error] 294-294: trailing spaces

(trailing-spaces)

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Hyperion / Build linux/amd64 Docker Image for ghcr.io/ls1intum/edutelligence/hyperion
  • GitHub Check: Hyperion / Build linux/arm64 Docker Image for ghcr.io/ls1intum/edutelligence/hyperion

@luis-gasparschroeder
Copy link

We should start following the Google Docstring guidelines for Python code

@FelixTJDietrich FelixTJDietrich merged commit 844802e into main Jun 27, 2025
8 of 9 checks passed
@FelixTJDietrich FelixTJDietrich deleted the hyperion/artemis-integration branch June 27, 2025 14:57
@github-project-automation github-project-automation bot moved this from In review to Done in Hyperion Jun 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants