Send lines to highlight in trace [trace viewing 1/2]#658
Open
abishekvashok wants to merge 1 commit into
Open
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 <abishekvashok@fb.com> Differential Revision: D38980480 fbshipit-source-id: bbb8b60bae73c0005625c10f7e0abd1e38227837
Contributor
|
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
Comment on lines
+15
to
+32
| 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
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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 abishekvashok@fb.com
Differential Revision: D38980480