Skip to content

fix: Fix missing error handling for resource_counts endpoint#6131

Open
ntkathole wants to merge 1 commit intofeast-dev:masterfrom
ntkathole:fix_resource_endpoint
Open

fix: Fix missing error handling for resource_counts endpoint#6131
ntkathole wants to merge 1 commit intofeast-dev:masterfrom
ntkathole:fix_resource_endpoint

Conversation

@ntkathole
Copy link
Member

@ntkathole ntkathole commented Mar 19, 2026

What this PR does / why we need it:

The /metrics/resource_counts endpoint fails entirely when a user's permissions restrict access to any resource type.
The root cause is that the ListEntities and ListDataSources gRPC calls in count_resources_for_project() were not wrapped in try/except, unlike the other four resource types which already handled errors gracefully.

Fix: Wrap the entities and data_sources gRPC calls in try/except blocks (matching the existing pattern for saved_datasets, features, feature_views, and feature_services). When a FeastPermissionError is raised for a restricted resource type, it now returns 0 for that type instead of failing the entire endpoint.


Open with Devin

@ntkathole ntkathole self-assigned this Mar 19, 2026
@ntkathole ntkathole requested a review from a team as a code owner March 19, 2026 08:54
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

Copy link
Contributor

@Srihari1192 Srihari1192 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested by applying all permissions combinations , LGTM
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants