Skip to content

Commit

Permalink
Add Execution ID in the executor's evaluation param logs (#3889)
Browse files Browse the repository at this point in the history
The execution ID is very handy to link together a single run when
debugging Minder. Unfortunately, it's not set everywhere... so let's do
that! This way, we'll be able to better debug minder throughout the
execution of policy for an entity.

Signed-off-by: Juan Antonio Osorio <[email protected]>
  • Loading branch information
JAORMX authored Jul 15, 2024
1 parent ff8964a commit a37860e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions internal/engine/eval_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func (e *executor) createEvalStatusParams(
ArtifactID: artID,
PullRequestID: prID,
ProjectID: inf.ProjectID,
ExecutionID: *inf.ExecutionID, // Execution ID is required in the executor.
}

// Prepare params for fetching the current rule evaluation from the database
Expand Down
2 changes: 2 additions & 0 deletions internal/engine/interfaces/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ type EvalStatusParams struct {
evalErr error
actionsOnOff map[ActionType]ActionOpt
actionsErr evalerrors.ActionsError
ExecutionID uuid.UUID
}

// Ensure EvalStatusParams implements the necessary interfaces
Expand Down Expand Up @@ -250,6 +251,7 @@ func (e *EvalStatusParams) DecorateLogger(l zerolog.Logger) zerolog.Logger {
Str("rule_type", e.GetRule().GetType()).
Str("rule_name", e.GetRule().GetName()).
Str("rule_type_id", e.GetRuleTypeID().String()).
Str("execution_id", e.ExecutionID.String()).
Logger()
if e.RepoID.Valid {
outl = outl.With().Str("repository_id", e.RepoID.UUID.String()).Logger()
Expand Down

0 comments on commit a37860e

Please sign in to comment.