Skip to content

Conversation

@JAORMX
Copy link
Collaborator

@JAORMX JAORMX commented Nov 26, 2025

Summary

Add CLI commands and Dockerfile template integration for the build environment configuration added in #2740.

CLI Commands:

  • thv config set-build-env KEY value - Set a validated environment variable
  • thv config get-build-env [KEY] - Show one or all configured variables
  • thv config unset-build-env KEY - Remove a specific variable
  • thv config unset-build-env --all - Remove all variables

Template Integration:

  • Add BuildEnv field to TemplateData struct
  • Update npx.tmpl, uvx.tmpl, go.tmpl to inject ENV directives at top of builder stage
  • Modify protocol handler to load build env from config automatically

Example usage:

# Configure custom package mirrors thv config set-build-env NPM_CONFIG_REGISTRY https://npm.corp.example.com thv config set-build-env GOPROXY https://goproxy.corp.example.com # View configuration thv config get-build-env # Run protocol builds (automatically uses configured mirrors) thv run npx://@modelcontextprotocol/server-github

This completes THV-2732 custom package registry support.

Test plan

  • Unit tests for template rendering with BuildEnv
  • Manual testing of CLI commands (set, get, unset, --all)
  • task test passes
  • task lint passes

🤖 Generated with Claude Code

Add CLI commands and Dockerfile template integration for the build environment configuration added in the previous PR. CLI Commands: - thv config set-build-env KEY value: Set a validated env variable - thv config get-build-env [KEY]: Show one or all configured variables - thv config unset-build-env KEY: Remove a specific variable - thv config unset-build-env --all: Remove all variables Template Integration: - Add BuildEnv field to TemplateData struct - Update npx.tmpl, uvx.tmpl, go.tmpl to inject ENV directives - Modify protocol handler to load build env from config Example usage: thv config set-build-env NPM_CONFIG_REGISTRY https://npm.corp.example.com thv config set-build-env GOPROXY https://goproxy.corp.example.com thv run npx://@modelcontextprotocol/server-github 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Juan Antonio Osorio <ozz@stacklok.com>
@github-actions github-actions bot added the size/M Medium PR: 300-599 lines changed label Nov 26, 2025
@codecov
Copy link

codecov bot commented Nov 26, 2025

Codecov Report

❌ Patch coverage is 57.14286% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 55.82%. Comparing base (b33cf66) to head (19a21fb).
⚠️ Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
pkg/runner/protocol.go 57.14% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@ Coverage Diff @@ ## main #2742 +/- ## ========================================== + Coverage 55.81% 55.82% +0.01%  ========================================== Files 315 315 Lines 30598 30605 +7 ========================================== + Hits 17079 17086 +7  Misses 12032 12032 Partials 1487 1487 

☔ 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.
@JAORMX JAORMX requested review from danbarr and dmjb November 26, 2025 13:53
@JAORMX JAORMX merged commit 62d4d57 into main Nov 26, 2025
33 checks passed
@JAORMX JAORMX deleted the build-env-cli-templates branch November 26, 2025 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Medium PR: 300-599 lines changed

3 participants