Repository navigation
feat: forward selected host environment variables to managed workers - #1584
willkill07 merged 2 commits into
Conversation
Signed-off-by: Will Killian <[email protected]>
WalkthroughWorker load manifests now accept validated environment names and trailing-wildcard prefixes. Worker launches retain matching host variables while preserving baseline variables and Relay-supplied settings. Tests and documentation cover configuration, validation, and launch behavior. ChangesWorker environment forwarding
Priority: Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant PluginManifest
participant DynamicPluginManifestWorkerLoad
participant WorkerProcessLaunch
participant WorkerProcess
PluginManifest->>DynamicPluginManifestWorkerLoad: Deserialize and validate forward_env patterns
DynamicPluginManifestWorkerLoad->>WorkerProcessLaunch: Pass validated patterns
WorkerProcessLaunch->>WorkerProcess: Launch with retained host variables and Relay settings
Possibly related PRs
Merge Risk:
|
|
nit, but could be nice to include an example for plugin authors in the description - something like: |
Signed-off-by: Will Killian <[email protected]>
Overview
Let plugin authors select which host environment variables reach managed workers through
load.forward_envinrelay-plugin.toml. This allows worker-side environment references to resolve without adding end-user forwarding settings.Details
EXAMPLE_CONTEXT_IDandEXAMPLE_CONFIG_*. Reject malformed patterns and this option on native plugins.Plugin authors can select exact names and prefixes in
relay-plugin.toml:Rust API compatibility: callers that construct
DynamicPluginManifestWorkerLoadorDynamicPluginWorkerLoadContractdirectly must provide the newforward_envfield. Use an empty vector to keep the existing behavior. No worker protocol change is required.Validation:
just test-rust: 6,629 passed, 4 skipped.just docs-linkcheckpassed. The published-redirect comparison was skipped because the docs service returned HTTP 403.Binding suites were not run because no binding code or worker protocol changed; forwarding is implemented and tested in the shared Rust host.
Where should the reviewer start?
Start with
minimize_worker_environmentandspawn_worker_processincrates/core/src/plugin/dynamic/worker.rs, then the manifest validation incrates/core/src/plugin/dynamic/manifest.rs. Launch coverage is incrates/core/tests/unit/dynamic_worker_tests.rs.Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)
Summary by CodeRabbit