-
Notifications
You must be signed in to change notification settings - Fork 725
Chore/add custom error to clarity types #6751
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
Chore/add custom error to clarity types #6751
Conversation
…tioError Signed-off-by: Jacinta Ferrant <[email protected]>
… into chore/add-custom-error-to-clarity-types
… into chore/add-custom-error-to-clarity-types
…om/Jiloc/stacks-core into chore/add-custom-error-to-clarity-types
Codecov Report❌ Patch coverage is ❌ Your project status has failed because the head coverage (72.88%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## develop #6751 +/- ##
===========================================
- Coverage 77.77% 72.88% -4.90%
===========================================
Files 585 586 +1
Lines 361916 362349 +433
===========================================
- Hits 281498 264084 -17414
- Misses 80418 98265 +17847
... and 206 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
826c4d7 to
9d27ff0
Compare
Signed-off-by: Jacinta Ferrant <[email protected]>
59cb8ff to
b8ca7dd
Compare
… into chore/add-custom-error-to-clarity-types
Signed-off-by: Jacinta Ferrant <[email protected]>
federico-stacks
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did a first pass. In the meantime, I’m sharing some thoughts
brice-stacks
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a couple of comments, but before going further, I think I'm having trouble seeing the overall goal of all of this.
Essentially we are trying to pry apart unnecessary coupling between underlying clarity type creation/serialization/deserialization etc from static checks and vm executions as these functions are used throughout the code base where no vm is even required and we are not actually performing static checks. This is basically the first step in enabling easier refactoring. If clarity-types returns CheckErrorKind, we've coupled the lowest layer to the VM/checker layer. That creates dependency inversion and makes refactors brutal. I do think there is currently a lot of redundancy but this is required until we can pull it all apart properly. Additionally, you can get better error messages/types at the lower level that then are mapped to whatever the caller cares about. Sorry if I am not explaining this well. EDIT: Here is a PR that builds on top of it that enables me to rip out the RuntimeError::TypeParseError and RuntimeError::ASTError more easily as a result: jacinta-stacks#1 |
…Data Signed-off-by: Jacinta Ferrant <[email protected]>
francesco-stacks
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still going through the review, but posting some pointers for now.
Also, this refactoring would allow to move back all the errors (VmInternal, ClarityError, CheckError*, Parse, etc) in the clarity crate and just keep this new error type in clarity-types. I believe it will be a lot easier to reason about it, expecially regarding the idea that all other types are VM related, and not about the usage of the basis clarity types.
Signed-off-by: Jacinta Ferrant <[email protected]>
Signed-off-by: Jacinta Ferrant <[email protected]>
…ix admits error propogation, fix atom_values mapping, fix comments Signed-off-by: Jacinta Ferrant <[email protected]>
francesco-stacks
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
… into chore/add-custom-error-to-clarity-types
… into chore/add-custom-error-to-clarity-types
federico-stacks
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgmt!
Before final approval, are we waiting for block validation on this branch to rule out any regressions?
Yes! @wileyj has been running that on my behalf (EDIT: got green light from Jesse!). I also would like approval from @aaronb-stacks. |
… into chore/add-custom-error-to-clarity-types
aaronb-stacks
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM -- just a couple of comments.
…ptable in special_slice Signed-off-by: Jacinta Ferrant <[email protected]>
Signed-off-by: Jacinta Ferrant <[email protected]>
francesco-stacks
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there! There are some unit tests failing.
…ic ExpectedSequence errors Signed-off-by: Jacinta Ferrant <[email protected]>
3f30b6a
This basically is ripping out VmExecutionError from clarity-types as well by introducing this error layer.
Closes #6731
Also closes #6730