@@ -30,14 +30,18 @@ def resync_specs(directory: pathlib.Path, errored: dict[str, str]) -> None:
30
30
print ("Done syncing specs" )
31
31
32
32
33
- def apply_patches ():
33
+ def apply_patches (errored ):
34
34
print ("Beginning to apply patches" )
35
35
subprocess .run (["bash" , "./.evergreen/remove-unimplemented-tests.sh" ], check = True ) # noqa: S603, S607
36
- subprocess .run (
37
- ["git apply -R --allow-empty --whitespace=fix ./.evergreen/spec-patch/*" ], # noqa: S607
38
- shell = True , # noqa: S602
39
- check = True ,
40
- )
36
+ try :
37
+ subprocess .run (
38
+ ["git apply -R --allow-empty --whitespace=fix ./.evergreen/spec-patch/*" ], # noqa: S607
39
+ shell = True , # noqa: S602
40
+ check = True ,
41
+ stderr = subprocess .PIPE ,
42
+ )
43
+ except CalledProcessError as exc :
44
+ errored ["applying patches" ] = exc .stderr
41
45
42
46
43
47
def check_new_spec_directories (directory : pathlib .Path ) -> list [str ]:
@@ -85,7 +89,7 @@ def write_summary(errored: dict[str, str], new: list[str], filename: Optional[st
85
89
pr_body += "\n -" .join (succeeded )
86
90
pr_body += "\n "
87
91
if len (errored ) > 0 :
88
- pr_body += "\n \n The following spec syncs encountered errors:\n - "
92
+ pr_body += "\n \n The following spec syncs encountered errors:"
89
93
for k , v in errored .items ():
90
94
pr_body += f"\n -{ k } \n ```{ v } \n ```"
91
95
pr_body += "\n "
@@ -106,7 +110,7 @@ def main(args: Namespace):
106
110
directory = pathlib .Path ("./test" )
107
111
errored : dict [str , str ] = {}
108
112
resync_specs (directory , errored )
109
- apply_patches ()
113
+ apply_patches (errored )
110
114
new = check_new_spec_directories (directory )
111
115
write_summary (errored , new , args .filename )
112
116
0 commit comments