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 73cc6f7 commit 33be5ea
Show file tree
Hide file tree
Showing 7 changed files with 3,939 additions and 2,906 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.

31 changes: 29 additions & 2 deletions internal/controlplane/handlers_evalstatus.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,38 @@ import (

"github.com/stacklok/minder/internal/db"
"github.com/stacklok/minder/internal/engine/engcontext"
"github.com/stacklok/minder/internal/flags"
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 (s *Server) ListEvaluationHistory(
ctx context.Context,
in *minderv1.ListEvaluationHistoryRequest,
) (*minderv1.ListEvaluationHistoryResponse, error) {
if flags.Bool(ctx, s.featureFlags, flags.EvalHistory) {
cursor := in.GetCursor()
zerolog.Ctx(ctx).Debug().
Strs("entity_type", in.GetEntityType()).
Strs("entity_name", in.GetEntityName()).
Strs("profile_name", in.GetProfileName()).
Strs("status", in.GetStatus()).
Strs("remediation", in.GetRemediation()).
Strs("alert", in.GetAlert()).
Str("from", in.GetFrom().String()).
Str("to", in.GetTo().String()).
Str("cursor.cursor", cursor.Cursor).
Uint64("cursor.size", cursor.Size).
Msg("ListEvaluationHistory request")
return &minderv1.ListEvaluationHistoryResponse{}, nil
}

return nil, status.Error(codes.Unimplemented, "Not implemented")
}

// 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 33be5ea

Please sign in to comment.