Skip to content

CNF-22218: Clean CI with multi level logs#199

Open
shirmoran wants to merge 1 commit intok8snetworkplumbingwg:mainfrom
shirmoran:clean-ci-test-output
Open

CNF-22218: Clean CI with multi level logs#199
shirmoran wants to merge 1 commit intok8snetworkplumbingwg:mainfrom
shirmoran:clean-ci-test-output

Conversation

@shirmoran
Copy link
Copy Markdown

  • Added date/time info to the logs.
  • cleaned log info level - moved most of the logs to the debug level.
  • Added relevant information with Ginkgo "By" statements.

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly refines the logging output and test reporting for the CI environment. By adjusting log levels and integrating Ginkgo's 'By' statements, the changes aim to improve the clarity and signal-to-noise ratio of test execution logs. This makes it easier to understand the flow of tests and quickly pinpoint issues without being overwhelmed by excessive informational messages.

Highlights

  • Logging Level Adjustment: Most logrus.Infof statements have been demoted to logrus.Debugf to reduce verbosity in standard CI logs, making INFO level output cleaner and more focused on critical information.
  • Enhanced Test Readability: Added descriptive By statements to Ginkgo test suites (BeforeSuite, AfterSuite, ReportBeforeEach, ReportAfterEach) and within test functions, providing clearer context for each step in the test output.
  • Date/Time in Logs: Date/time information has been incorporated into log entries, which aids in debugging and tracing events within the CI environment.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request focuses on enhancing the clarity and reducing the verbosity of log messages within the PTP operator's conformance tests. It shifts most logrus.Infof calls to logrus.Debugf, and adds Ginkgo "By" statements to provide more context during test execution. I have reviewed the changes and provided feedback to address high and medium severity issues.

}

logrus.Infof("PTP Test Config: %+v", ptpTestConfig)
logrus.Debugf("PTP Test Config: %+v", ptpTestConfig)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

medium: Consider adding more context to this log message, even at the debug level, to aid in debugging configuration issues.

}

logrus.Infof("Configuring best solution= %s", BestSolution)
logrus.Debugf("Configuring best solution= %s", BestSolution)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

medium: Consider adding more context to this log message, such as the significance of the best solution.

// Create the third HA-specific phc2sys config if HA is enabled
if phc2SysHaEnabled {
logrus.Infof("Creating HA ptpconfig")
logrus.Debugf("Creating HA ptpconfig")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

medium: Consider adding more context to this log message, such as the purpose of creating an HA ptpconfig.

logrus.Errorf("error getting ptpconfig list, err=%s", err)
}
logrus.Infof("%d ptpconfig objects recovered", len(configList.Items))
logrus.Debugf("%d ptpconfig objects recovered", len(configList.Items))
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

medium: Consider adding more context to this log message, such as the purpose of recovering ptpconfig objects.

var allMasterIfs []string
var allFollowerIfs []string
logrus.Infof("Number of ptpconfigs under test: %d", len(ptpConfigClockUnderTest))
logrus.Debugf("Number of ptpconfigs under test: %d", len(ptpConfigClockUnderTest))
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

medium: Consider adding more context to this log message, such as the purpose of analyzing ptpconfig.

podNames = append(podNames, aPod.Name)
}
logrus.Infof("List of pods running ptp4l: %v", podNames)
logrus.Debugf("List of pods running ptp4l: %v", podNames)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

medium: Consider adding more context to this log message, such as the significance of these pods.

Copy link
Copy Markdown
Collaborator

@edcdavid edcdavid left a comment

Choose a reason for hiding this comment

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

Few comments:

  • Also add timestamps on log lines generated from the run-on-vm.sh script, add color for steps.
  • When building images using ptp-tools scripts, hide podman logs by default. Only display start and end of image building and pushing. Use color to highlight these steps. If any strep fails, then dump the build/push logs leading to the failure.
  • Actually, reviewing the verbosity vs use of logs, most seem ok currently to me. I would revert most of the info -> debug changes and look at the few repetitive/verbose ones that repeat info (like waiting for an state, dumping non human readable info -> reformat?).
  • Might be useful to clarify logs that are not clear, if needed

logrus.Warnf("CONSUMER_IMG is not set, use default value")
}
logrus.Infof("Use CONSUMER_IMG %s", consumerImage)
logrus.Debugf("Use CONSUMER_IMG %s", consumerImage)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Might be useful to keep

- Added date/time info to the logs.
- cleaned log info level - moved most of the logs to the debug level.
- Added relevant information with Ginkgo "By" statements.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants