Update dogma to v0.24.0 and enginekit to v0.26.0#461
Merged
Conversation
- Rename Timeout -> Deadline throughout (types, methods, facts, log strings) - Add Mutate() method to process scope (new dogma.ProcessScope requirement) - Remove TestEngine / enginetest.RunTests() usage (enginetest package removed)
There was a problem hiding this comment.
Pull request overview
This PR updates the module to dogma v0.24.0 and enginekit v0.26.0, aligning the testkit engine and related helpers with upstream breaking changes (notably the Timeout → Deadline rename and updated process-scope requirements).
Changes:
- Renamed Timeout concepts to Deadline across public helpers, envelope APIs, facts/logging, engine routing, and tests.
- Implemented the new
Mutate()method on the process scope to satisfy updateddogma.ProcessScope[...]requirements. - Removed usage of the removed
enginekit/enginetestparent package and updated tests accordingly.
Reviewed changes
Copilot reviewed 22 out of 23 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| validation.go | Renames Timeout validation scope helper to Deadline. |
| validation_test.go | Updates validation scope creation test to use Deadline helper. |
| internal/validation/validation.go | Renames internal Timeout validation scope to Deadline. |
| internal/inflect/inflect.go | Updates inflection substitutions/corrections for Deadline kind. |
| internal/inflect/inflect_test.go | Updates inflection tests for Deadline terminology. |
| go.mod | Bumps dogma/enginekit versions to the requested releases. |
| go.sum | Updates dependency checksums for the new dependency graph. |
| fact/process.go | Renames process facts from Timeout* to Deadline* and updates fields/comments. |
| fact/logger.go | Updates fact logger routing and log messages for Deadline facts. |
| fact/logger_test.go | Updates logger tests to use Deadline envelopes/messages and expected strings. |
| expectation.messagetype.command_test.go | Updates expectations to use deadline scheduling APIs/types. |
| expectation.messagematch.command_test.go | Updates expectations to use deadline scheduling APIs/types. |
| expectation.messagecommon.go | Updates produced-message tracking for DeadlineScheduledByProcess facts. |
| expectation.message.command_test.go | Updates expectations to use deadline scheduling APIs/types. |
| envelope/envelope.go | Renames NewTimeout() to NewDeadline() and updates ScheduledFor docs. |
| envelope/envelope_test.go | Updates envelope tests for NewDeadline(). |
| engine/internal/process/scope.go | Implements Mutate() and renames scheduling from timeout to deadline. |
| engine/internal/process/scope_test.go | Updates process scope tests for deadline scheduling/handling. |
| engine/internal/process/controller.go | Renames controller state/routing/handling from timeouts to deadlines. |
| engine/internal/process/controller_test.go | Updates controller tests for deadline semantics and names. |
| engine/engine.go | Updates dispatch logic to treat DeadlineKind as origin-routed. |
| engine/engine_test.go | Removes enginetest.RunTests() usage; keeps remaining engine tests. |
| action.advancetime.go | Updates doc comment wording from timeout to deadline. |
Comments suppressed due to low confidence (1)
engine/engine.go:281
- There is no test coverage confirming that deadline envelopes are always dispatched back to their origin handler (and not routed via e.routes), nor that Engine.Dispatch() panics when called with a deadline message. Adding targeted tests in engine/engine_test.go would help prevent regressions in this deadline-specific dispatch path.
if mt.Kind() == message.DeadlineKind {
// always dispatch deadline messages back to their origin handler
controllers = []controller{
e.controllers[env.Origin.Handler.Identity().GetName()],
}
} else {
controllers = e.routes[mt]
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Add location.OfCallSkip(n) for callers that need to skip dogma's typed adapter frame (untypedProcessEventScope/DeadlineScope.Mutate) - Use OfCallSkip(1) in scope.Mutate so the panic location points at the handler code rather than dogma internals - Add TestScope/Mutate sub-tests: normal mutation and panic-on-ended
…tion OfCallSkip(1) assumed exactly one dogma adapter frame, which breaks if the adapter is removed or gains extra layers. OfCallOutsidePackage skips frames by package prefix instead, so the location is always the first frame outside github.com/dogmatiq/dogma regardless of adapter depth.
All callers of OfCall() go through dogma typed adapters anyway, and the three action.*.go sites have no dogma frames on the stack so skipping is a no-op there. Removing OfCallOutsidePackage simplifies the API to a single function that always does the right thing.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 23 out of 24 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Bumps
dogmato v0.24.0 andenginekitto v0.26.0.Breaking changes addressed
dogma v0.24.0
Timeoutsymbols toDeadlinethroughout (types, methods, facts, log strings, error messages, doc comments)Mutate()method to the process scope implementation (newdogma.ProcessScope[R]interface requirement)enginekit v0.26.0
TestEngine/enginetest.RunTests()usage — theenginetestparent package was removed; theenginetest/stubssub-package is still present and used