Skip to content

Conversation

@JAORMX
Copy link
Collaborator

@JAORMX JAORMX commented Nov 26, 2025

Summary

Add configuration model and validation for build-time environment variables that will be injected into protocol build Dockerfiles (npx://, uvx://, go://). This enables organizations to configure custom package mirrors for corporate environments.

  • Add BuildEnv map to Config struct for storing environment variables
  • Add validation functions for env var keys (must be uppercase, no reserved system keys like PATH, HOME)
  • Add validation functions for env var values (reject shell metacharacters to prevent injection)
  • Extend Provider interface with build env operations (Set, Get, GetAll, Unset, UnsetAll)
  • Implement for DefaultProvider, PathProvider, and KubernetesProvider (no-op)
  • Add comprehensive tests for validation and provider operations

This is the foundation for THV-2732 custom package registry support. The CLI commands and Dockerfile template integration will follow in a separate PR.

Test plan

  • Unit tests for key validation (format, reserved keys)
  • Unit tests for value validation (dangerous characters)
  • Unit tests for provider operations (PathProvider, KubernetesProvider)
  • task test passes
  • task lint passes

🤖 Generated with Claude Code

@github-actions github-actions bot added the size/M Medium PR: 300-599 lines changed label Nov 26, 2025
Add configuration model and validation for build-time environment
variables that will be injected into protocol build Dockerfiles.

Changes:
- Add BuildEnv map[string]string field to Config struct
- Add validation functions for env var keys (uppercase, no reserved keys)
- Add validation functions for env var values (no shell metacharacters)
- Extend Provider interface with SetBuildEnv, GetBuildEnv, GetAllBuildEnv,
  UnsetBuildEnv, and UnsetAllBuildEnv methods
- Implement for DefaultProvider, PathProvider, and KubernetesProvider
- Add comprehensive tests for validation and provider operations

This is the foundation for THV-2732 custom package registry support.
The CLI commands and template integration will follow in a separate PR.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@JAORMX JAORMX force-pushed the build-env-config-foundation branch from 177c3d0 to 826d2be Compare November 26, 2025 03:00
@github-actions github-actions bot added size/M Medium PR: 300-599 lines changed and removed size/M Medium PR: 300-599 lines changed labels Nov 26, 2025
@codecov
Copy link

codecov bot commented Nov 26, 2025

Codecov Report

❌ Patch coverage is 88.63636% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 55.83%. Comparing base (1200343) to head (54884a3).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
pkg/config/interface.go 66.66% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2740      +/-   ##
==========================================
+ Coverage   55.73%   55.83%   +0.10%     
==========================================
  Files         314      315       +1     
  Lines       30510    30598      +88     
==========================================
+ Hits        17004    17084      +80     
- Misses      12019    12028       +9     
+ Partials     1487     1486       -1     

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

@github-actions github-actions bot added size/M Medium PR: 300-599 lines changed and removed size/M Medium PR: 300-599 lines changed labels Nov 26, 2025
@JAORMX JAORMX merged commit b33cf66 into main Nov 26, 2025
36 of 44 checks passed
@JAORMX JAORMX deleted the build-env-config-foundation branch November 26, 2025 13:26
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants