Skip to content

feat(pipeline_step): Add emergency patch support for deployments#233

Merged
fpacifici merged 2 commits intomainfrom
feat/emergency-patch-support
Feb 5, 2026
Merged

feat(pipeline_step): Add emergency patch support for deployments#233
fpacifici merged 2 commits intomainfrom
feat/emergency-patch-support

Conversation

@fpacifici
Copy link
Collaborator

@fpacifici fpacifici commented Feb 4, 2026

Summary

Adds support for emergency patches to the PipelineStep sentry-kube macro, allowing clients to override any deployment configuration without code changes.

Changes

  • Add optional emergency_patch field to PipelineStepContext TypedDict
  • Update parse_context() to handle emergency_patch parsing (supports both dict and YAML string)
  • Apply emergency_patch as the final merge layer in run() method (after base + user + pipeline additions)
  • Add comprehensive test verifying emergency patch overrides work correctly

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

…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>
@fpacifici fpacifici requested a review from a team as a code owner February 4, 2026 20:07
@linear
Copy link

linear bot commented Feb 4, 2026

@github-actions
Copy link

github-actions bot commented Feb 4, 2026

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

  • (pipeline_step) Add emergency patch support for deployments by fpacifici in #233
  • (sentry_integration) Exec app in subprocess by victoria-yining-huang in #217

Other

  • Require sink at the end of a branch of the pipeline by fpacifici in #230
  • Move gcssink config override out of the adapter by fpacifici in #228

🤖 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>
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Additional Locations (1)

Fix in Cursor Fix in Web

@fpacifici fpacifici merged commit e14cf7d into main Feb 5, 2026
22 checks passed
@fpacifici fpacifici deleted the feat/emergency-patch-support branch February 5, 2026 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants