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

stacklok / toolhive / 24274112989
66%

Build:
DEFAULT BRANCH: main
Ran 11 Apr 2026 04:01AM UTC
Jobs 1
Files 616
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

11 Apr 2026 03:56AM UTC coverage: 65.501% (+0.04%) from 65.458%
24274112989

push

github

web-flow
Fix stale config in registry routes and WorkloadService (#4751)

* Fix stale config in registry routes and WorkloadService

Two independent config snapshots caused inconsistency after enterprise
registry changes:

1. NewRegistryRoutes/NewRegistryRoutesForServe created separate
   config.Provider instances for configProvider and configService.
   This meant getRegistry responses mixed live metadata (from configService)
   with stale server lists (from the old independent provider). Fix: create
   a single provider p and pass it to both.

2. WorkloadService.appConfig was a one-time snapshot taken at construction.
   After an enterprise registry change, new workloads got stale registry
   URLs written into their persisted RunConfig. Fix: store config.Provider
   and call GetConfig() at the point of use in BuildFullRunConfig.

Add tests verifying:
- configService and getCurrentProvider share the same provider instance
  (listRegistries returns consistent type/source and server count)
- WorkloadService.configProvider is initialized at construction

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Address bot review: fix factory bypass and TOCTOU in WorkloadService

- Replace config.NewDefaultProvider() with config.NewProvider() in
  NewWorkloadService so a registered ProviderFactory is respected,
  consistent with the analogous fix in NewRegistryRoutes
- Hoist cfg := s.configProvider.GetConfig() once at the top of the
  relevant block in BuildFullRunConfig so both uses (ResolveRegistrySourceURLs
  and DisableUsageMetrics) see the same config snapshot within a single call
- Add TestNewWorkloadService_RespectsRegisteredFactory to verify the
  factory-backed provider is actually used

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>

11 of 11 new or added lines in 2 files covered. (100.0%)

10 existing lines in 3 files now uncovered.

56379 of 86074 relevant lines covered (65.5%)

61.67 hits per line

Coverage Regressions

Lines Coverage ∆ File
5
75.0
-7.81% pkg/registry/service.go
3
79.38
-0.77% pkg/transport/proxy/httpsse/http_proxy.go
2
73.63
-0.64% pkg/runner/config.go
Jobs
ID Job ID Ran Files Coverage
1 24274112989.1 11 Apr 2026 04:01AM UTC 616
65.5
GitHub Action Run
Source Files on build 24274112989
  • Tree
  • List 616
  • Changed 8
  • Source Changed 2
  • Coverage Changed 8
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #24274112989
  • c9a5402c on github
  • Prev Build on main (#24268402333)
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