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

513 update file tree tome to default exclude extraneous dirs #518

Merged

Conversation

hulto
Copy link
Collaborator

@hulto hulto commented Jan 29, 2024

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

Remove unused output from file tree output.

Output is now:

Running `/workspaces/realm/implants/target/debug/golem /workspaces/realm/tavern/tomes/get_net_info/main.eldritch`
Interfaces:

name: lo
ip: 127.0.0.1/8
mac: 00:00:00:00:00:00

name: eth0
ip: 172.17.0.2/16
mac: 02:42:ac:11:00:02

Hostname: 372a47305e3c

Instead of:

Running `/workspaces/realm/implants/target/debug/golem /workspaces/realm/tavern/tomes/get_net_info/main.eldritch`
OUTPUT: ["Interfaces:\n\n", "name: lo\n", "ip: 127.0.0.1/8\n", "mac: 00:00:00:00:00:00\n", "\n", "name: eth0\n", "ip: 172.17.0.2/16\n", "mac: 02:42:ac:11:00:02\n", "\n", "Hostname: 372a47305e3c", "\n", "\n"]
["Interfaces:\n\n", "name: lo\n", "ip: 127.0.0.1/8\n", "mac: 00:00:00:00:00:00\n", "\n", "name: eth0\n", "ip: 172.17.0.2/16\n", "mac: 02:42:ac:11:00:02\n", "\n", "Hostname: 372a47305e3c", "\n", "\n"]

Which issue(s) this PR fixes:

Fixes #513
Fixes #517

@hulto hulto linked an issue Jan 29, 2024 that may be closed by this pull request
Copy link

codecov bot commented Jan 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (dee0692) 70.52% compared to head (53eb420) 70.56%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #518      +/-   ##
==========================================
+ Coverage   70.52%   70.56%   +0.03%     
==========================================
  Files         126      126              
  Lines        9591     9587       -4     
==========================================
+ Hits         6764     6765       +1     
+ Misses       2681     2676       -5     
  Partials      146      146              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -28,7 +28,7 @@ use std::time::Duration;
*/
#[derive(ProvidesStaticType)]
pub struct Runtime {
stdout_reporting: bool,
pub stdout_reporting: bool,
Copy link
Collaborator

Choose a reason for hiding this comment

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

this doesn't need to be pub, see with_stdout_reporting

Ok(response) => (0, response),
Err(error) => {
eprint!("failed to execute tome {:?}", error);
(-1, Vec::new())
}
};

if !result.is_empty() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe we should just print without the :?, that might avoid escaping strings and then we can get rid of the with_stdout_reporting API.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We need to keep the with_stdout_reporting API.
If the tome crashes no output gets printed making it very hard to debug.

@hulto hulto merged commit 6c43bc7 into main Jan 30, 2024
8 checks passed
@hulto hulto deleted the 513-update-file-tree-tome-to-default-exclude-extraneous-dirs branch January 30, 2024 01:34
KCarretto pushed a commit that referenced this pull request Feb 1, 2024
 
513 update file tree tome to default exclude extraneous dirs (#518)
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.

Golem printing doesn't format correctly. Update file tree tome to default exclude extraneous dirs
2 participants