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

ensure per-check logger carries the check name throughout execution #1196

Merged

Conversation

komish
Copy link
Contributor

@komish komish commented Sep 12, 2024

When executing checks, the engine emits check names at the start and end of a check's execution, as well as with the result. We run synchronously, so for the most part, this isn't a problem, but I noticed while troubleshooting something else that logs emitted from the check itself (after pulling the logger from context) don't include the check's name, and it's a small amount of code to pass that context into the check and make the logs a bit more clear.

This PR derives a logger with the check's name as a value, stuffs that into a new context to pass to check functions, and then strips all the other locations that were manually adding the "check" key to the logger.

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 12, 2024
@dcibot
Copy link

dcibot commented Sep 12, 2024

@komish
Copy link
Contributor Author

komish commented Sep 13, 2024

/test 4.13-e2e 4.17-e2e

@acornett21
Copy link
Contributor

/test 4.17-e2e

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 16, 2024
Copy link
Contributor

@bcrochet bcrochet left a comment

Choose a reason for hiding this comment

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

See comment

internal/engine/engine.go Outdated Show resolved Hide resolved
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Sep 20, 2024
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 20, 2024
Copy link
Contributor

@bcrochet bcrochet left a comment

Choose a reason for hiding this comment

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

/lgtm

Copy link

openshift-ci bot commented Sep 20, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: acornett21, bcrochet, komish

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [acornett21,bcrochet,komish]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@dcibot
Copy link

dcibot commented Sep 20, 2024

@acornett21 acornett21 merged commit 0756e59 into redhat-openshift-ecosystem:main Sep 20, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants