Skip to content

[VIRTS-4149] Have server handle both stdout and stderr in link results#2662

Merged
mkultraWasHere merged 10 commits into
masterfrom
VIRTS-4149-backwards-comp
Oct 18, 2022
Merged

[VIRTS-4149] Have server handle both stdout and stderr in link results#2662
mkultraWasHere merged 10 commits into
masterfrom
VIRTS-4149-backwards-comp

Conversation

@michael-the-jones

@michael-the-jones michael-the-jones commented Sep 29, 2022

Copy link
Copy Markdown
Contributor

Description

This PR allows the server to handle both stdout and stderr from an agent. The primary change is that result files will be written as a dictionary, i.e., { stdout: '', stderr: ''}. Thus, when different readers request result output (e.g., the API, reports, or plugins) they will now receive a dictionary. Core CALDERA functionality has been updated in this PR to account for these changes (e.g., reports will generate properly, the UI will display results properly), but any non-CALDERA users of APIs/reports or any custom plugins may be effected.

The PR accounts for old result files, and constructs a dictionary with the old results as "stdout".

Any agents that only send output will have their data stored in stdout, regardless of the origination. An associated PR for Sandcat will be made in conjunction to this one which will return both stdout and stderr from commands. However, stderr from other agents will appear as stdout. Note that the link result itself is NOT effected, and will still show an error even on other agents.

Type of change

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Tested with Sandcat/Manx, old result files, and new result files. Generated every type of report. Tested with stdout, stderr, and both. Automated test suites run successfully (with updates to account for the dict).

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • [N/A] I have made corresponding changes to the documentation - future ticket
  • [N/A] I have added tests that prove my fix is effective or that my feature works - future ticket

@mchan143

mchan143 commented Oct 7, 2022

Copy link
Copy Markdown
Contributor

Blocked by: #2668

argaudreau
argaudreau previously approved these changes Oct 10, 2022
@sonarqubecloud

Copy link
Copy Markdown

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

77.8% 77.8% Coverage
0.0% 0.0% Duplication

argaudreau
argaudreau previously approved these changes Oct 11, 2022

@argaudreau argaudreau left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

mchan143
mchan143 previously approved these changes Oct 11, 2022

@mchan143 mchan143 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, great work

Comment thread app/objects/c_operation.py Outdated
Comment thread app/service/contact_svc.py Outdated
Comment thread app/service/contact_svc.py Outdated
Comment thread app/service/file_svc.py Outdated
Comment thread app/service/file_svc.py Outdated
Comment thread tests/api/v2/handlers/test_operations_api.py Outdated
Comment thread tests/services/test_file_svc.py Outdated
Comment thread tests/services/test_file_svc.py Outdated
Comment thread tests/services/test_file_svc.py Outdated
Comment thread tests/services/test_file_svc.py Outdated
@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@mkultraWasHere mkultraWasHere left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good.

@mchan143

Copy link
Copy Markdown
Contributor

@elegantmoose should be all set to merge this one whenever you're ready!

@mkultraWasHere mkultraWasHere merged commit 1e30143 into master Oct 18, 2022
@mkultraWasHere mkultraWasHere deleted the VIRTS-4149-backwards-comp branch October 18, 2022 13:15
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.

5 participants