spicedb icon indicating copy to clipboard operation
spicedb copied to clipboard

Add MustSafecast helper for type conversions

Open ivanauth opened this issue 3 months ago • 2 comments

Summary

Add a MustSafecast helper function to the spiceerrors package that panics on cast failure, complementing the existing Safecast function.

Fixes #2714

Changes

  • Add MustSafecast[I, O] function in pkg/spiceerrors/safecast.go
  • Panics with descriptive error when cast fails (for use in cases where failure indicates a programming error)
  • Update .gitignore to properly ignore __pycache__/ directories

ivanauth avatar Nov 25 '25 22:11 ivanauth

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 77.62%. Comparing base (b55a9f6) to head (a177ea2). :warning: Report is 28 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2730      +/-   ##
==========================================
+ Coverage   77.01%   77.62%   +0.62%     
==========================================
  Files         462      471       +9     
  Lines       49121    49557     +436     
==========================================
+ Hits        37825    38466     +641     
+ Misses       8509     8255     -254     
- Partials     2787     2836      +49     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Nov 25 '25 22:11 codecov[bot]

The failing CRDB 25.2.0 consistency test doesn't look related to the MustSafecast changes. The error is a database timeout:

ERROR: query execution canceled (SQLSTATE 57014)

CRDB 25.3.0 passes, as do all other datastores. Seems like a CRDB 25.2.0-specific issue.

ivanauth avatar Nov 26 '25 05:11 ivanauth