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

rm-hull / fuel-prices-api / 22199881476
22%

Build:
DEFAULT BRANCH: main
Ran 19 Feb 2026 09:01PM UTC
Jobs 1
Files 10
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

19 Feb 2026 08:59PM UTC coverage: 28.826% (+0.2%) from 28.595%
22199881476

push

github

web-flow
feat: add import command and data cleansing (#10)

* feat: add import command and data cleansing

This change introduces a new `import` CLI command to allow manual
one-off data synchronization from the GOV.UK API. It also improves data
consistency by cleansing address strings and normalizing fuel prices.

*   Added `import` command to the CLI.
*   Refactored shared initialization into a `bootstrap` function.
*   Implemented `cleanseAddressLine1` to remove redundant city and
    postcode suffixes.
*   Implemented `cleansePrice` to normalize prices provided in pounds
    or tenths of pence into standard pence.
*   Updated `ApiServer` to return errors instead of terminating the
    process directly.
*   Added **health check** and **metrics** endpoints to `test_api.http`.

```mermaid
sequenceDiagram
    participant CLI as main.go
    participant Cmd as cmd/import.go
    participant Boot as cmd/bootstrap.go
    participant Client as internal.FuelPricesClient
    participant Repo as internal.FuelPricesRepository

    CLI->>Cmd: Import()
    Cmd->>Boot: bootstrap(dbPath)
    Boot-->>Cmd: client, repo
    Cmd->>Client: GetFillingStations(repo.InsertPFS)
    Client->>Repo: InsertPFS(batch)
    Cmd->>Client: GetFuelPrices(repo.InsertPrices)
    Client->>Repo: InsertPrices(batch)
    Cmd->>Repo: Close()
```

* refactor: use strings.TrimSuffix in address cleansing

Replace manual suffix checking and replacement with the more idiomatic
`strings.TrimSuffix` function. This improves readability and ensures
only the end of the string is targeted.

23 of 100 new or added lines in 6 files covered. (23.0%)

2 existing lines in 2 files now uncovered.

194 of 673 relevant lines covered (28.83%)

0.31 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
3
92.54
-2.81% internal/models/fuel_prices.go
6
62.36
-2.18% internal/repository.go
9
0.0
0.0% main.go
10
0.0
0.0% cmd/api_server.go
23
0.0
cmd/import.go
26
0.0
cmd/bootstrap.go

Uncovered Existing Lines

Lines Coverage ∆ File
1
0.0
0.0% cmd/api_server.go
1
0.0
0.0% main.go
Jobs
ID Job ID Ran Files Coverage
1 22199881476.1 19 Feb 2026 09:01PM UTC 10
28.83
GitHub Action Run
Source Files on build 22199881476
  • Tree
  • List 10
  • Changed 4
  • Source Changed 0
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 294fbe5e on github
  • Prev Build on main (#22164671138)
  • Next Build on main (#22200109641)
  • Delete
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