refactor: pre-1.0 state API consistency (Tick shape + idiomatic error names)#141
Merged
Conversation
Signed-off-by: Joshua Temple <[email protected]>
Signed-off-by: Joshua Temple <[email protected]>
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.
What this change does
Two pre-1.0 breaking consistency fixes on the
statepublic API, landed before the contracts freeze:ServiceRunner.Tickreturns[]FireResultlike the other drivers. It was the odd one out ((FireResult, bool));Scheduler.TickandActorSystem.Tickalready return a slice. Callers now checklen(results) > 0. A return type can't be unified additively later, so this had to happen pre-freeze.*Errorsuffix. The 15Err*-prefix structs plusMultiRegionErrare renamed to the*Errorsuffix (ErrInvalidTransitiontoInvalidTransitionError, and so on), matchingVerifyError/SnapshotError/WaitTimeoutErrorand Go convention. TheErr*prefix is the convention for sentinel error values; these are struct types youerrors.Asinto, and there are no sentinel values in the package.Why
These are the two now-or-never items from the pre-1.0 API audit: both are breaking, so they belong before the freeze rather than as a future v2 break. Idiomatic error naming also signals a hand-built, conventional library.
Checklist
git commit -s) per the DCOtype: subject)go vets clean;statetests green