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

rm-hull / fuel-prices-api / 22917808254
46%

Build:
DEFAULT BRANCH: main
Ran 10 Mar 2026 06:23PM UTC
Jobs 1
Files 19
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

10 Mar 2026 06:22PM UTC coverage: 17.598% (+0.2%) from 17.421%
22917808254

push

github

web-flow
feat: add data validation and dropping for fuel prices (#30)

* feat: add data validation and dropping for fuel prices

- Added `IsPriceOutOfBounds` check to filter out invalid price data
  before insertion.
- Updated `Repository` and `Client` interfaces to track and return the
  count of dropped records.
- Added `fuel_prices_govuk_api_items_dropped_total` metric to monitor
  data quality issues.
- Renamed binary to `fuel-prices-api` in `Dockerfile` and build scripts.

```mermaid
sequenceDiagram
    participant API as GovUK API
    participant Client as Fetcher
    participant Repo as Repository

    Client->>API: Fetch batch
    API-->>Client: Return records
    loop Each Record
        Client->>Repo: InsertPFS / InsertPrices
        alt Out of Bounds
            Repo-->>Client: Drop record
        else Valid
            Repo-->>Repo: Save to SQLite
        end
    end
    Client->>Client: Increment dropped count
    Client->>Client: Record metrics (Fetched/Dropped)
```

* fix: update metrics for dropped items

Ensure that `ItemsDroppedTotal` metrics are recorded even when
`count` is zero, and improve nil safety checks.

15 of 68 new or added lines in 6 files covered. (22.06%)

1 existing line in 1 file now uncovered.

211 of 1199 relevant lines covered (17.6%)

0.19 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
4
0.0
0.0% cmd/import.go
4
0.0
0.0% internal/cron.go
4
90.54
-2.0% internal/models/fuel_prices.go
12
0.0
0.0% internal/client_fetch.go
13
54.21
-0.34% internal/repository.go
16
0.0
0.0% internal/metrics/client_fetch_metrics.go

Uncovered Existing Lines

Lines Coverage ∆ File
1
0.0
0.0% internal/metrics/client_fetch_metrics.go
Jobs
ID Job ID Ran Files Coverage
1 22917808254.1 10 Mar 2026 06:23PM UTC 19
17.6
GitHub Action Run
Source Files on build 22917808254
  • Tree
  • List 19
  • Changed 4
  • Source Changed 0
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • e2548a0b on github
  • Prev Build on main (#22880828098)
  • Next Build on main (#22928444781)
  • 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