From c46e29ee37e6690598730fbd10469c9e8bd61d97 Mon Sep 17 00:00:00 2001
From: bfaciane <bfaciane@nrao.edu>
Date: Fri, 5 Apr 2024 15:59:19 -0400
Subject: [PATCH] always save qa notes, make method static

---
 .../executables/pexable/conveyor/conveyor/retrieve.py    | 3 +--
 shared/workspaces/workspaces/capability/schema.py        | 9 +++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/apps/cli/executables/pexable/conveyor/conveyor/retrieve.py b/apps/cli/executables/pexable/conveyor/conveyor/retrieve.py
index bbe64c25f..dafa98a0b 100644
--- a/apps/cli/executables/pexable/conveyor/conveyor/retrieve.py
+++ b/apps/cli/executables/pexable/conveyor/conveyor/retrieve.py
@@ -62,11 +62,10 @@ class RetrievalConveyor(ConveyorIF):
         else:
             self.logger.info(f"Directories from {qa_path} have already been retrieved! Continuing...")
 
+        self.save_qa_notes(spool_path)
         if "Fail" in self.action:
             # On fail actions, data should be completely removed from the spool
             shutil.rmtree(spool_path)
-        else:
-            self.save_qa_notes(spool_path)
 
     def save_qa_notes(self, spool_path):
         # obtain the qa_notes.html data and push it up to the capability version here
diff --git a/shared/workspaces/workspaces/capability/schema.py b/shared/workspaces/workspaces/capability/schema.py
index 1c59ed38a..ef4d5c73b 100644
--- a/shared/workspaces/workspaces/capability/schema.py
+++ b/shared/workspaces/workspaces/capability/schema.py
@@ -629,7 +629,8 @@ class QaUtilities:
     Utility class that handles common QA actions
     """
 
-    def fail_all_versions(self, request: CapabilityRequest, pass_version: CapabilityVersion):
+    @staticmethod
+    def fail_all_versions(request: CapabilityRequest, pass_version: CapabilityVersion):
         """
         Given a capability request and an optional version to ignore, set the state of all versions to Failed.
 
@@ -642,15 +643,15 @@ class QaUtilities:
             if version.__json__() != pass_version:
                 # Mark version as failed
                 logger.info(f"Failing version: {version.__json__()}")
-                if self.check_still_running(version):
+                if QaUtilities.check_still_running(version):
                     # There is only a single active execution for any version
                     workflow_request_id = version.current_execution.current_workflow_request_id
                     logger.info(f"Attempting to abort running execution #{version.current_execution.id}.")
-                    self.abort_running_execution(workflow_request_id, version.version_number)
+                    QaUtilities.abort_running_execution(workflow_request_id, version.version_number)
                 else:
                     # if QAFail has not already been run, or this execution was aborted, QAFail it
                     if version.state != CapabilityVersionState.Failed.name:
-                        self.run_qa_fail_workflow(version)
+                        QaUtilities.run_qa_fail_workflow(version)
                 version.state = CapabilityVersionState.Failed.name
 
     @staticmethod
-- 
GitLab