heroku / roadmap

This is the public roadmap for Salesforce Heroku services.
190 stars 11 forks source link

Heroku CLI run command should separate stdout from stderr #304

Open ezekg opened 1 month ago

ezekg commented 1 month ago

Required Terms

What service(s) is this request for?

CLI

Tell us about what you're trying to solve. What challenges are you facing?

I assume this is a limitation of the rendezvous protocol, but when using the heroku run command, stdout and stderr streams are not separated, leading to mixed output. This behavior deviates from typical Unix command behavior where stdout and stderr are distinct. For example, if you were to run a Rake task that exports a CSV to stdout and prints a digest to stderr, the resulting file includes both outputs. This makes the CSV file invalid.

Local example

rake export:csv > export.csv
# Output to stderr: 50d858e0985ecc7f60418aaf0cc5ab587f42c2570a884095a9e8ccacd0f6545c
cat export.csv 
# Result: a valid CSV file

Heroku example

heroku run rake export:csv > export.csv
# Output to stderr: <nothing>
cat export.csv 
# Result: a malformed CSV file

Typically, if you wanted to combine stdout and stderr, you'd explicitly use 2>&1.

Refs: https://github.com/heroku/cli/issues/1835, https://github.com/heroku/legacy-cli/issues/1214

k80bowman commented 1 month ago

Thank you for bringing this issue to our attention. We will take a look at it and get some changes prioritized.