graphql-platform icon indicating copy to clipboard operation
graphql-platform copied to clipboard

Write errors from HotChocolate.Fusion.CommandLine to stderr instead of stdout

Open interad-woergoetter opened this issue 1 year ago • 6 comments

Product

Hot Chocolate

Is your feature request related to a problem?

Detecting errors in CI/CD is a little bit difficult, because both successful and unsuccessful commands write to standard out but do not write to standard error.

The solution you'd like

I would prefer if the fusion command line tool would write errors to standard error instead of standard out.

interad-woergoetter avatar Oct 05 '23 08:10 interad-woergoetter

We've encountered a similar issue with HotChocolate.AspNetCore.CommandLine when running the schema export command in GitHub Actions.

The CI pipeline continues running despite the unhandled exception stack trace being written to stdout. I believe the reason for this is actually because the command is returning a zero exit code despite having failed, instead of a non-zero exit code to indicate a failure. But I also agree that using stderr for error messages would be a useful enhancement.

PeterMedusRES avatar Jan 09 '24 12:01 PeterMedusRES

Good point. I only mentioned stderr because we are using Azure DevOps and that has a failOnStderr option.

interad-woergoetter avatar Jan 09 '24 13:01 interad-woergoetter

+1 for this and a bit of extra emphasis on changing the exit code from zero to non-zero on error. Not all environments have a failOnStdErr option.

FelixZY avatar Feb 21 '24 23:02 FelixZY

FYI I fixed the exit codes issue in #6911.

tobias-tengler avatar Feb 22 '24 05:02 tobias-tengler

+1 to this. We are currently considering adopting Fusion for a distributed graph solution. However, we can't generate schema files for our existing services, even when everything's updated to the latest HotChocolate prerelease version. Not having error output means we can't investigate the issue, and it seems risky to bet on this for anything business critical.

dkAnBlWo avatar May 03 '24 07:05 dkAnBlWo

@dkAnBlWo shall we setup a call to see what the issue is you guys are having? Send us an email to: contact at chillicream.com

Closing the issue as we fixed the stderr.

michaelstaib avatar May 03 '24 23:05 michaelstaib

@tobias-tengler can this be closed?

michaelstaib avatar May 08 '24 20:05 michaelstaib