refactor: split internal/lambda into handler sub-packages#71
Merged
dwsmith1983 merged 9 commits intomainfrom Mar 29, 2026
Merged
refactor: split internal/lambda into handler sub-packages#71dwsmith1983 merged 9 commits intomainfrom
dwsmith1983 merged 9 commits intomainfrom
Conversation
…ule access Relocates the validation package so that external modules (e.g. chaos-data) can import it. Updates all 6 internal importers to the new path.
… watchdog event type
Create orchestrator, stream, watchdog, sla, alert, sink sub-packages. Root retains shared types, interfaces, and utilities. Sub-packages import root; root never imports sub-packages.
…legation - Replace buildTriggerConfig switch with generic registry map - HandleWatchdog returns errors.Join, publishes degraded event - SLA calculate delegates to pkg/sla pure functions - Move CapturePostRunBaseline to root, add deprecation comments
- ValidateEnv smoke tests for all 6 Lambda handlers - Centralize triggerUnmarshalers in trigger_registry.go - Log PublishEvent errors in watchdog instead of discarding
- README: project structure reflects new sub-packages and pkg/sla - CHANGELOG: v0.9.4 entry with refactored, added, and fixed sections - aws.md: watchdog section updated to 8 checks + degraded event - watchdog.md: full check list, error handling, and WATCHDOG_DEGRADED event
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
internal/lambda/package (46 files) into 6 handler-aligned sub-packages:orchestrator/,stream/,watchdog/,sla/,alert/,sink/pkg/sla/with pure SLA deadline calculation functionsPipelineConfig.DeepCopy()for safe config cache isolationHandleWatchdogto return aggregate errors and publishWATCHDOG_DEGRADEDeventbuildTriggerConfigswitch with generic registry mapcmd/lambda/packagesMotivation
The
internal/lambda/package grew to 46 files handling orchestration, stream routing, watchdog detection, SLA monitoring, alerting, reruns, drift detection, and dry-run evaluation — all in a single namespace with no interface boundaries. This restructure adds package-level encapsulation while preserving all existing behavior.What changed
internal/lambda/errors.Join, publishesWATCHDOG_DEGRADEDpkg/sla/DeepCopy()methodMigration note
Root-level handler files (
orchestrator.go,stream_router.go, etc.) are retained as deprecated stubs for backward compatibility with existing tests. A follow-up will migrate tests to sub-packages and remove these stubs.