-
Notifications
You must be signed in to change notification settings - Fork 435
feat: matrix generation CLI #2059
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
base: main
Are you sure you want to change the base?
Conversation
…openrouteservice into feat/matrix_benchmark
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.
Some minor things.
...src/main/java/org/heigit/ors/coordinates_generator/generators/CoordinateGeneratorMatrix.java
Show resolved
Hide resolved
...src/main/java/org/heigit/ors/coordinates_generator/generators/CoordinateGeneratorMatrix.java
Show resolved
Hide resolved
...mark/src/test/java/org/heigit/ors/coordinates_generator/cli/MatrixCommandLineParserTest.java
Outdated
Show resolved
Hide resolved
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.
Pull Request Overview
This PR adds a new CLI interface for generating matrices for API testing, refactors the HTTP client connection management to reuse connections, and introduces extensive tests for command-line argument parsing and generator functionality.
- Introduces a new MatrixCommandLineParser for handling CLI arguments.
- Refactors CoordinateGeneratorMatrix to reuse a shared HTTP client and implements AutoCloseable for proper resource management.
- Adds thorough tests for CLI parsing and matrix generation scenarios.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
ors-benchmark/src/test/java/org/heigit/ors/coordinates_generator/cli/MatrixCommandLineParserTest.java | Adds tests covering valid/invalid argument cases and CLI behavior. |
ors-benchmark/src/main/java/org/heigit/ors/coordinates_generator/generators/CoordinateGeneratorMatrix.java | Modifies HTTP client handling for connection reuse and resource closure; updates JavaDoc comments. |
ors-benchmark/src/main/java/org/heigit/ors/coordinates_generator/cli/MatrixCommandLineParser.java | Implements CLI parsing for matrix generation using Apache Commons CLI. |
ors-benchmark/src/main/java/org/heigit/ors/coordinates_generator/MatrixGeneratorApp.java | Introduces a command-line application entry point for matrix generation. |
ors-benchmark/src/main/java/org/heigit/ors/benchmark/MatrixAlgorithmLoadTest.java | Provides a load test scenario for matrix API endpoints. |
Comments suppressed due to low confidence (1)
ors-benchmark/src/main/java/org/heigit/ors/coordinates_generator/generators/CoordinateGeneratorMatrix.java:352
- [nitpick] There is a duplicate word 'in' in the JavaDoc comment; please remove the extra 'in' to improve clarity.
* Routeability in in forward direction between row elements, and column
|
||
// Close HTTP client | ||
try { | ||
httpClient.close(); | ||
} catch (IOException e) { | ||
LOGGER.error("Error closing HTTP client", e); | ||
} |
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.
[nitpick] Consider consolidating the HTTP client closure logic by centralizing it in the AutoCloseable close() method rather than closing it both in shutdownExecutor and in close().
// Close HTTP client | |
try { | |
httpClient.close(); | |
} catch (IOException e) { | |
LOGGER.error("Error closing HTTP client", e); | |
} |
Copilot uses AI. Check for mistakes.
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.
Nice! 👍
Please consider addressing the issue reported by SonarQube and copilot's improvement suggestions including ones in "Comments suppressed due to low confidence".
Cheers!
Thanks, I adressed all comments, including sonar and copilot. |
|
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.
LGTM
Pull Request Checklist
have been resolved.
[Unreleased] heading.
along with a short description of what it is for, and documented this in the Pull Request (below).
(at least Germany), and the graphs build without problems (i.e. no out-of-memory errors).
importer etc.), I have generated longer distance routes for the affected profiles with different options
(avoid features, max weight etc.) and compared these with the routes of the same parameters and start/end
points generated from the current live ORS.
If there are differences then the reasoning for these MUST be documented in the pull request.
and why the change was needed.
Fixes # .
Information about the changes
Examples and reasons for differences between live ORS routes, and those generated from this pull request
Required changes to ors config (if applicable)