Skip to content

Migrate to github.com/moby/moby packages#503

Merged
arnested merged 5 commits intomainfrom
use-moby
Apr 20, 2026
Merged

Migrate to github.com/moby/moby packages#503
arnested merged 5 commits intomainfrom
use-moby

Conversation

@arnested
Copy link
Copy Markdown
Owner

@arnested arnested commented Apr 20, 2026

  • Migrate to github.com/moby/moby packages
  • Fix golangci-lint findings
  • Improve test coverage for internal/container
  • Add tests for internal/log package
  • Add tests for main package

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 20, 2026

Codecov Report

❌ Patch coverage is 35.71429% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 36.26%. Comparing base (303f4e1) to head (388c81e).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
container.go 11.11% 8 Missing ⚠️
main.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #503      +/-   ##
==========================================
+ Coverage   28.12%   36.26%   +8.14%     
==========================================
  Files           7        7              
  Lines         288      284       -4     
==========================================
+ Hits           81      103      +22     
+ Misses        205      176      -29     
- Partials        2        5       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

arnested and others added 5 commits April 20, 2026 23:09
- Replace github.com/docker/docker/client with github.com/moby/moby/client v0.4.1
- Replace github.com/docker/docker/api with github.com/moby/moby/api v1.54.2
- Completely eliminate all github.com/docker/docker dependencies

API changes:
- Update to new client API (ContainerListResult, EventsResult)
- Use Filters as map[string]map[string]bool instead of filters.Args
- Handle IPAddress as netip.Addr instead of string
- Use container.InspectResponse instead of ContainerJSON

Test data:
- Remove invalid port entries from testdata/container.json

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Replace deprecated client.NewClientWithOpts with client.New
- Remove deprecated client.WithAPIVersionNegotiation option
- Remove unnecessary type conversion events.Action(msg.Action)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add edge case tests for Services function:
- Test unknown service ports (no service found)
- Test unknown protocol types
- Test multiple ports with mixed results
- Test empty IP addresses

Add helper function createTestContainerWithPorts to reduce code duplication
and keep tests under function length limits.

Coverage remains at 82.9% - uncovered lines are error paths that cannot
be reached with valid moby API types (they validate during JSON unmarshal).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add comprehensive tests covering:
- Priority constant values (PriEmerg through PriDebug)
- Logf function with various message formats
- All priority levels
- Edge cases (empty messages, formatted messages)

Coverage: 66.7% (uncovered path is panic handler when journald fails,
which cannot be easily tested in unit tests)

Tests handle environments without systemd/journald gracefully.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add comprehensive tests covering:
- ignoreOneoff function with enabled/disabled configurations
- Various oneoff label scenarios (True, False, missing, unexpected)
- getVersion function
- gops function
- newEntryGroups constructor
- Constants validation

Coverage: 12.2%

Tests are split into separate functions to meet function length limits.
Helper function createTestContainer reduces code duplication.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@arnested arnested marked this pull request as ready for review April 20, 2026 21:20
@arnested arnested merged commit 61edc68 into main Apr 20, 2026
25 checks passed
@arnested arnested deleted the use-moby branch April 20, 2026 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant