Skip to content

Commit cb9a2f4

Browse files
committed
minor fices after merge
1 parent 797eab6 commit cb9a2f4

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

osa_tool/operations/analysis/repository_report/report_maker.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ def run(self) -> dict:
322322
try:
323323
self.build_pdf()
324324
self.events.append(OperationEvent(kind=EventKind.GENERATED, target=f"{self.filename}"))
325-
if self.create_fork:
325+
if self.create_fork and os.path.exists(self.output_path):
326326
self.git_agent.upload_report(self.filename, self.output_path)
327327
self.events.append(OperationEvent(kind=EventKind.UPLOADED, target=f"{self.filename}"))
328328
return {"result": {"report": self.filename}, "events": self.events}
@@ -402,14 +402,17 @@ def body_second_part(self) -> list[Flowable]:
402402

403403

404404
class WhatHasBeenDoneReportGenerator(AbstractReportGenerator):
405+
405406
def __init__(
406407
self,
407408
config_manager: ConfigManager,
408-
plan: Plan,
409409
git_agent: GitAgent,
410+
create_fork: bool,
411+
plan: Plan,
410412
):
411413
super().__init__(config_manager, git_agent)
412414
self.filename = f"{self.metadata.name}_work_summary.pdf"
415+
self.create_fork = create_fork
413416
self.output_path = os.path.join(os.getcwd(), self.filename)
414417
self.completed_tasks = plan.list_for_report
415418
self.task_results = plan.results or {}
@@ -429,6 +432,9 @@ def run(self) -> dict:
429432
try:
430433
self.build_pdf()
431434
self.events.append(OperationEvent(kind=EventKind.GENERATED, target=self.filename))
435+
if self.create_fork and os.path.exists(self.output_path):
436+
self.git_agent.upload_report(self.filename, self.output_path)
437+
self.events.append(OperationEvent(kind=EventKind.UPLOADED, target=f"{self.filename}"))
432438
return {"result": {"report": self.filename}, "events": self.events}
433439
except ValueError as e:
434440
self.events.append(OperationEvent(kind=EventKind.FAILED, target="OSA work summary", data={"error": str(e)}))

osa_tool/operations/analysis/repository_validation/doc_validator.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import asyncio
22
import base64
33
import json
4+
import os
45
import re
56

67
import docx2txt
@@ -57,7 +58,7 @@ def run(self) -> dict:
5758
va_re_gen = ValidationReportGenerator(self.config_manager, self.git_agent.metadata)
5859
va_re_gen.build_pdf("Document", content)
5960
self.events.append(OperationEvent(kind=EventKind.GENERATED, target=va_re_gen.filename))
60-
if self.create_fork:
61+
if self.create_fork and os.path.exists(va_re_gen.output_path):
6162
self.git_agent.upload_report(va_re_gen.filename, va_re_gen.output_path)
6263
self.events.append(OperationEvent(kind=EventKind.UPLOADED, target=va_re_gen.filename))
6364

osa_tool/operations/analysis/repository_validation/paper_validator.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import asyncio
2+
import os
23

34
from osa_tool.config.settings import ConfigManager
45
from osa_tool.core.git.git_agent import GitAgent
@@ -52,7 +53,7 @@ def run(self) -> dict:
5253
va_re_gen = ValidationReportGenerator(self.config_manager, self.git_agent.metadata)
5354
va_re_gen.build_pdf("Paper", content)
5455
self.events.append(OperationEvent(kind=EventKind.GENERATED, target=va_re_gen.filename))
55-
if self.create_fork:
56+
if self.create_fork and os.path.exists(va_re_gen.output_path):
5657
self.git_agent.upload_report(va_re_gen.filename, va_re_gen.output_path)
5758
self.events.append(OperationEvent(kind=EventKind.UPLOADED, target=va_re_gen.filename))
5859

osa_tool/run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ def main():
235235
)
236236

237237
if plan.get("report"):
238-
WhatHasBeenDoneReportGenerator(config_manager, plan, git_agent).run()
238+
WhatHasBeenDoneReportGenerator(config_manager, git_agent, create_fork, plan).run()
239239

240240
elapsed_time = time.time() - start_time
241241
rich_section(f"All operations completed successfully in total time: {format_time(elapsed_time)}")

0 commit comments

Comments
 (0)