@@ -41,15 +41,27 @@ def compare_files_str(file1, file2):
41
41
return ret
42
42
43
43
44
- def comment_pr (folder1 , folder2 , output_file , repo , pr_number , run_id ):
44
+ def comment_pr (output_file , repo , run_id ):
45
+ folder1 = "out_base"
46
+ folder2 = "out_merge"
47
+ utils .subprocess_run (["gh" , "run" , "download" , "--repo" , repo , "--name" ,
48
+ "csv-framework-coverage-base" , "--dir" , folder1 , str (run_id )])
49
+ utils .subprocess_run (["gh" , "run" , "download" , "--repo" , repo , "--name" ,
50
+ "csv-framework-coverage-merge" , "--dir" , folder2 , str (run_id )])
51
+ utils .subprocess_run (["gh" , "run" , "download" , "--repo" , repo , "--name" ,
52
+ "pr" , "--dir" , "pr" , str (run_id )])
53
+
54
+ with open ("pr/NR" ) as file :
55
+ pr_number = int (file .read ())
56
+
45
57
compare_folders (folder1 , folder2 , output_file )
46
58
size = os .path .getsize (output_file )
47
59
if size == 0 :
48
60
print ("No difference in the coverage reports" )
49
61
return
50
62
51
63
comment = ":warning: The head of this PR and the base branch were compared for differences in the framework coverage reports. " + \
52
- "The generated reports are available in the [artifacts of this workflow run](https://github.com/" + repo + "/actions/runs/" + run_id + "). " + \
64
+ "The generated reports are available in the [artifacts of this workflow run](https://github.com/" + repo + "/actions/runs/" + str ( run_id ) + "). " + \
53
65
"The differences will be picked up by the nightly job after the PR gets merged. "
54
66
55
67
if size < 2000 :
@@ -62,7 +74,7 @@ def comment_pr(folder1, folder2, output_file, repo, pr_number, run_id):
62
74
comment += "The differences can be found in the " + \
63
75
output_file + " artifact of this job."
64
76
65
- post_comment (comment , repo , pr_number )
77
+ # post_comment(comment, repo, pr_number)
66
78
67
79
68
80
def post_comment (comment , repo , pr_number ):
@@ -125,5 +137,5 @@ def compare_folders(folder1, folder2, output_file):
125
137
out .write (return_md )
126
138
127
139
128
- comment_pr (sys .argv [1 ], sys .argv [2 ], sys .argv [3 ],
129
- sys . argv [ 4 ], sys . argv [ 5 ], sys . argv [ 6 ] )
140
+ # comment_pr(sys.argv[1], sys.argv[2], sys.argv[3])
141
+ comment_pr ( "x.md" , "dsp-testing/codeql-csv-coverage-pr-commenter" , 938931471 )
0 commit comments