Conversation
… and preserve multi-tank selection coverage (#198)
Contributor
There was a problem hiding this comment.
Pull request overview
This PR focuses on fixing and hardening tank cache population and related workflows by unifying backend tank JSON parsing, expanding/adjusting controller tests for cached/multi-tank and single-tank auto-selection behavior, and modernizing Debian packaging to install a systemd unit and create runtime users/dirs.
Changes:
- Refactor backend tank JSON parsing into a shared helper and align
FetchFuelTanksparsing with the same field naming as authorization responses. - Update/add controller tests to cover cached tank lists and “single tank skips selection” flows for both customer refuel and operator intake.
- Update Debian maintainer scripts and packaging workflow to install a systemd service + config assets, and bump project version to 0.2.3.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
tests/controller_test.cpp |
Updates test expectations for cached tank lists and adds explicit single-tank skip-selection workflow tests. |
tests/backend_test.cpp |
Minor test tweak in intake JSON parse error path. |
tests/backend_base_test.cpp |
Updates expected tank JSON keys to match new parsing behavior. |
src/backend_base.cpp |
Introduces ParseFuelTank helper and reuses it in Authorize and FetchFuelTanks. |
deploy/debian/prerm |
Switches service stop/disable to systemctl-based handling. |
deploy/debian/postinst |
Creates service user/group/dirs/env file and enables/starts the systemd service. |
CMakeLists.txt |
Version bump to 0.2.3. |
.github/workflows/release-arm64-deb.yml |
Packages systemd unit + config instead of deploy script; stubs systemctl during install test. |
.github/workflows/build.yml |
Makes Codecov upload non-fatal (fail_ci_if_error: false). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| // Setup malformed JSON for intake | ||
| mockServer->handleFuelIntake = [](const httplib::Request& req [[maybe_unused]], httplib::Response& res) { | ||
| mockServer->handleFuelIntake = [](const httplib::Request& req, httplib::Response& res) { |
| std::string parseError; | ||
| if (!ParseFuelTank(item, tankInfo, false, &parseError)) { | ||
| if (!parseError.empty()) { | ||
| LOG_BCK_ERROR("Invalid response format: field 'volume' must be a number"); |
Comment on lines
+63
to
+66
| # Enable and start the service | ||
| systemctl daemon-reload | ||
| systemctl enable "${SERVICE_NAME}" | ||
| systemctl start "${SERVICE_NAME}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.