feat(pipeline_step): Add emergency patch support for deployments#233
feat(pipeline_step): Add emergency patch support for deployments#233
Conversation
…ides Add optional emergency_patch field to PipelineStepContext that allows clients to override any deployment configuration as a final merge layer. This enables emergency production fixes without code changes. Changes: - Add NotRequired emergency_patch field to PipelineStepContext TypedDict - Update parse_context() to handle emergency_patch parsing - Apply emergency_patch as final layer in run() method after all other merges - Add test verifying emergency patch overrides work correctly Resolves STREAM-708 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Other
🤖 This preview updates automatically when you update the PR. |
Remove explanatory comments from emergency_patch implementation as requested in code review feedback. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| # Emergency patch to override replicas and add security context | ||
| "emergency_patch": { | ||
| "spec": { | ||
| "replicas": 3, # Override base template |
There was a problem hiding this comment.
Unremoved comments per reviewer request in PR discussion
Low Severity
The PR discussion shows reviewer @fpacifici requested "Please remove this comment" twice, but comments are still present in the test file. The inline comments like # Base template default, # Emergency patch to override replicas and add security context, and # Override base template in the test data appear to be what the reviewer wants removed.


Summary
Adds support for emergency patches to the PipelineStep sentry-kube macro, allowing clients to override any deployment configuration without code changes.
Changes
emergency_patchfield toPipelineStepContextTypedDictparse_context()to handle emergency_patch parsing (supports both dict and YAML string)run()method (after base + user + pipeline additions)Usage Example
{ "service_name": "my-service", "pipeline_name": "profiles", "deployment_template": {...}, "container_template": {...}, "pipeline_config": {...}, "pipeline_module": "sbc.profiles", "image_name": "my-image:latest", "segment_id": 0, "cpu_per_process": 1000, "memory_per_process": 512, # Optional: emergency patch to override any deployment settings "emergency_patch": { "spec": { "replicas": 3, "template": { "spec": { "securityContext": { "runAsNonRoot": True } } } } } }Resolves STREAM-708
🤖 Generated with Claude Code