-
Notifications
You must be signed in to change notification settings - Fork 38
feat: ListAuditRecords
RPC implementation with RQL support
#1132
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
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Pull Request Test Coverage Report for Build 17673929091Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements the ListAuditRecords RPC endpoint with comprehensive RQL (Resource Query Language) support for filtering, pagination, ordering and grouping of audit records.
- Adds ListAuditRecords RPC implementation supporting RQL queries with filters, search, pagination, sorting and grouping
- Implements comprehensive repository layer with SQL query building for audit record listing operations
- Includes extensive test coverage for API handlers, service layer, and repository functionality
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
pkg/server/connect_interceptors/authorization.go | Adds authorization checks for the new ListAuditRecords endpoint |
internal/store/postgres/testdata/mock-audit-records.json | Provides comprehensive test data fixture with 15 audit records for testing |
internal/store/postgres/audit_record_repository_test.go | Extensive test suite covering listing, filtering, searching, grouping and edge cases |
internal/store/postgres/audit_record_repository.go | Core repository implementation with RQL query processing and SQL generation |
internal/api/v1beta1connect/mocks/audit_record_service.go | Updated mock service with List method for testing |
internal/api/v1beta1connect/audit_record_test.go | Comprehensive API handler tests covering various scenarios and error cases |
internal/api/v1beta1connect/audit_record.go | API handler implementation with RQL validation and response transformation |
core/auditrecord/service_test.go | Service layer tests for the List functionality |
core/auditrecord/service.go | Simple service layer implementation delegating to repository |
core/auditrecord/mocks/repository.go | Updated mock repository with List method |
core/auditrecord/errors.go | Adds ErrRepositoryBadInput error for validation failures |
core/auditrecord/auditrecord.go | Enhanced data structures with JSON tags and RQL schema definition |
Comments suppressed due to low confidence (1)
internal/api/v1beta1connect/audit_record.go:1
- The error message 'failed to read rql query' doesn't match what the code is actually doing (transforming proto to RQL). It should be 'failed to transform rql query' to be consistent with the actual operation.
package v1beta1connect
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This PR adds an implementation of ListAuditRecords RPC. Additionally it supports filtering, pagination, ordering and groups as per RQL query. RQL related utility function have used.
Sample Request:
Sample Response:
Test: Unit tests and manual end to end test