Closed freak12techno closed 4 months ago
The recent updates introduce a new HTTP server along with /metrics
and /healthcheck
routes, enhance configuration handling with new assets and tests, and simplify tracer management by refining error handling. Additionally, logging severity is updated to Panic
, and a Codecov badge is added to the README.md for improved documentation and coverage tracking.
File(s) | Summary |
---|---|
pkg/app.go |
Added Server field to App struct, custom routes and Healthcheck method, and start/stop functionality for the server. |
pkg/app_test.go |
Introduced tests for application configuration, start/stop, and HTTP mocking for API endpoints. |
pkg/config/config_test.go |
Updated test configuration filename to config-valid.toml . |
pkg/tracing/tracer.go , pkg/tracing/tracer_test.go |
Simplified error handling and adjusted return types in tracing functions. |
.gitignore |
Added an exception to include files matching assets/config*.toml . |
assets/config-invalid-listen-address.toml , assets/config-valid.toml , assets/config-with-warnings.toml , and assets/config-invalid.toml |
Introduced and updated configuration settings for various blockchain chains. |
cmd/cosmos-validators-exporter.go |
Updated logging severity from Fatal to Panic for certain error conditions. |
cmd/cosmos-validators-exporter_test.go |
Added tests for different configuration scenarios in the main() function. |
README.md |
Added a Codecov badge. |
sequenceDiagram
participant Client
participant App
participant HTTPServer
Client->>App: Start()
App->>HTTPServer: Initialize with /metrics and /healthcheck routes
activate HTTPServer
Note over HTTPServer: HTTP Server runs and listens for requests
Client->>HTTPServer: /healthcheck
HTTPServer->>App: Healthcheck()
App-->>HTTPServer: HTTP 200 OK
Client->>App: Stop()
App->>HTTPServer: Graceful shutdown
deactivate HTTPServer
Note over App: Server stopped
In the land of code where circuits hum, A server wakes, the network's drum, Healthchecks hum and metrics sing, Configs gathered, tests take wing. Tracers dance in outputs clear, Logging echoes far and near, With Codecov badge, we cheer this feat, Our software strong and sweet! πΏπ
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?
@coderabbitai I remember you had some learnings about pkg/app.go being untested, now it's not the case and it's not acceptable if it's not tested.
[!TIP] For best results, initiate chat on the files or code changes.
@freak12techno, thank you for updating the testing expectations for pkg/app.go
. I will remove the outdated learnings that previously noted the acceptance of pkg/app.go
being untested. Moving forward, I'll ensure to consider the necessity of having tests for this file in future reviews.
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 100.00%. Comparing base (
87241cf
) to head (e4f66b6
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Summary by CodeRabbit
New Features
/metrics
and/healthcheck
routes for server monitoring and health check.Bug Fixes
Tests
Documentation
Configuration
.gitignore
to include specific configuration files.Refactor