-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Define an ActionReturnStatus
for DataModel::Provider action returns
#34708
Merged
Conversation
This file contains 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
Review changes with SemanticDiff. |
pullapprove
bot
requested review from
andyg-apple,
anush-apple,
arkq,
axelnxp,
bauerschwan,
bzbarsky-apple,
carol-apple,
cecille,
chapongatien,
chrisdecenzo,
chshu,
chulspro and
cliffamzn
August 1, 2024 15:18
…omeip into imdm/action_returns
PR #34708: Size comparison from 4c1f325 to 5bf5dfe Full report (20 builds for cc13x4_26x4, cc32xx, mbed, nrfconnect, nxp, qpg, stm32, tizen)
|
PR #34708: Size comparison from 4c1f325 to 20410b3 Full report (4 builds for cc32xx, mbed, stm32)
|
bzbarsky-apple
approved these changes
Aug 1, 2024
PR #34708: Size comparison from 4c1f325 to a19f2bf Increases above 0.2%:
Full report (85 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, mbed, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
Co-authored-by: Boris Zbarsky <[email protected]>
Co-authored-by: Boris Zbarsky <[email protected]>
PR #34708: Size comparison from 4c1f325 to 316f6ec Increases above 0.2%:
Full report (49 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, linux, mbed, nrfconnect, nxp, psoc6, qpg, stm32, tizen)
|
harimau-qirex
approved these changes
Aug 2, 2024
tcarmelveilleux
approved these changes
Aug 2, 2024
PR #34708: Size comparison from 4c1f325 to f2e0812 Increases above 0.2%:
Full report (85 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, mbed, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
w8floosh
pushed a commit
to w8floosh/chip-fuzzing
that referenced
this pull request
Aug 4, 2024
…project-chip#34708) * In progress * ActionReturnStatus implementation * Start making use of ActionReturnStatus * Things seem to compile (but not yet passing) * nice log formatting * Propper formatting and comparisons in tests. Mock tests pass * Restyle * Restyle * Fix typo * Add missing files * Added some unit tests that pass * More tests * Restyle * Update src/app/codegen-data-model-provider/EmberMetadata.cpp Co-authored-by: Boris Zbarsky <[email protected]> * Update src/app/data-model-provider/ActionReturnStatus.h Co-authored-by: Boris Zbarsky <[email protected]> * Update src/app/data-model-provider/ActionReturnStatus.h Co-authored-by: Boris Zbarsky <[email protected]> * Update src/app/data-model-provider/ActionReturnStatus.h Co-authored-by: Boris Zbarsky <[email protected]> * Update src/lib/core/CHIPError.h Co-authored-by: Boris Zbarsky <[email protected]> * Rename IsOutOfSpaceError and do not document specifics * Document invoke return codes * Use the new out of space method in checked * Restyle * Allow ClusterStatusCode to be constructed from a CHIP_ERROR * Format action statuses as c_str. HOWEVER this wastes 32 bytes of BSS * Fix error formatting * Restyle * Fix includes to be system paths * Update src/app/data-model-provider/Provider.h Co-authored-by: Boris Zbarsky <[email protected]> * Update src/app/data-model-provider/Provider.h Co-authored-by: Boris Zbarsky <[email protected]> * Fix status success and chip_no_error equivalence and add unit tests * Added more tests --------- Co-authored-by: Andrei Litvin <[email protected]> Co-authored-by: Boris Zbarsky <[email protected]>
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.
CHIP_ERROR is generally insufficient to provide the full IM return codes (generally a StatusIB). This is because a StatusIB can also encode
success
with a code (i.e. a clusterstatus) which is not ideally encodable into a CHIP_ERROR. I tried that in #34597 , however the (reasonable) review feedback was that it is very awkward and error prone to have a "success" code that is not CHIP_NO_ERROR.As a result I created a ActionStatusReturn class that generally encodes all possible statuses, supporting also the full clusterstatus (which has success).
I kept both CHIP_ERROR and ClusterStatus because for logging purposes, CHIP_ERROR has a better format on some systems (encodes originating location and a distinct code, which is much more helpful than a Status::Failure). In addition, we had to preserve the ability of communicating "out of space, chunking can happen" which is currently done through CHIP_ERROR.