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

rm-hull / dot-block / 29107864483
62%

Build:
DEFAULT BRANCH: main
Ran 10 Jul 2026 04:35PM UTC
Jobs 1
Files 32
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 Jul 2026 04:34PM UTC coverage: 62.521% (+0.6%) from 61.878%
29107864483

push

github

web-flow
fix: optimize memory usage for blocklist loading (#182)

* feat: optimize memory usage for blocklist loading

Refactored blocklist loading to stream files from disk, significantly
reducing memory overhead by calculating exact Bloom filter size before
allocation.

```mermaid
sequenceDiagram
    participant App
    participant Downloader
    participant FileSystem
    participant BloomFilter

    App->>Downloader: Download blocklists
    Downloader-->>FileSystem: Store temp files
    App->>FileSystem: Count entries in files
    FileSystem-->>App: Total count
    App->>BloomFilter: Initialize with size (totalCount)
    App->>FileSystem: Stream files
    FileSystem-->>BloomFilter: Add entries to filter
    App->>FileSystem: Cleanup temp files
```

* refactor: simplify blocklist initialization

Remove conditional check for nil items in `NewBlockList` and allow
`Load` to handle empty or nil slices gracefully to prevent potential
runtime panics during initialization. Added regression tests to ensure
`IsBlocked` remains stable with empty input.

* refactor: ensure blocklist temp files are cleaned up

Move the slice initialization and the `defer` cleanup logic before the
download loop. This ensures that any successfully downloaded temporary
files are tracked and removed even if a subsequent download fails.

```mermaid
sequenceDiagram
    participant B as BlocklistUpdater
    participant D as Downloader
    B->>B: Init files slice
    B->>B: Setup defer cleanup
    loop Each URL
        B->>D: Download file
        D-->>B: Return path/isTemp
        B->>B: Append to files
    end
    B->>B: Process counts
    B->>B: Trigger deferred cleanup
```

* refactor: improve blocklist parsing logic

- Trim whitespace from scanned lines to handle inconsistent formatting.
- Explicitly ignore double-octothorpe comment lines during scan.

* fix: prevent panic when initializing bloom filter

Added a safety check to ensure the bloom filter capacity is at least 1
when totalCoun... (continued)

65 of 107 new or added lines in 4 files covered. (60.75%)

4 existing lines in 2 files now uncovered.

1478 of 2364 relevant lines covered (62.52%)

731.8 hits per line

Uncovered Changes

Lines Coverage ∆ File
27
64.89
4.02% internal/blocklist/update.go
14
22.22
6.01% internal/downloader/download.go
1
59.25
2.68% internal/app.go

Coverage Regressions

Lines Coverage ∆ File
3
64.89
4.02% internal/blocklist/update.go
1
59.25
2.68% internal/app.go
Jobs
ID Job ID Ran Files Coverage
1 29107864483.1 10 Jul 2026 04:35PM UTC 32
62.52
GitHub Action Run
Source Files on build 29107864483
  • Tree
  • List 32
  • Changed 4
  • Source Changed 0
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 515ffbce on github
  • Prev Build on main (#29013679144)
  • Next Build on main (#29108151697)
  • 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