Skip to content

Conversation

@ivanauth
Copy link
Contributor

Summary

Add the protogetter linter to catch nil pointer dereferences on proto getters.

Fixes #2633

Changes

  • Add protogetter to the list of enabled linters in .golangci.yaml

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
@ivanauth ivanauth requested a review from a team as a code owner November 25, 2025 22:54
@github-actions github-actions bot added area/schema Affects the Schema Language area/datastore Affects the storage system area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools) labels Nov 25, 2025
@codecov
Copy link

codecov bot commented Nov 25, 2025

Codecov Report

❌ Patch coverage is 36.75701% with 1330 lines in your changes missing coverage. Please review.
✅ Project coverage is 42.10%. Comparing base (b55a9f6) to head (4cd4dc9).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
internal/services/v1/permissions.go 19.78% 137 Missing and 5 partials ⚠️
internal/services/v1/experimental.go 0.00% 87 Missing ⚠️
internal/services/v1/relationships.go 0.00% 71 Missing ⚠️
internal/services/v1/expreflection.go 0.00% 50 Missing ⚠️
internal/services/v1/reflectionapi.go 0.00% 50 Missing ⚠️
internal/graph/lookupsubjects.go 0.00% 49 Missing ⚠️
internal/graph/lookupresources3.go 0.00% 45 Missing ⚠️
internal/services/v1/debug.go 0.00% 36 Missing ⚠️
internal/services/v1/schema.go 0.00% 35 Missing ⚠️
internal/services/shared/schema.go 0.00% 33 Missing ⚠️
... and 90 more

❌ Your project status has failed because the head coverage (42.10%) is below the target coverage (75.00%). You can increase the head coverage or adjust the target coverage.

❗ There is a different number of reports uploaded between BASE (b55a9f6) and HEAD (4cd4dc9). Click for more details.

HEAD has 29 uploads less than BASE
Flag BASE (b55a9f6) HEAD (4cd4dc9)
50 21
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2731       +/-   ##
===========================================
- Coverage   77.01%   42.10%   -34.90%     
===========================================
  Files         462      419       -43     
  Lines       49121    44224     -4897     
===========================================
- Hits        37825    18617    -19208     
- Misses       8509    23834    +15325     
+ Partials     2787     1773     -1014     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

@ivanauth ivanauth force-pushed the fix/issue-2633-add-protogetter-linter branch from 35f95ea to 4cd4dc9 Compare November 26, 2025 04:11
@github-actions github-actions bot added area/cli Affects the command line area/api v1 Affects the v1 API area/dispatch Affects dispatching of requests labels Nov 26, 2025
@ivanauth
Copy link
Contributor Author

Closing as duplicate of #2638

@ivanauth ivanauth closed this Nov 26, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Nov 26, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area/api v1 Affects the v1 API area/cli Affects the command line area/datastore Affects the storage system area/dispatch Affects dispatching of requests area/schema Affects the Schema Language area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Introduce protogetter linter

1 participant