added still processing as reason for failure for

newly created entries, to not get confused when the program crashes, because empty implies successful, but not when the pogram crashes or get's interrupted
This commit is contained in:
Karma Riuk
2025-03-20 10:42:55 +01:00
parent 4b83a822a1
commit 86763d6674

View File

@ -92,7 +92,7 @@ def process_pull(repo: Repository, pr: PullRequest, dataset: Dataset, repos_dir:
diffs_after = {file.filename: file.patch for file in repo.compare(first_commit.sha, last_commit.sha).files}
entry = DatasetEntry(
metadata=Metadata(repo.full_name, pr.number, pr.merge_commit_sha, commented_file_path),
metadata=Metadata(repo.full_name, pr.number, pr.merge_commit_sha, commented_file_path, reason_for_failure="Was still processing while the program crashed / was stopped"),
files={file.filename: FileData(file.filename) for file in pr.get_files()},
diffs_before=diffs_before,
comment=comment_text,
@ -165,6 +165,8 @@ def process_pull(repo: Repository, pr: PullRequest, dataset: Dataset, repos_dir:
build_handler.clean_repo()
reset_repo_to_latest_commit(repo_path)
if entry.metadata.successful:
entry.metadata.reason_for_failure = "" # was set to 'still processing', since it's done being processed and was successful, there are no reasons for failure
dataset.to_json(args.output)