chore: add MustSafecast helper for type conversions#2730
Open
ivanauth wants to merge 1 commit intoauthzed:mainfrom
Open
chore: add MustSafecast helper for type conversions#2730ivanauth wants to merge 1 commit intoauthzed:mainfrom
ivanauth wants to merge 1 commit intoauthzed:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project check has failed because the head coverage (74.53%) is below the target coverage (75.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #2730 +/- ##
==========================================
+ Coverage 74.50% 74.53% +0.03%
==========================================
Files 494 494
Lines 60626 60613 -13
==========================================
+ Hits 45166 45174 +8
+ Misses 12298 12284 -14
+ Partials 3162 3155 -7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
Author
|
The failing CRDB 25.2.0 consistency test doesn't look related to the MustSafecast changes. The error is a database timeout: CRDB 25.3.0 passes, as do all other datastores. Seems like a CRDB 25.2.0-specific issue. |
a177ea2 to
e8d27fb
Compare
8961c43 to
a01d191
Compare
miparnisari
approved these changes
Feb 26, 2026
miparnisari
reviewed
Feb 26, 2026
a01d191 to
d677de5
Compare
Contributor
Author
|
done! |
5f150d1 to
c997ec6
Compare
Adds MustSafecast function following the MustBugf pattern: - Panics in tests when conversion fails - Returns zero value in production with warning log - Replaces manual safecast error handling across codebase Closes authzed#2714
c997ec6 to
8a3ff9f
Compare
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.
Summary
Add a
MustSafecasthelper function to the spiceerrors package that panics on cast failure, complementing the existingSafecastfunction.Fixes #2714
Changes
MustSafecast[I, O]function inpkg/spiceerrors/safecast.go.gitignoreto properly ignore__pycache__/directories