-
Notifications
You must be signed in to change notification settings - Fork 85
Save scarb execute outputs
#2869
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
Open
DelevoXDG
wants to merge
11
commits into
main
Choose a base branch
from
zdobnikau/execute-save-outputs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
eb1225e
save `scarb execute` outputs to files
DelevoXDG e32c93d
add tests
DelevoXDG 8752b2d
fix
DelevoXDG f3942fc
simplify
DelevoXDG 26a5527
rename for clarity
DelevoXDG d77a49e
misc
DelevoXDG 2cd49b9
fix multiline statements
DelevoXDG ddeac17
fix tests (post-rebase)
DelevoXDG c732a53
misc refactor
DelevoXDG f5bf4d8
always create a file, even if output is empty
DelevoXDG 84d2481
mirror changes to `unchecked` cli args
DelevoXDG File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder how useful is it, to save this to files, instead of printing to stdout? Can't we just parse the stdout wherever we need to use this? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I based this off of the decision we made in the past regarding
scarb prove: Addscarb prove#1900 (comment)Although I'm not sure that's super problematic since we have control over the logic of both extensions, I suppose if extracting
NfromSaving output to [..]Nis unstable, then extracting multiline outputs could be considered even less stable 🤔That's why we use
SCARB_EXECUTION_ID, and it seemed reasonable to me not to rethink this hereAnother thing that concerned me - verbosity.
doctoexecute, and that verbosity is--quiet, the output is lostexecute, we'd have to captureexecutestdout, and then somehow figure out based ondocverbosity what to print and not to print. Since we'd have only raw text at our disposal, there would be no way to filter out messages based on their intended level anddocverbosityMaybe there's some elegant solution to this, but I just didn't think it's worth going there since the files should just work 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see your point, but I don't really think these two are comparable.
For starters, I don't think that using HintProcessor to capture print is reliably what we want. It seems it can be bypassed (see running with bootloader), but also it runs on the assumption that println! it's the only possible way to access stdout (which I am not sure is true).
It shouldn't require any unpredictable parsing, as we can expect the program output to be the last message when run with
--program-outputflag. We can use json output format in ui, to output it as easily parsable json. We can also do what we do inscarb metadata, that is, run the command with--quite, but set the output to always be printed regardless of verbosity (imho makes sense, if you are explicitly for it to be printed).