@@ -24,7 +24,7 @@ def fetch_pipeline_for_commit(commit_sha, branch_name="main"):
24
24
response .raise_for_status ()
25
25
pipelines = response .json ()
26
26
if not pipelines :
27
- raise ValueError (f"No pipeline found for commit: { commit_sha } on branch: { branch_name } " )
27
+ raise ValueError (f"No pipeline found for commit: { commit_sha } on branch: { branch_name } . " )
28
28
return pipelines [0 ]['id' ]
29
29
30
30
# Fetch the versions for the gitlab MR.
@@ -55,11 +55,11 @@ def download_ref_map_file(chip_name, job_id, output_file):
55
55
f .write (chunk )
56
56
57
57
# Locate the map file artifact for the current pipeline.
58
- def locate_current_map_file (example ):
59
- pattern = f"examples/{ example } /build* /{ example } .map"
58
+ def locate_current_map_file (chip , example ):
59
+ pattern = f"examples/{ example } /build_ { chip } _default /{ example } .map"
60
60
artifact_file_paths = glob .glob (pattern , recursive = True )
61
61
if not artifact_file_paths :
62
- raise FileNotFoundError ("No map file found! " )
62
+ raise FileNotFoundError ("No map file found for the example {example} with target chip {chip} " )
63
63
return artifact_file_paths [0 ]
64
64
65
65
# Execute esp_idf_size diff command to find increase/decrease in firmware size.
@@ -113,8 +113,8 @@ def main():
113
113
if not target_job_id :
114
114
raise ValueError ("Target job not found." )
115
115
116
+ current_map_file = locate_current_map_file (args .chip , args .example )
116
117
download_ref_map_file (args .chip , target_job_id , args .ref_map_file )
117
- current_map_file = locate_current_map_file (args .example )
118
118
119
119
size_diff_output = execute_idf_size_command (args .ref_map_file , current_map_file )
120
120
post_results_to_gitlab_mr (size_diff_output , args .chip , args .example )
0 commit comments