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

codozor / fwkeeper / 19614936618
45%

Build:
DEFAULT BRANCH: main
Ran 23 Nov 2025 05:41PM UTC
Jobs 1
Files 14
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

23 Nov 2025 05:41PM UTC coverage: 47.845% (-1.8%) from 49.624%
19614936618

push

github

web-flow
✨ feat: Implement typed error classification for pod lifecycle events (#10)

Add type-aware error handling to locators for intelligent retry strategies.
Instead of treating all errors identically, distinguish between transient errors
(retry with backoff) and permanent errors (fail fast).

## Implementation

**New Error Package** (internal/locator/errors.go)
- ErrorType enum with 10 classified error types:
  - Transient: NetworkTransient, APITransient, (pod initializing)
  - Permanent: ResourceNotFound, PodNotRunning, PodFailed, ConfigInvalid, PermissionDenied
  - Uncertain: NoPodAvailable (might retry longer based on context)
- LocateError wrapper with type info + error unwrapping
- Helper functions for creating typed errors: NewResourceNotFoundError(), NewPodFailedError(), etc.

**Updated Locators** (pod.go, service.go, selector_based_locator.go)
- Detect error types using Kubernetes API predicates (IsNotFound, IsTimeout, IsForbidden, etc.)
- Return typed LocateError instead of generic fmt.Errorf
- Classify API errors (timeout, forbidden, not found) separately from resource state errors
- Port mapping errors classified as ConfigInvalid (user configuration issues)

**Test Updates** (locator_test.go)
- Updated assertions to match new error messages (more specific, less generic)
- All 129 tests passing with zero regressions
- Error messages now clearly indicate error type: "X not found" vs "X is in failed state"

## Benefits

✅ Enables forwarder to implement intelligent retry strategies per error type
✅ Transient errors: exponential backoff retry
✅ Permanent errors: fail fast or give up after few attempts
✅ Better error messages: developers see what went wrong (config vs API vs resource)
✅ Foundation for improved observability: errors can be classified and monitored

42 of 147 new or added lines in 4 files covered. (28.57%)

433 of 905 relevant lines covered (47.85%)

0.53 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
7
75.86
-24.14% internal/locator/pod.go
19
59.09
-7.58% internal/locator/service.go
38
50.0
-19.84% internal/locator/selector_based_locator.go
41
38.81
internal/locator/errors.go
Jobs
ID Job ID Ran Files Coverage
1 19614936618.1 23 Nov 2025 05:41PM UTC 14
47.85
GitHub Action Run
Source Files on build 19614936618
  • Tree
  • List 14
  • Changed 4
  • Source Changed 0
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 6196e5e4 on github
  • Prev Build on main (#19614079436)
  • Next Build on main (#19781784572)
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