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

stacklok / toolhive / 22853807089

09 Mar 2026 12:38PM UTC coverage: 63.914% (-0.003%) from 63.917%
22853807089

push

github

web-flow
Move shared git package from operator to pkg/git (#4045)

* Move shared git package from operator to pkg/git

The operator's git package (CloneConfig, Client interface, LimitedFs,
DefaultGitClient) is needed by both the operator and the CLI for
git-based skill installation. Move it to pkg/git/ so both can share it.

Changes during move:
- Replace controller-runtime/pkg/log with log/slog
- Add WithAuth ClientOption for authenticated clones
- Remove runtime.GC() call from Cleanup (unnecessary; Go GC handles it)
- Update tests to use t.Context() instead of controller-runtime logger
- Rewrite tests with testify assertions and t.TempDir()
- Drop trivial field-accessibility tests and slow network-dependent tests

No functional changes to the operator — the package was not yet imported
by any operator code.

Relates to #4015

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

* Address review feedback and harden pkg/git

- Use errors.New for sentinel errors in fs.go
- Add ErrNilRepository sentinel replacing duplicate fmt.Errorf strings
- Add path traversal validation in GetFileContent
- Add CloneConfig.validate() rejecting conflicting Branch/Tag/Commit
- Log util.RemoveAll failures in Cleanup with slog.Warn
- Add tag-based clone integration test
- Add path traversal and validation unit tests
- Improve integration test comments

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

---------

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

35 of 46 new or added lines in 2 files covered. (76.09%)

9 existing lines in 4 files now uncovered.

47317 of 74032 relevant lines covered (63.91%)

69.59 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

79.79
/pkg/transport/proxy/httpsse/http_proxy.go


Source Not Available

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