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

DEVPROD-13406: silence patch info logs for JSON output #8599

Merged

Conversation

Kimchelly
Copy link
Contributor

@Kimchelly Kimchelly commented Jan 7, 2025

DEVPROD-13406

Description

There's a bunch of grip logs throughout evergreen patch and it turns out there's actually several non-serious info/warning logs you can hit depending on your local ~/.evergreen.yml settings and which flags you pass into evergreen patch. For JSON output, ideally it would only log something as non-JSON if the patch command hits a problem that will cause it to fail and error out. To make it work for the various local config settings/flag combinations, I changed the grip logging setup so that when a user requests JSON output, any non-error grip logs are suppressed entirely, so the user will only see either 1. the successful JSON patch output or 2. a failing error message and a non-zero exit code.

  • Only log errors or higher when requesting JSON patch output.
  • Upgrade warning about having no project to an error since evergreen patch only works if the user has a default project or explicitly sets a project via the CLI flag.

Testing

Ran evergreen patch with various to verify that --json output shows a fatal (non-JSON) CLI error if there is one, otherwise it shows only the successful JSON output.

Documentation

N/A

@Kimchelly Kimchelly requested a review from a team January 7, 2025 21:41
Copy link
Contributor

@bynn bynn left a comment

Choose a reason for hiding this comment

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

groovy

@Kimchelly Kimchelly enabled auto-merge (squash) January 9, 2025 15:29
@Kimchelly Kimchelly merged commit 705d8f6 into evergreen-ci:main Jan 9, 2025
10 checks passed
@Kimchelly Kimchelly deleted the DEVPROD-13406_silence_json_output branch January 9, 2025 16:07
Kimchelly added a commit that referenced this pull request Jan 9, 2025
Kimchelly added a commit to Kimchelly/evergreen that referenced this pull request Jan 9, 2025
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.

2 participants