-
Notifications
You must be signed in to change notification settings - Fork 301
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
Development
: Display more in-depth health information about the hermes service
#10068
base: develop
Are you sure you want to change the base?
Development
: Display more in-depth health information about the hermes service
#10068
Conversation
There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions. |
There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions. |
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 pmd (7.8.0)src/main/java/de/tum/cit/aet/artemis/communication/config/HermesHealthIndicator.javaThe following rules are missing or misspelled in your ruleset file category/vm/bestpractices.xml: BooleanInstantiation, DontImportJavaLang, DuplicateImports, EmptyFinallyBlock, EmptyIfStmt, EmptyInitializer, EmptyStatementBlock, EmptyStatementNotInLoop, EmptySwitchStatements, EmptySynchronizedBlock, EmptyTryBlock, EmptyWhileStmt, ExcessiveClassLength, ExcessiveMethodLength, ImportFromSamePackage, MissingBreakInSwitch, SimplifyBooleanAssertion. Please check your ruleset configuration. WalkthroughThe changes modify the Changes
Sequence DiagramsequenceDiagram
participant Client as HermesHealthIndicator
participant Endpoint as Hermes Service
Client->>Endpoint: GET /api/health
alt Health Endpoint Available
Endpoint-->>Client: Return Health Report
Client->Client: Parse Health Report
Client->Client: Update Health Status
else Health Endpoint Unavailable
Client->>Endpoint: Fallback: GET Base URL
Endpoint-->>Client: Verify Connection
Client->Client: Determine Fallback Status
end
The sequence diagram illustrates the new health checking process, showing the primary flow of attempting to retrieve health information from the Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/main/java/de/tum/cit/aet/artemis/communication/config/HermesHealthIndicator.java
(2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
src/main/java/de/tum/cit/aet/artemis/communication/config/HermesHealthIndicator.java (1)
Pattern src/main/java/**/*.java
: naming:CamelCase; principles:{single_responsibility,small_methods,no_duplication}; db:{perf_queries,datetime_not_timestamp}; rest:{stateless,singleton,delegate_logic,http_only,minimal_dtos}; dtos:{java_records,no_entities,min_data,single_resp}; di:constructor_injection; kiss:simple_code; file_handling:os_indep_paths; practices:{least_access,avoid_transactions,code_reuse,static_member_ref,prefer_primitives}; sql:{param_annotation,uppercase,avoid_subqueries};java:avoid_star_imports
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (2)
src/main/java/de/tum/cit/aet/artemis/communication/config/HermesHealthIndicator.java (2)
76-77
: Verify field names inHermesHealthReport
match JSON propertiesEnsure that the field names in
HermesHealthReport
—isApnsConnected
,isFirebaseConnected
,versionNumber
—correctly map to the JSON properties returned by the/api/health
endpoint. If the JSON properties differ (e.g.,apnsConnected
instead ofisApnsConnected
), use@JsonProperty
annotations to map them appropriately.
44-58
: New health check implementation enhances service monitoringThe addition of the
/api/health
endpoint check provides more detailed health information about the Hermes service, improving administrators' ability to monitor connectivity with APNs and Firebase.
Checklist
General
Server
Motivation and Context
Currently, Artemis checks if Hermes is running by calling the base url and looking if it returns a 200 response code. While working, this does not provide a lot of information to the admins.
Description
I implemented a new
/api/health
api in the Hermes Repository that provides the information whether or not Hermes was able to connect to the APNS or to Firebase. Additionally, it returns the version number of Hermes. This information is displayed in the "details" section when viewing the service health in the admin panel.Steps for Testing
Prerequisites:
Testserver States
Note
These badges show the state of the test servers.
Green = Currently available, Red = Currently locked
Click on the badges to get to the test servers.
Review Progress
Code Review
Manual Tests
Screenshots
Summary by CodeRabbit
New Features
Bug Fixes