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

rm-hull / dot-block / 27106074721
61%

Build:
DEFAULT BRANCH: main
Ran 07 Jun 2026 10:01PM UTC
Jobs 1
Files 29
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

07 Jun 2026 10:00PM UTC coverage: 60.984% (-0.1%) from 61.1%
27106074721

push

github

web-flow
fix: Add new POST /check endpoint (#147)

* fix: automated code generation from Gemini for #145

* chore: iterative updates from Gemini based on PR comment

I have completed the requested refactoring of the blocklist handlers.

### Changes Made:
1.  **New Routes Package**: Created `internal/routes/blocklist.go` and implemented `BlocklistHandler`.
2.  **Dependency Injection**: Moved the handler logic out of `BlocklistUpdater` and into `BlocklistHandler`, which takes a `*blocklist.BlocklistUpdater` as a dependency.
3.  **Validation Logic**:
    *   Added a check to ensure no more than 100 domains are present in the request list.
    *   Added validation for each domain using `dns.IsDomainName` to ensure they are valid FQDNs.
    *   Returns `400 Bad Request` with an appropriate error message if validation fails.
4.  **Application Wiring**: Updated `internal/app.go` to instantiate `BlocklistHandler` and wire it to the `/reload` and `/check` endpoints.
5.  **Cleanup**: Exported necessary fields in `BlocklistUpdater` and removed the old handler methods from the `blocklist` package.
6.  **Testing**: Updated `internal/check_test.go` to use the new `BlocklistHandler` and verified that all tests in `internal/...` pass.

All tests passed successfully.

* chore: iterative updates from Gemini based on PR comment

I have completed the requested changes to document and test the new management endpoints.

### Changes made:
- **`test.http`**: Added test cases for the `/check` endpoint, supporting both JSON array and plain text (newline-separated) request bodies.
- **`README.md`**: Added a new **Management API** section describing the `/metrics`, `/reload`, and `/check` endpoints, including their behavior and authentication requirements.

* chore: iterative updates from Gemini based on PR comment

I have implemented the requested changes to the `/check` handler to ensure that errors from the blocklist check are properly handled.

### Changes made:
1.  **Updated `Block... (continued)

52 of 89 new or added lines in 6 files covered. (58.43%)

7 existing lines in 1 file now uncovered.

1252 of 2053 relevant lines covered (60.98%)

837.3 hits per line

Uncovered Changes

Lines Coverage ∆ File
20
64.91
internal/routes/blocklist.go
6
25.0
internal/routes/middleware.go
6
0.0
internal/routes/root.go
4
60.0
5.28% internal/blocklist/update.go
1
60.23
-0.16% internal/app.go

Coverage Regressions

Lines Coverage ∆ File
7
60.23
-0.16% internal/app.go
Jobs
ID Job ID Ran Files Coverage
1 27106074721.1 07 Jun 2026 10:01PM UTC 29
60.98
GitHub Action Run
Source Files on build 27106074721
  • Tree
  • List 29
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 7a1531b1 on github
  • Prev Build on main (#27101957393)
  • Next Build on main (#27108519946)
  • 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