Repository navigation
fix(registry): make HTTP checks deterministic - #135
Conversation
Signed-off-by: MagicalCoder <kuppamajith@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughChangesThe registry service now uses one injectable private HTTP client with a 10-second production timeout. Tests use a fake client to validate registry requests, transport errors, response handling, dispatch, GCR validation, and authorization headers. Registry HTTP testing
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to Registry connection checks now use a shared injectable HTTP client while retaining the production timeout. The targeted registry flows have deterministic coverage, and no current merge-readiness risk remains. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Linked Issues checkExplanation The changes satisfy issue Full details: Out of Scope Changes checkExplanation The changes remain within issue
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Closes #130
httpClientseam (Do(*http.Request) (*http.Response, error)) toRegistryService;NewRegistryService()wires&http.Client{Timeout: 10*time.Second}(existing 10s timeout preserved, verified in test without triggering Mongo panic).&http.Client{Timeout: 10*time.Second}intestDockerHubConnection/testGHCRConnection/testACRConnection/testCustomRegistryConnectionwiths.httpClient.Do.services/registry_service_test.go(314 lines, focused for XS scope): canonical table-drivenTestRegistryHTTPConnection_SuccessAndTransportErrorcovering Docker Hub / GHCR / ACR / Custom success (200) + transport error viafakeHTTPClient(no network), plus preserved unique coverage: Docker Hub 401, unexpected 500, Custom no-auth header, GCR JSON validation, dispatch/unsupported type, injected-client wiring, Authorization header format.Verified:
go vet ./services/...andgo test ./services/... -count=1pass.