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

rm-hull / fuel-prices-api / 22163985049
20%

Build:
DEFAULT BRANCH: main
Ran 19 Feb 2026 12:53AM UTC
Jobs 1
Files 8
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 12:52AM UTC coverage: 28.595% (+1.3%) from 27.332%
22163985049

push

github

web-flow
feat: add database migrations and price timestamps (#9)

* feat: add database migrations and price timestamps

- Integrate `golang-migrate` to manage **SQLite** schema versions.
- Add `price_change_effective_timestamp` to track when fuel prices
  officially change.
- Simplify API response decoding by removing legacy metadata wrappers
  and batch tracking.
- Update `Dockerfile` and repository tests to support the new
  migration-based workflow.

```mermaid
sequenceDiagram
    participant App as API Server
    participant Mig as golang-migrate
    participant DB as SQLite
    participant API as Gov API

    App->>Mig: Migrate("migrations", dbPath)
    Mig->>DB: Run .up.sql scripts
    App->>API: GetFuelPrices()
    API-->>App: Return prices with effective timestamps
    App->>DB: Upsert prices with PriceChangeEffectiveTimestamp
```

* chore: promote migrate to direct dependency

Promote `github.com/golang-migrate/migrate/v4` from an indirect to a
direct dependency in `go.mod`. This change ensures the library is
explicitly tracked as a requirement for the project.

* fix: close database and migration resources

Ensure migration source and database connections are properly released
to prevent resource leaks and potential file locks:

-   Add `defer m.Close()` in `Migrate` to clean up migration drivers.
-   Update `setupTestDB` to close the database handle before removing
    the temporary file.

16 of 37 new or added lines in 5 files covered. (43.24%)

1 existing line in 1 file now uncovered.

173 of 605 relevant lines covered (28.6%)

0.31 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
4
0.0
0.0% cmd/api_server.go
6
65.63
-8.45% internal/db.go
11
0.0
0.0% internal/client_fetch.go

Uncovered Existing Lines

Lines Coverage ∆ File
1
0.0
0.0% internal/client_fetch.go
Jobs
ID Job ID Ran Files Coverage
1 22163985049.1 19 Feb 2026 12:53AM UTC 8
28.6
GitHub Action Run
Source Files on build 22163985049
  • Tree
  • List 8
  • Changed 5
  • Source Changed 0
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • aee0539a on github
  • Prev Build on main (#22161656394)
  • Next Build on main (#22164671138)
  • 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