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

map-services / company-data-api / 26001659459
40%

Build:
DEFAULT BRANCH: main
Ran 17 May 2026 08:20PM UTC
Jobs 1
Files 15
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

17 May 2026 08:20PM UTC coverage: 40.099% (+1.2%) from 38.86%
26001659459

push

github

web-flow
fix: convert to JSON structured logging using `log/slog` (#102)

* fix: automated code generation from Gemini for #101

* chore: iterative updates from Gemini based on PR comment

The requested request middleware has been implemented for the Gin router.

### Summary of Changes

1.  **Created **: Added a new Gin middleware called  which logs the status, method, path, query, latency, and client IP of every request.
2.  **Updated **:
    *   Imported .
    *   Registered  in the  chain of the API server.

The code has been verified and compiles correctly.

* chore: iterative updates from Gemini based on PR comment

The `RequestLogger` middleware has been refactored to support variadic exclude paths and now mirrors the implementation pattern from the requested repository. Unit tests have been added to verify that the middleware correctly logs standard requests and skips excluded paths.

### Changes Summary
- **Refactored `internal/middleware/request.go`**: Updated `RequestLogger` to accept a logger and variadic `excludedPaths`. It now correctly filters requests based on the provided paths and uses the `slog` logger with consistent formatting.
- **Updated `cmd/api_server.go`**: Updated the middleware configuration to pass `slog.Default()` and the excluded paths (`/healthz` and `/metrics`) to `RequestLogger`.
- **Added `internal/middleware/request_test.go`**: Created new unit tests to confirm the logging behavior and path exclusion logic, ensuring they function as expected in `gin` environments.

Tests have been verified to pass using `go test`.

* refactor: centralize logger and unify init flow

- Moved `pkg/logger` to `internal/logger.go` to enforce internal usage.
- Standardized application initialization by returning the logger
instance.
- Updated `godx` diagnostics to consume the configured logger.
- Removed redundant Gin logger middleware to streamline output.

```mermaid
graph LR
    subgraph Initialization
    A[Entry Point] --> B[internal.SetupLogg... (continued)

30 of 88 new or added lines in 11 files covered. (34.09%)

5 existing lines in 3 files now uncovered.

324 of 808 relevant lines covered (40.1%)

0.46 hits per line

Uncovered Changes

Lines Coverage ∆ File
14
0.0
0.0% cmd/api_server.go
8
0.0
internal/logger.go
7
0.0
0.0% cmd/code_point.go
7
0.0
0.0% cmd/companies_house.go
6
0.0
0.0% internal/downloader.go
4
75.68
0.0% internal/importer/code_point.go
4
83.25
0.0% internal/importer/company_data.go
3
0.0
0.0% internal/repositories/search.go
2
92.31
internal/middleware/logger.go
2
0.0
0.0% internal/routes/search.go
1
0.0
0.0% internal/db.go

Coverage Regressions

Lines Coverage ∆ File
3
0.0
0.0% cmd/api_server.go
1
0.0
0.0% cmd/code_point.go
1
0.0
0.0% cmd/companies_house.go
Jobs
ID Job ID Ran Files Coverage
1 26001659459.1 17 May 2026 08:20PM UTC 15
40.1
GitHub Action Run
Source Files on build 26001659459
  • Tree
  • List 15
  • Changed 3
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 3324c6ce on github
  • Prev Build on main (#26000550293)
  • Next Build on main (#26018112543)
  • 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