Skip to content
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

Feature/nav 140 utility endpoints health and service info #96

Merged
merged 50 commits into from
Aug 16, 2024

Conversation

munterfi
Copy link
Member

@munterfi munterfi commented Aug 14, 2024

image

This PR adds:

  • A home page for the service under the root path /.
  • Endpoints for metrics, health checks, and build information.
  • Improved error handling and messages for the client:
    • 400 Bad Request for invalid parameters.
    • 404 Not Found for non-existent stops.
    • 500 Internal Server Error for internal errors from the service.
  • ConnectionRoutingRequest to the ConnectionRoutingInterface. In the service, IllegalArgumentExceptions are caught from the RaptorRouter and converted to ConnectionRoutingExceptions at the service level. These error messages are forwarded to the user, and the stack trace is logged. Other exceptions (e.g., NullPointerExceptions) are not caught, and therefore the client receives a generic internal server error.
  • A schedule Validity check at the service level, which is used to validate date and time input from the client.
  • Extensions and refactoring of RoutingController and ScheduleControllerTest.

…NAV-140-Utility-endpoints-Health-and-ServiceInfo
- Add actuator dependency.
- Configuration via application.properties
- Run swagger UI on further endpoints.
- Serve application documentation as JSON.
- Make git and build information available to Spring app.
- Add controller for home "/" endpoint.
- New thymeleaf dependency.
- Index template and logo.
- Improve design of home.
- Move configs into separate app.config package.
@munterfi munterfi self-assigned this Aug 14, 2024
@munterfi munterfi marked this pull request as draft August 14, 2024 18:53
- Ignore git specifics in docker build to not expose git specifics in production images.
…vided in routing controller

- Instead of checking coordinates against negative values, are against null now.
- In the swagger UI the default value is now not set.
- Update description of swagger.
…er max value as default value in the API.

- Swagger UI is more readable.
- Adjust parameter validation.
- Catch exceptions from raptor algorithm and rethrow as ConnectionRoutingException.
- Adjust signatures.
- Implementation for gtfs raptor service, based on the gtfs schedule.
- Handles stop lookups and validation.
- Handles datetime validation and validity check.
- Refactor test: Move test cases into individual nested test classes.
- Unify naming of test cases.
Note: Metrics should not be exposed when in production.
@munterfi munterfi requested a review from clukas1 August 15, 2024 13:45
@munterfi munterfi marked this pull request as ready for review August 15, 2024 13:45
Copy link
Member

@clukas1 clukas1 left a comment

Choose a reason for hiding this comment

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

From what I can tell changes look food.

Only remaining point I see is the implementation of our date ranges in the gtfs raptor service.:

  • Getting start and end date only by streaming the calendars and ignoring exceptions will not always work.
  • What about cases where there is no active service for a day within the range?
  • Since this check will run many times (for each request) I wouldn't calculate the ranges every time but store them as attributes.

Copy link
Member

@clukas1 clukas1 left a comment

Choose a reason for hiding this comment

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

submit review

@clukas1 clukas1 self-requested a review August 16, 2024 09:32
Copy link
Member

@clukas1 clukas1 left a comment

Choose a reason for hiding this comment

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

Nice!

@clukas1 clukas1 merged commit 672680f into main Aug 16, 2024
2 checks passed
@munterfi munterfi deleted the feature/NAV-140-Utility-endpoints-Health-and-ServiceInfo branch August 16, 2024 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants