Skip to content

fix: tanks cache initial population#197

Draft
maxirmx wants to merge 4 commits into
mainfrom
v023
Draft

fix: tanks cache initial population#197
maxirmx wants to merge 4 commits into
mainfrom
v023

Conversation

@maxirmx
Copy link
Copy Markdown
Owner

@maxirmx maxirmx commented Apr 23, 2026

No description provided.

@maxirmx maxirmx changed the title fix: tanks cacheinitial population fix: tanks cache initial population May 4, 2026
@maxirmx maxirmx requested a review from Copilot May 4, 2026 09:14
Copy link
Copy Markdown
Contributor

Copilot AI left a 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 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 FetchFuelTanks parsing 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.

Comment thread tests/backend_test.cpp

// 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) {
Comment thread src/backend_base.cpp
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 thread deploy/debian/postinst
Comment on lines +63 to +66
# Enable and start the service
systemctl daemon-reload
systemctl enable "${SERVICE_NAME}"
systemctl start "${SERVICE_NAME}"
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.

3 participants