Skip to content
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

Return why an artifact was skipped from the artifact ingester #810

Merged
merged 1 commit into from
Sep 4, 2023

Conversation

jhrozek
Copy link
Contributor

@jhrozek jhrozek commented Aug 31, 2023

This is helpful to debug artifact evaluation

@evankanderson evankanderson self-requested a review August 31, 2023 13:07
@@ -539,6 +539,7 @@ func (e *Executor) handleArtifactPublishedEvent(ctx context.Context, prov string
}

result := rte.Eval(ctx, versionedArtifact, rule.Def.AsMap(), rule.Params.AsMap())
log.Printf("artifact eval result: %s", result)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also print the rule type and policy that's being evaluated. The result by itself is going to be confusing when running multiple policies.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to pull out either zerolog here or tracing to record this, so that we're not spamming the logs during an artifact ingest? (I don't know -- I can see where this would be useful for debugging, but I can also see this getting very noisy.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's a good point

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added zerolog to this one instance. We should probably be mindful of debugging as we write new code and I'm fine making a pass for the artifact processing since I still have it fresh in my head.

This is helpful to debug artifact evaluation
@jhrozek
Copy link
Contributor Author

jhrozek commented Sep 4, 2023

@JAORMX I think your comment has been addressed.

@JAORMX JAORMX merged commit f171e5a into mindersec:main Sep 4, 2023
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants