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

Reduce duplication in the logs when errors occur in CLI commands #1927

Merged
merged 3 commits into from
Oct 9, 2023

Conversation

henrymercer
Copy link
Contributor

This PR reduces duplication in the logs when errors occur in CodeQL CLI invocations by taking the following strategy:

  1. Try to find fatal errors in the CLI output.
  2. If that fails, then rather than taking the whole stderr, just take the last line. Be explicit that we're taking the last line in the log message since it won't always be a good fit, and point customers to the full logs.
  3. Fix a particularly bad case where during analyze we printed the error twice along with the stack trace. This resulted in us outputting the stderr three times along with a confusing stack trace.

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Confirm the readme has been updated if necessary.
  • Confirm the changelog has been updated if necessary.

@henrymercer henrymercer requested a review from a team as a code owner October 6, 2023 15:00
@henrymercer henrymercer merged commit 4ab9237 into main Oct 9, 2023
372 checks passed
@henrymercer henrymercer deleted the henrymercer/reduce-log-duplication branch October 9, 2023 12:30
@github-actions github-actions bot mentioned this pull request Oct 12, 2023
6 tasks
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.

None yet

2 participants