Skip to content

Comments

Updated process list tome output (#423)#443

Merged
Cictrone merged 2 commits intospellshift:mainfrom
arunjohnkuruvilla:main
Jan 19, 2024
Merged

Updated process list tome output (#423)#443
Cictrone merged 2 commits intospellshift:mainfrom
arunjohnkuruvilla:main

Conversation

@arunjohnkuruvilla
Copy link
Contributor

@arunjohnkuruvilla arunjohnkuruvilla commented Jan 19, 2024

What type of PR is this?

/kind bug

What this PR does / why we need it:

Update the process list tome for the output to look like the following -

PID             PPID            username                        command
53              1               root                            /lib/systemd/systemd-udevd
428             354             ubuntu                          -bash

Which issue(s) this PR fixes:

Hulto: Gonna change 423 to different tome editing so the issue stays open.

hulto
hulto previously approved these changes Jan 19, 2024
Copy link
Collaborator

@hulto hulto left a comment

Choose a reason for hiding this comment

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

Hey @arunjohnkuruvilla!
Thanks for the feature. This looks really nice 🤌
Ran locally everything looks good.

When you get a chance can fill out this feedback form so we can improve the developer experience:
https://forms.gle/3Rn3iQqF79B68nWJ7

@hulto
Copy link
Collaborator

hulto commented Jan 19, 2024

One change that would be nice to have (which we is an existing bug)
On line 36
Add a call to replace. Sometimes the command can include newlines and escaping them will keep the output cleaner.

            print(current_proc_command+"\n")
...
            print(current_proc_command.replace("\n","\\n")+"\n")

print(pad_pid(current_proc_pid))
print(pad_pid(current_proc_ppid))
print(pad_username(current_proc_username))
print(current_proc_command+"\n")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Small change

print(current_proc_command.replace("\n","\\n")+"\n")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pushed the change in the following commit.

Copy link
Collaborator

@hulto hulto left a comment

Choose a reason for hiding this comment

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

LGTM :shipit:

@hulto
Copy link
Collaborator

hulto commented Jan 19, 2024

Incredible feedback @arunjohnkuruvilla
Very fair there are no docs on tome creation i've opened #445 to resolve this for future contributors.

We do have a way for you to test tomes without restarting the application (however it's not documented yet 😬 )
You can use the golem standalone interpreter either interactively or with a specified tome.

# Run eldritch interactively - I find this useful for testing specific syntax or experimenting with dictionaries.
[realm/implants/golem]$ cargo run -- -i
# Run a specific tome - I statically set any input params in the tome first to resolve run time errors.
[realm/implants/golem]$ cargo run -- 'realm/tavern/tomes/process_list/main.eldritch'

I'll include these ^ in the docs update but hope this helps.

@Cictrone
Copy link
Collaborator

Merging because it’s awesome :D

@Cictrone Cictrone merged commit fd31735 into spellshift:main Jan 19, 2024
KCarretto pushed a commit that referenced this pull request Feb 1, 2024
 
Updated process list tome output (#423) (#443)

* Updated process list tome output (#423)

* Updated process list tome output to account for new lines in process commands (#423)
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.

3 participants