Skip to content

Commit

Permalink
Added ListEvaluationHistory RPC along with its request and response.
Browse files Browse the repository at this point in the history
As part of this development, a Cursor message was added to implement
pagination.
  • Loading branch information
blkt committed Jun 26, 2024
1 parent 8498267 commit 7cf471e
Show file tree
Hide file tree
Showing 7 changed files with 4,505 additions and 3,469 deletions.
71 changes: 71 additions & 0 deletions docs/docs/ref/proto.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 23 additions & 2 deletions internal/controlplane/handlers_evalstatus.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,29 @@ import (
minderv1 "github.com/stacklok/minder/pkg/api/protobuf/go/minder/v1"
)

// ListEvaluationResults lists the evaluation results for entities filtered b
// entity type, labels, profiles, and rule types.
// ListEvaluationHistory lists current and past evaluation results for
// entities.
func (_ *Server) ListEvaluationHistory(
_ context.Context,
in *minderv1.ListEvaluationHistoryRequest,
) (*minderv1.ListEvaluationHistoryResponse, error) {
fmt.Printf("%T %+v\n", in.GetEntityType(), in.GetEntityType())
fmt.Printf("%T %+v\n", in.GetEntityName(), in.GetEntityName())
fmt.Printf("%T %+v\n", in.GetProfileName(), in.GetProfileName())
fmt.Printf("%T %+v\n", in.GetStatus(), in.GetStatus())
fmt.Printf("%T %+v\n", in.GetRemediation(), in.GetRemediation())
fmt.Printf("%T %+v\n", in.GetAlert(), in.GetAlert())
fmt.Printf("%T %+v\n", in.GetFrom(), in.GetFrom())
fmt.Printf("%T %+v\n", in.GetTo(), in.GetTo())

cursor := in.GetCursor()
fmt.Printf("%T %+v\n", cursor, cursor)

return &minderv1.ListEvaluationHistoryResponse{}, nil
}

// ListEvaluationResults lists the latest evaluation results for
// entities filtered by entity type, labels, profiles, and rule types.
func (s *Server) ListEvaluationResults(
ctx context.Context,
in *minderv1.ListEvaluationResultsRequest,
Expand Down
Loading

0 comments on commit 7cf471e

Please sign in to comment.