-
Notifications
You must be signed in to change notification settings - Fork 437
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
Send lines to highlight in trace [trace viewing 1/2] #658
base: main
Are you sure you want to change the base?
Conversation
Summary: Adds feature in Pysa playground to view trace. After computation of taint-output.json file, send the results to Pysa frontend. Modifies existing cache approach to make it more modular and add support for caching annotations as well. Adds Github actions CI tests (in existing pysa action) to make sure the code for parsing the taint_config doesn't go out of date as the format of taint-output.json changes often. Existing pysa test was used because it already runs pysa from source code on `delibrately_vulnerable_flask_app`, and adding a same action with just few more lines to the pysa test doesn't really make much sense. Signed-off-by: Abishek V Ashok <[email protected]> Differential Revision: D38980480 fbshipit-source-id: bbb8b60bae73c0005625c10f7e0abd1e38227837
This pull request was exported from Phabricator. Differential Revision: D38980480 |
cache_contents = _get_cache_contents(cache_file_path).split("\n") | ||
run_status = cache_contents.pop(0) | ||
cache_contents = _get_cache_contents(cache_file_path) | ||
run_status = cache_contents["return_code"] |
Check failure
Code scanning / Pyre
Incompatible parameter type
run_status = cache_contents.pop(0) | ||
cache_contents = _get_cache_contents(cache_file_path) | ||
run_status = cache_contents["return_code"] | ||
lines = cache_contents["lines"] |
Check failure
Code scanning / Pyre
Incompatible parameter type
cache_contents = _get_cache_contents(cache_file_path) | ||
run_status = cache_contents["return_code"] | ||
lines = cache_contents["lines"] | ||
annotations = cache_contents["annotations"] |
Check failure
Code scanning / Pyre
Incompatible parameter type
def test_parser(self): | ||
expected_output = {} | ||
expected_output_file_path = Path( | ||
os.getcwd() / "taint_output_parsed.expected.json" | ||
) | ||
self.assertTrue( | ||
expected_output_file_path.exists() and expected_output_file_path.is_file() | ||
) | ||
with expected_output_file_path.open() as expected_output_file: | ||
expected_output_file = json.loads(expected_output_file.read()) | ||
taint_output_file_path = Path(os.getcwd() / "taint_output.json") | ||
self.assertTrue( | ||
taint_output_file_path.exists() and taint_output_file_path.is_file() | ||
) | ||
self.assertEqual( | ||
_parse_annotations_from_taint_output(taint_output_file_path), | ||
expected_output, | ||
) |
Check failure
Code scanning / Pyre
Missing return annotation
def test_parser(self): | ||
expected_output = {} | ||
expected_output_file_path = Path( | ||
os.getcwd() / "taint_output_parsed.expected.json" |
Check failure
Code scanning / Pyre
Unsupported operand
) | ||
with expected_output_file_path.open() as expected_output_file: | ||
expected_output_file = json.loads(expected_output_file.read()) | ||
taint_output_file_path = Path(os.getcwd() / "taint_output.json") |
Check failure
Code scanning / Pyre
Unsupported operand
Summary:
Adds feature in Pysa playground to view trace. After computation of taint-output.json file, send the results to Pysa frontend.
Modifies existing cache approach to make it more modular and add support for caching annotations as well.
Adds Github actions CI tests (in existing pysa action) to make sure the code for parsing the taint_config doesn't go out of date as the format of taint-output.json changes often. Existing pysa test was used because it already runs pysa from source code on
delibrately_vulnerable_flask_app
, and adding a same action with just few more lines to the pysa test doesn't really make much sense.Signed-off-by: Abishek V Ashok [email protected]
Differential Revision: D38980480