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

Updated new errors output logic and logging #219

Merged
merged 3 commits into from
Feb 13, 2025
Merged
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
10 changes: 5 additions & 5 deletions tf_compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ def get_workflow_runs():
# add workflow run id to array
_artifactRunID.append(run['id'])


if index == 1 and run['status'] == 'in_progress':
if index == 1:
url = f"https://api.github.com/repos/{repos[1]}/actions/runs/{run['id']}/logs"

# Download logs
print(f"Downloading Log files for run: {run['id']}")
response = requests.get(url, headers=headers)
time.sleep(1)
if response.status_code == 200:
print(f"Log files downloaded for run: {run['id']}")
with open("logs.zip", "wb") as f:
Expand Down Expand Up @@ -418,8 +418,8 @@ def compare_artifacts(artifact_files):

failcount = 0
for new_error in new_fails_map:
if new_error not in new_fails_map:
file.write(f"\n{new_error}\n")
if new_error not in prev_fails_map:
file.write(f"\n{new_error} - {new_fails_map[new_error]}\n")
failcount +=1

if failcount == 0:
Expand All @@ -430,7 +430,7 @@ def compare_artifacts(artifact_files):
fixcount = 0
for prev_error in prev_fails_map:
if prev_error not in new_fails_map:
file.write(f"\n{prev_error}\n")
file.write(f"\n{prev_error} - {prev_fails_map[prev_error]}\n")
fixcount +=1

if fixcount == 0:
Expand Down
Loading