You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1.4 - State tracking for Phylum incomplete package data, fixed yarn parsing, cleanup (#5)
* Adding state tracking for incomplete packages
* fix if clause
* fix input variables
* fix input variables
* fix path resolve()
* enable tmate
* fix paths; disable tmate
* fix output declaration
* update success and complete_succcess files with CORRECT files
* updated testing files
* enable tmate
* update testing files with old and new reqs approach
* fix string issue in .replace() for incompletes
* disable tmate
* Refactor support for yarn lockfile parsing
Added parse_yarn module to support identification and parsing of yarn v1
and v2 lockfiles returning a list of tuples (pkg,ver)
* remove IPython import
* break out functions for lockfile submission and changes submission
* fix return stmt to parse_yarn module
* fix error message when looking for PREVIOUS_INCOMPLETE env var
* add debug for parse_yarn
* enable tmate
* update to fix single package upgrade bug
* disable tmate
* clean up
* update comment message to fix#5 (comment)
* re-enable exit condition when environment variables cannot be identified: #5 (comment)
* update comment text to generalize references to requirements.txt
Copy file name to clipboardExpand all lines: analyze.py
+71-66Lines changed: 71 additions & 66 deletions
Original file line number
Diff line number
Diff line change
@@ -6,12 +6,7 @@
6
6
fromunidiffimportPatchSet
7
7
importpathlib
8
8
fromsubprocessimportrun
9
-
10
-
# TODO:
11
-
# [DONE] 1. Clearly document which environment variables are used
12
-
# [DONE] 2. Don't assume PRs are going into master branch, need to get the target
13
-
# [DONE] 3. Add Gmefile support
14
-
# [DONE] 4. Document file paths
9
+
importparse_yarn
15
10
16
11
ENV_KEYS= [
17
12
"GITHUB_SHA", # for get_PR_diff; this is the SHA of the commit for the branch being merged
@@ -26,6 +21,35 @@
26
21
"pr_comment": "/home/runner/pr_comment.txt",
27
22
}
28
23
24
+
'''
25
+
States on returncode
26
+
0 = No comment
27
+
1 = FAILED_COMMENT
28
+
5 = INCOMPLETE_COMMENT then:
29
+
4 = COMPLETE_SUCCESS_COMMENT
30
+
1 = COMPLETE_FAILED_COMMENT
31
+
'''
32
+
33
+
# Headers for distinct comment types
34
+
DETAILS_DROPDOWN="<details>\n<summary>Background</summary>\n<br />\nThis repository uses a GitHub Action to automatically analyze the risk of new dependencies added via Pull Request. An administrator of this repository has set score requirements for Phylum's five risk domains.<br /><br />\nIf you see this comment, one or more dependencies added to the package manager lockfile in this Pull Request have failed Phylum's risk analysis.\n</details>\n\n"
INCOMPLETE_COMMENT+="This pull request contains TKTK package versions Phylum has not yet processed, preventing a complete risk analysis. Phylum is processing these packages currently and should complete within 30 minutes. Please wait for at least 30 minutes, then re-run the GitHub Check pertaining to `phylum-analyze-pr-action`.\n\n"
header+="<details>\n<summary>Background</summary>\n<br />\nThis repository uses a GitHub Action to automatically analyze the risk of new dependencies added to requirements.txt via Pull Request. An administrator of this repository has set score requirements for Phylum's five risk domains.<br /><br />\nIf you see this comment, one or more dependencies added to the requirements.txt file in this Pull Request have failed Phylum's risk analysis.\n</details>\n\n"
388
-
389
-
# with open('/home/runner/pr_comment.txt','w') as outfile:
0 commit comments