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

Add the actual command to CommandResult #100

Merged
merged 3 commits into from
Apr 20, 2022

Conversation

Flowdalic
Copy link
Contributor

The messages of exceptions thrown by call() would previously just
mention the exit status of the invoked process, but not the actual
command line that was used to create the process. To help with
debugging purposes, the exception message now includes the full
command line and the os.proc instance provides access to it.

@lefou
Copy link
Member

lefou commented Feb 22, 2022

This is related to

and the discussion in PR #93 also applies to it. We should be careful to not expose secrets by exposing the whole command.

@Flowdalic
Copy link
Contributor Author

We should be careful to not expose secrets by exposing the whole command.

I would love to life in a world where people know by now that secrets should not be part of the command, but I know that sadly, the reality is different. @lihaoyi suggested in #93 (comment) a compromise to put the command in CommandResult but not show it in the exception message. I incorporated that, which the adjustment to display the first chunk of the command, which should be safe.

Copy link
Member

@lefou lefou left a comment

Choose a reason for hiding this comment

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

Looks reasonable to me.

os/src-jvm/ProcessOps.scala Outdated Show resolved Hide resolved
@Flowdalic
Copy link
Contributor Author

Friendly reminder about this PR. :)

@lefou
Copy link
Member

lefou commented Apr 8, 2022

Hm, looks like PR is too old to start CI...

@Flowdalic
Copy link
Contributor Author

Hm, looks like PR is too old to start CI...

Anything I need to do?

@lefou lefou closed this Apr 19, 2022
@lefou lefou reopened this Apr 19, 2022
The messages of exceptions thrown by call() would previously just
mention the exit status of the invoked process, but not the actual
command line that was used to create the process. To help with
debugging purposes, the exception message now includes the full
command line and the os.proc instance provides access to it.
@Flowdalic Flowdalic force-pushed the improve-subprocess-exception branch from dd9c810 to 31785c9 Compare April 20, 2022 11:08
@lefou lefou merged commit c3eb55d into com-lihaoyi:master Apr 20, 2022
@lefou lefou added this to the after 0.8.0 milestone Apr 20, 2022
@Flowdalic Flowdalic deleted the improve-subprocess-exception branch July 8, 2022 13:06
@lefou lefou modified the milestones: 0.8.1, after 0.8.1 Jul 28, 2022
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.

2 participants