Add Calamari script timeout and localize K8s namespace resolution
Summary
Two small correctness fixes that harden the execution path with no wire, DB, enum, or interface changes.
-
Calamari wall-clock timeout (
ProcessRunner): an opt-inSQUID_CALAMARI_SCRIPT_TIMEOUT_MINUTESenv var, read at call time. Unset / non-numeric / non-positive preserves today's behaviour (wait until exit or caller cancellation), so long deployments are never killed by default. When set to a positive integer, an overrunning child is killed (whole process tree), the runner emits a clear stderr line naming the env var, and returns exit124— a hung script can no longer pin the work directory or the calling thread forever.IProcessRunneris unchanged. -
K8s namespace genericity leak: the transport-agnostic
ExecuteStepsPhaseno longer reads the Kubernetes-specificSquid.Action.Kubernetes.Namespacevariable. The two Kubernetes intent renderers now resolve + expand it themselves via a sharedKubernetesTargetNamespaceResolver, using the render context's variable dictionary.IntentRenderContextswaps the pre-resolvedTargetNamespacestring for a genericVariableDictionary. Project-overrides-endpoint precedence and#{...}template expansion are preserved exactly.
Why non-breaking
-
IProcessRunnersignature unchanged; defaultExecuteAsyncpath is byte-identical when the env var is unset. -
ScriptExecutionRequest.TargetNamespaceandStartScriptCommand.TargetNamespace(the Halibut wire contract) are untouched — the agent still receives the same namespace. - No enum / wire / DB / migration changes. The only constructors of
IntentRenderContextare the pipeline and unit tests, both updated.
Test plan
-
ProcessRunnerTests: env-var constant pinned (Rule 8), parse cases (unset/invalid/non-positive → no timeout; positive → minutes), kill-on-timeout returns 124 + stderr names the env var, finishes-within-timeout returns the real exit code. -
KubernetesTargetNamespaceResolverTests: literal,#{...}template expansion, project-first precedence, absent → null, empty → empty. -
KubernetesApi/KubernetesAgentrenderer tests: new template-expansion cases; all existing namespace tests pass through the new variable path unchanged. -
Full unit sweep: 5689 passed. Full Calamari suite: 545 passed. Full solution build: 0 errors.