Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes a logic error in the model validation function by reversing the condition check for comparing type definitions.
Changes:
- Corrected the comparison logic in
CompareModelto return false when type definitions do not match, instead of when they do match.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if !reflect.DeepEqual(authModel.TypeDefinitions, model.TypeDefinitions) { | ||
| c.logger.Errorf("invalid authorization model type definitions") | ||
| span.SetStatus(codes.Error, "invalid authorization model type definitions") | ||
| return false, nil |
There was a problem hiding this comment.
The logic has been inverted to return false when type definitions don't match. However, the error message states 'invalid authorization model type definitions' which suggests a validation failure. If type definitions not matching is expected to return false (indicating models are different), consider whether this is truly an error condition that warrants logging as an error and setting an error status on the span. If this is expected behavior for non-matching models, use Info level logging instead of Error, or remove the logging/span status entirely.
No description provided.