Skip to content
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

fix: Return correct error code when store is invalid #1592

Merged
merged 2 commits into from May 18, 2023

Conversation

charithe
Copy link
Contributor

@charithe charithe commented May 18, 2023

Instead of returning Internal error, return FailedPrecondition when
the requested policy has a compilation error. We already had this special case handled in the CheckResourceSet RPC but, for some reason, it had been omitted in the other RPCs.

Fixes #1590

Signed-off-by: Charith Ellawala charith@cerbos.dev

Instead of returning `Internal` error, return `FailedPrecondition` when
the requested policy has a compilation error.

Fixes cerbos#1590

Signed-off-by: Charith Ellawala <charith@cerbos.dev>
@codecov
Copy link

codecov bot commented May 18, 2023

Codecov Report

Merging #1592 (096779d) into main (b20c182) will increase coverage by 0.18%.
The diff coverage is 39.58%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1592      +/-   ##
==========================================
+ Coverage   53.25%   53.44%   +0.18%     
==========================================
  Files         130      130              
  Lines       14683    14685       +2     
==========================================
+ Hits         7820     7848      +28     
+ Misses       6174     6147      -27     
- Partials      689      690       +1     
Impacted Files Coverage Δ
internal/compile/manager.go 78.57% <0.00%> (-0.82%) ⬇️
internal/engine/engine.go 63.21% <40.42%> (+0.68%) ⬆️

... and 2 files with indirect coverage changes

Copy link
Member

@haines haines left a comment

Choose a reason for hiding this comment

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

Should this also apply to PlanResources?

Signed-off-by: Charith Ellawala <charith@cerbos.dev>
@charithe charithe merged commit ad1c460 into cerbos:main May 18, 2023
19 checks passed
@charithe charithe deleted the fix/status-code-invalid-policy branch May 18, 2023 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Internal error when evaluating resource with a disabled scope hierarchy
2 participants