System param validation for observers, system registry and run once#15526
Merged
alice-i-cecile merged 10 commits intobevyengine:mainfrom Sep 30, 2024
Merged
System param validation for observers, system registry and run once#15526alice-i-cecile merged 10 commits intobevyengine:mainfrom
alice-i-cecile merged 10 commits intobevyengine:mainfrom
Conversation
79103ff to
8d12cf9
Compare
8d12cf9 to
70789ac
Compare
Member
alice-i-cecile
left a comment
There was a problem hiding this comment.
Simple and effective; I'm pleased that adapting these to the new system param validation framework was so easy.
I have some feedback on docs / error messages that I'd like to resolve before we merge if possible.
Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
alice-i-cecile
approved these changes
Sep 29, 2024
bushrat011899
approved these changes
Sep 30, 2024
Contributor
bushrat011899
left a comment
There was a problem hiding this comment.
Nice change! I've suggested a handful of comments to help with understanding why the new tests should fail (resource not available in the world). On first glance I missed that was the cause of the failure and was quite confused!
Co-authored-by: Zachary Harrold <zac@harrold.com.au>
robtfm
pushed a commit
to robtfm/bevy
that referenced
this pull request
Oct 4, 2024
…evyengine#15526) # Objective Fixes bevyengine#15394 ## Solution Observers now validate params. System registry has a new error variant for when system running fails due to invalid parameters. Run once now returns a `Result<Out, RunOnceError>` instead of `Out`. This is more inline with system registry, which also returns a result. I'll address warning messages in bevyengine#15500. ## Testing Added one test for each case. --- ## Migration Guide - `RunSystemOnce::run_system_once` and `RunSystemOnce::run_system_once_with` now return a `Result<Out>` instead of just `Out` --------- Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com> Co-authored-by: Zachary Harrold <zac@harrold.com.au>
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.
Objective
Fixes #15394
Solution
Observers now validate params.
System registry has a new error variant for when system running fails due to invalid parameters.
Run once now returns a
Result<Out, RunOnceError>instead ofOut.This is more inline with system registry, which also returns a result.
I'll address warning messages in #15500.
Testing
Added one test for each case.
Migration Guide
RunSystemOnce::run_system_onceandRunSystemOnce::run_system_once_withnow return aResult<Out>instead of justOut