• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

rm-hull / fuel-prices-api / 22688039815

04 Mar 2026 08:33PM UTC coverage: 18.658% (-0.1%) from 18.796%
22688039815

push

github

web-flow
feat: add support for incremental data fetching (#22)

* feat: add support for incremental data fetching

Introduces a `--full-refresh` CLI flag and logic to fetch only data
updated since the last successful request using the
`effective-start-timestamp` query parameter.

*   Adds `fullRefresh` toggle to `fuelPricesManager`.
*   Updates `ApiServer` and `bootstrap` to propagate the new setting.
*   Forces full refresh for the `import` command.
*   Conditionally includes `effective-start-timestamp` in API calls.

```mermaid
sequenceDiagram
    participant CLI as CLI (main.go)
    participant Cmd as API/Import Command
    participant Client as FuelPricesClient
    participant Gov as GOV.UK API

    CLI->>Cmd: Execute with fullRefresh flag
    Cmd->>Client: NewFuelPricesClient(..., fullRefresh)
    Client->>Client: getEffectiveStartTimestamp()
    alt !fullRefresh AND lastFetch exists
        Client->>Gov: GET /path?effective-start-timestamp=...
    else
        Client->>Gov: GET /path
    end
```

* Update internal/client_fetch.go

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* refactor: use neturl.Values for query parameters

Replace manual string concatenation and manual escaping with the
standard library `neturl.Values` for constructing batch fetch URLs.

This change ensures all query parameters are consistently and safely
encoded, improving the robustness of the request logic.

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

0 of 25 new or added lines in 5 files covered. (0.0%)

203 of 1088 relevant lines covered (18.66%)

0.2 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/cmd/api_server.go


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc