Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a minor bug in CI slack report #22906

Merged
merged 2 commits into from
Apr 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion utils/get_previous_daily_ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ def get_last_daily_ci_reports(artifact_names, output_dir, token):

results = {}
for artifact_name in artifact_names:
results[artifact_name] = {}
artifact_zip_path = os.path.join(output_dir, f"{artifact_name}.zip")
if os.path.isfile(artifact_zip_path):
results[artifact_name] = {}
Copy link
Collaborator Author

@ydshieh ydshieh Apr 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add the key only if the artifact is downloaded

with zipfile.ZipFile(artifact_zip_path) as z:
for filename in z.namelist():
if not os.path.isdir(filename):
Expand Down
7 changes: 5 additions & 2 deletions utils/notification_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,8 +423,11 @@ def per_model_sum(model_category_dict):
artifact_names=artifact_names, output_dir=output_dir, token=os.environ["ACCESS_REPO_INFO_TOKEN"]
)

# The last run doesn't produce `test_failure_tables` (by some issues or have no model failure at all)
if len(prev_tables) > 0:
# if the last run produces artifact named `test_failure_tables`
if (
"test_failure_tables" in prev_tables
and "model_failures_report.txt" in prev_tables["test_failure_tables"]
):
# Compute the difference of the previous/current (model failure) table
prev_model_failures = prev_tables["test_failure_tables"]["model_failures_report.txt"]
entries_changed = self.compute_diff_for_failure_reports(model_failures_report, prev_model_failures)
Expand Down