Skip to content

Adopt env package from toolhive-core#3572

Merged
ChrisJBurns merged 1 commit intomainfrom
adopt-env-from-toolhive-core
Feb 4, 2026
Merged

Adopt env package from toolhive-core#3572
ChrisJBurns merged 1 commit intomainfrom
adopt-env-from-toolhive-core

Conversation

@JAORMX
Copy link
Collaborator

@JAORMX JAORMX commented Feb 3, 2026

Summary

Third adoption from the shared toolhive-core library per THV-0032 RFC.

The env package provides a testable abstraction for environment variable access:

  • Reader interface for dependency injection
  • OSReader implementation wrapping os.Getenv
  • Generated mocks for testing isolation

API Changes

// Before
import "github.com/stacklok/toolhive/pkg/env"
import "github.com/stacklok/toolhive/pkg/env/mocks"

// After
import "github.com/stacklok/toolhive-core/env"
import "github.com/stacklok/toolhive-core/env/mocks"

No functional changes - the API is identical.

Test plan

  • task lint passes
  • Affected packages pass tests

🤖 Generated with Claude Code

Migrate from internal pkg/env to toolhive-core/env as the third
adoption from the shared library per THV-0032.

The env package provides a testable abstraction for environment
variable access via the Reader interface and OSReader implementation,
along with generated mocks for testing.

- Replace pkg/env imports with toolhive-core/env
- Replace pkg/env/mocks imports with toolhive-core/env/mocks
- Remove internal pkg/env package

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions github-actions bot added the size/S Small PR: 100-299 lines changed label Feb 3, 2026
@codecov
Copy link

codecov bot commented Feb 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.52%. Comparing base (f40c900) to head (ad84013).
⚠️ Report is 26 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3572      +/-   ##
==========================================
+ Coverage   65.47%   65.52%   +0.05%     
==========================================
  Files         403      403              
  Lines       39633    39779     +146     
==========================================
+ Hits        25951    26067     +116     
- Misses      11678    11700      +22     
- Partials     2004     2012       +8     

☔ 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.

Copy link
Collaborator

@ChrisJBurns ChrisJBurns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Always love seeing a 🔴 diff

@ChrisJBurns ChrisJBurns merged commit f16d0cc into main Feb 4, 2026
38 checks passed
@ChrisJBurns ChrisJBurns deleted the adopt-env-from-toolhive-core branch February 4, 2026 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S Small PR: 100-299 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants