alita-sdk 0.3.427__py3-none-any.whl → 0.3.428__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of alita-sdk might be problematic. Click here for more details.

@@ -249,7 +249,7 @@ class PrinterNode(Runnable):
249
249
  formatted_output = mapping[PRINTER]
250
250
  # add info label to the printer's output
251
251
  if formatted_output:
252
- formatted_output += f"\n\n-----\n*How to proceed?*\n* - to resume the pipeline - type anything"
252
+ formatted_output += f"\n\n-----\n*How to proceed?*\n* *to resume the pipeline - type anything...*"
253
253
  logger.debug(f"Formatted output: {formatted_output}")
254
254
  result[PRINTER_NODE_RS] = formatted_output
255
255
  return result
@@ -91,8 +91,16 @@ QtestCreateTestCase = create_model(
91
91
 
92
92
  QtestLinkTestCaseToJiraRequirement = create_model(
93
93
  "QtestLinkTestCaseToJiraRequirement",
94
- requirement_external_id=(str, Field("Qtest requirement external id which represent jira issue id linked to Qtest as a requirement e.g. SITEPOD-4038")),
95
- json_list_of_test_case_ids=(str, Field("""List of the test case ids to be linked to particular requirement.
94
+ requirement_external_id=(str, Field(description="Qtest requirement external id which represent jira issue id linked to Qtest as a requirement e.g. SITEPOD-4038")),
95
+ json_list_of_test_case_ids=(str, Field(description="""List of the test case ids to be linked to particular requirement.
96
+ Create a list of the test case ids in the following format '["TC-123", "TC-234", "TC-456"]' which represents json array as a string.
97
+ It should be capable to be extracted directly by python json.loads method."""))
98
+ )
99
+
100
+ QtestLinkTestCaseToQtestRequirement = create_model(
101
+ "QtestLinkTestCaseToQtestRequirement",
102
+ requirement_id=(str, Field(description="QTest internal requirement ID in format RQ-123")),
103
+ json_list_of_test_case_ids=(str, Field(description="""List of the test case ids to be linked to particular requirement.
96
104
  Create a list of the test case ids in the following format '["TC-123", "TC-234", "TC-456"]' which represents json array as a string.
97
105
  It should be capable to be extracted directly by python json.loads method."""))
98
106
  )
@@ -647,6 +655,38 @@ class QtestApiWrapper(BaseToolApiWrapper):
647
655
  parsed_data = self.__perform_search_by_dql(dql)
648
656
  return parsed_data[0]['QTest Id']
649
657
 
658
+ def __find_qtest_requirement_id_by_id(self, requirement_id: str) -> int:
659
+ """Search for requirement's internal QTest ID using requirement ID (RQ-xxx format).
660
+
661
+ Args:
662
+ requirement_id: Requirement ID in format RQ-123
663
+
664
+ Returns:
665
+ int: Internal QTest ID for the requirement
666
+
667
+ Raises:
668
+ ValueError: If requirement is not found
669
+ """
670
+ dql = f"Id = '{requirement_id}'"
671
+ search_instance: SearchApi = swagger_client.SearchApi(self._client)
672
+ body = swagger_client.ArtifactSearchParams(object_type='requirements', fields=['*'], query=dql)
673
+
674
+ try:
675
+ response = search_instance.search_artifact(self.qtest_project_id, body)
676
+ if response['total'] == 0:
677
+ raise ValueError(
678
+ f"Requirement '{requirement_id}' not found in project {self.qtest_project_id}. "
679
+ f"Please verify the requirement ID exists."
680
+ )
681
+ return response['items'][0]['id']
682
+ except ApiException as e:
683
+ stacktrace = format_exc()
684
+ logger.error(f"Exception when searching for requirement: \n {stacktrace}")
685
+ raise ToolException(
686
+ f"Unable to search for requirement '{requirement_id}' in project {self.qtest_project_id}. "
687
+ f"Exception: \n{stacktrace}"
688
+ ) from e
689
+
650
690
  def __is_jira_requirement_present(self, jira_issue_id: str) -> tuple[bool, dict]:
651
691
  """ Define if particular Jira requirement is present in qtest or not """
652
692
  dql = f"'External Id' = '{jira_issue_id}'"
@@ -663,31 +703,112 @@ class QtestApiWrapper(BaseToolApiWrapper):
663
703
  logger.error(f"Error: {format_exc()}")
664
704
  raise e
665
705
 
666
- def _get_jira_requirement_id(self, jira_issue_id: str) -> int | None:
667
- """ Search for requirement id using the linked jira_issue_id. """
706
+ def _get_jira_requirement_id(self, jira_issue_id: str) -> int:
707
+ """Search for requirement id using the linked jira_issue_id.
708
+
709
+ Args:
710
+ jira_issue_id: External Jira issue ID (e.g., PLAN-128)
711
+
712
+ Returns:
713
+ int: Internal QTest ID for the Jira requirement
714
+
715
+ Raises:
716
+ ValueError: If Jira requirement is not found in QTest
717
+ """
668
718
  is_present, response = self.__is_jira_requirement_present(jira_issue_id)
669
719
  if not is_present:
670
- return None
720
+ raise ValueError(
721
+ f"Jira requirement '{jira_issue_id}' not found in QTest project {self.qtest_project_id}. "
722
+ f"Please ensure the Jira issue is linked to QTest as a requirement."
723
+ )
671
724
  return response['items'][0]['id']
672
725
 
673
726
 
674
727
  def link_tests_to_jira_requirement(self, requirement_external_id: str, json_list_of_test_case_ids: str) -> str:
675
- """ Link the list of the test cases represented as string like this '["TC-123", "TC-234"]' to the Jira requirement represented as external id e.g. PLAN-128 which is the Jira Issue Id"""
728
+ """Link test cases to external Jira requirement.
729
+
730
+ Args:
731
+ requirement_external_id: Jira issue ID (e.g., PLAN-128)
732
+ json_list_of_test_case_ids: JSON array string of test case IDs (e.g., '["TC-123", "TC-234"]')
733
+
734
+ Returns:
735
+ Success message with linked test case IDs
736
+ """
676
737
  link_object_api_instance = swagger_client.ObjectLinkApi(self._client)
677
738
  source_type = "requirements"
678
739
  linked_type = "test-cases"
679
- list = [self.__find_qtest_id_by_test_id(test_case_id) for test_case_id in json.loads(json_list_of_test_case_ids)]
740
+ test_case_ids = json.loads(json_list_of_test_case_ids)
741
+ qtest_test_case_ids = [self.__find_qtest_id_by_test_id(tc_id) for tc_id in test_case_ids]
680
742
  requirement_id = self._get_jira_requirement_id(requirement_external_id)
681
743
 
682
744
  try:
683
- response = link_object_api_instance.link_artifacts(self.qtest_project_id, object_id=requirement_id,
684
- type=linked_type,
685
- object_type=source_type, body=list)
686
- return f"The test cases with the following id's - {[link.pid for link in response[0].objects]} have been linked in following project {self.qtest_project_id} under following requirement {requirement_external_id}"
687
- except Exception as e:
688
- from traceback import format_exc
689
- logger.error(f"Error: {format_exc()}")
690
- raise e
745
+ response = link_object_api_instance.link_artifacts(
746
+ self.qtest_project_id,
747
+ object_id=requirement_id,
748
+ type=linked_type,
749
+ object_type=source_type,
750
+ body=qtest_test_case_ids
751
+ )
752
+ linked_test_cases = [link.pid for link in response[0].objects]
753
+ return (
754
+ f"Successfully linked {len(linked_test_cases)} test case(s) to Jira requirement '{requirement_external_id}' "
755
+ f"in project {self.qtest_project_id}.\n"
756
+ f"Linked test cases: {', '.join(linked_test_cases)}"
757
+ )
758
+ except ApiException as e:
759
+ stacktrace = format_exc()
760
+ logger.error(f"Error linking to Jira requirement: {stacktrace}")
761
+ raise ToolException(
762
+ f"Unable to link test cases to Jira requirement '{requirement_external_id}' "
763
+ f"in project {self.qtest_project_id}. Exception: \n{stacktrace}"
764
+ ) from e
765
+
766
+ def link_tests_to_qtest_requirement(self, requirement_id: str, json_list_of_test_case_ids: str) -> str:
767
+ """Link test cases to internal QTest requirement.
768
+
769
+ Args:
770
+ requirement_id: QTest requirement ID in format RQ-123
771
+ json_list_of_test_case_ids: JSON array string of test case IDs (e.g., '["TC-123", "TC-234"]')
772
+
773
+ Returns:
774
+ Success message with linked test case IDs
775
+
776
+ Raises:
777
+ ValueError: If requirement or test cases are not found
778
+ ToolException: If linking fails
779
+ """
780
+ link_object_api_instance = swagger_client.ObjectLinkApi(self._client)
781
+ source_type = "requirements"
782
+ linked_type = "test-cases"
783
+
784
+ # Parse and convert test case IDs
785
+ test_case_ids = json.loads(json_list_of_test_case_ids)
786
+ qtest_test_case_ids = [self.__find_qtest_id_by_test_id(tc_id) for tc_id in test_case_ids]
787
+
788
+ # Get internal QTest ID for the requirement
789
+ qtest_requirement_id = self.__find_qtest_requirement_id_by_id(requirement_id)
790
+
791
+ try:
792
+ response = link_object_api_instance.link_artifacts(
793
+ self.qtest_project_id,
794
+ object_id=qtest_requirement_id,
795
+ type=linked_type,
796
+ object_type=source_type,
797
+ body=qtest_test_case_ids
798
+ )
799
+ linked_test_cases = [link.pid for link in response[0].objects]
800
+ return (
801
+ f"Successfully linked {len(linked_test_cases)} test case(s) to QTest requirement '{requirement_id}' "
802
+ f"in project {self.qtest_project_id}.\n"
803
+ f"Linked test cases: {', '.join(linked_test_cases)}"
804
+ )
805
+ except ApiException as e:
806
+ stacktrace = format_exc()
807
+ logger.error(f"Error linking to QTest requirement: {stacktrace}")
808
+ raise ToolException(
809
+ f"Unable to link test cases to QTest requirement '{requirement_id}' "
810
+ f"in project {self.qtest_project_id}. Exception: \n{stacktrace}"
811
+ ) from e
691
812
 
692
813
  def search_by_dql(self, dql: str, extract_images:bool=False, prompt: str=None):
693
814
  """Search for the test cases in qTest using Data Query Language """
@@ -809,12 +930,19 @@ class QtestApiWrapper(BaseToolApiWrapper):
809
930
  "ref": self.delete_test_case,
810
931
  },
811
932
  {
812
- "name": "link_tests_to_requirement",
813
- "mode": "link_tests_to_requirement",
814
- "description": """Link tests to Jira requirements. The input is jira issue id and th list of test ids in format '["TC-123", "TC-234", "TC-345"]'""",
933
+ "name": "link_tests_to_jira_requirement",
934
+ "mode": "link_tests_to_jira_requirement",
935
+ "description": "Link test cases to external Jira requirement. Provide Jira issue ID (e.g., PLAN-128) and list of test case IDs in format '[\"TC-123\", \"TC-234\"]'",
815
936
  "args_schema": QtestLinkTestCaseToJiraRequirement,
816
937
  "ref": self.link_tests_to_jira_requirement,
817
938
  },
939
+ {
940
+ "name": "link_tests_to_qtest_requirement",
941
+ "mode": "link_tests_to_qtest_requirement",
942
+ "description": "Link test cases to internal QTest requirement. Provide QTest requirement ID (e.g., RQ-15) and list of test case IDs in format '[\"TC-123\", \"TC-234\"]'",
943
+ "args_schema": QtestLinkTestCaseToQtestRequirement,
944
+ "ref": self.link_tests_to_qtest_requirement,
945
+ },
818
946
  {
819
947
  "name": "get_modules",
820
948
  "mode": "get_modules",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: alita_sdk
3
- Version: 0.3.427
3
+ Version: 0.3.428
4
4
  Summary: SDK for building langchain agents using resources from Alita
5
5
  Author-email: Artem Rozumenko <artyom.rozumenko@gmail.com>, Mikalai Biazruchka <mikalai_biazruchka@epam.com>, Roman Mitusov <roman_mitusov@epam.com>, Ivan Krakhmaliuk <lifedj27@gmail.com>, Artem Dubrovskiy <ad13box@gmail.com>
6
6
  License-Expression: Apache-2.0
@@ -45,7 +45,7 @@ alita_sdk/runtime/langchain/assistant.py,sha256=qKoEjbGuUnX-OZDHmSaK3plb1jON9unz
45
45
  alita_sdk/runtime/langchain/chat_message_template.py,sha256=kPz8W2BG6IMyITFDA5oeb5BxVRkHEVZhuiGl4MBZKdc,2176
46
46
  alita_sdk/runtime/langchain/constants.py,sha256=I3dwexVp_Qq3MueRA2ClLgFDEhk4BkJhgR6m7V0gVPc,3404
47
47
  alita_sdk/runtime/langchain/indexer.py,sha256=0ENHy5EOhThnAiYFc7QAsaTNp9rr8hDV_hTK8ahbatk,37592
48
- alita_sdk/runtime/langchain/langraph_agent.py,sha256=SGEjHdPiV7dQno6hcnKhbQMfU_gRU0kKD_0uXzt2bV4,51833
48
+ alita_sdk/runtime/langchain/langraph_agent.py,sha256=CxDFfUTCG-i8koMR9PwOktvlcdUe5cyG4D8CQHrTH1E,51836
49
49
  alita_sdk/runtime/langchain/mixedAgentParser.py,sha256=M256lvtsL3YtYflBCEp-rWKrKtcY1dJIyRGVv7KW9ME,2611
50
50
  alita_sdk/runtime/langchain/mixedAgentRenderes.py,sha256=asBtKqm88QhZRILditjYICwFVKF5KfO38hu2O-WrSWE,5964
51
51
  alita_sdk/runtime/langchain/store_manager.py,sha256=i8Fl11IXJhrBXq1F1ukEVln57B1IBe-tqSUvfUmBV4A,2218
@@ -303,7 +303,7 @@ alita_sdk/tools/postman/postman_analysis.py,sha256=ckc2BfKEop0xnmLPksVRE_Y94ixuq
303
303
  alita_sdk/tools/pptx/__init__.py,sha256=vVUrWnj7KWJgEk9oxGSsCAQ2SMSXrp_SFOdUHYQKcAo,3444
304
304
  alita_sdk/tools/pptx/pptx_wrapper.py,sha256=yyCYcTlIY976kJ4VfPo4dyxj4yeii9j9TWP6W8ZIpN8,29195
305
305
  alita_sdk/tools/qtest/__init__.py,sha256=Jf0xo5S_4clXR2TfCbJbB1sFgCbcFQRM-YYX2ltWBzo,4461
306
- alita_sdk/tools/qtest/api_wrapper.py,sha256=kxH4H1mFm4-_xqJ3js92YzT9sJ-6XC30moC1WCExano,40926
306
+ alita_sdk/tools/qtest/api_wrapper.py,sha256=5YJPcEGUT_V_SdgiYBoPDJHTEDfCrDgzoXTdXuGoH4I,46652
307
307
  alita_sdk/tools/qtest/tool.py,sha256=kKzNPS4fUC76WQQttQ6kdVANViHEvKE8Kf174MQiNYU,562
308
308
  alita_sdk/tools/rally/__init__.py,sha256=2BPPXJxAOKgfmaxVFVvxndfK0JxOXDLkoRmzu2dUwOE,3512
309
309
  alita_sdk/tools/rally/api_wrapper.py,sha256=mouzU6g0KML4UNapdk0k6Q0pU3MpJuWnNo71n9PSEHM,11752
@@ -353,8 +353,8 @@ alita_sdk/tools/zephyr_scale/api_wrapper.py,sha256=kT0TbmMvuKhDUZc0i7KO18O38JM9S
353
353
  alita_sdk/tools/zephyr_squad/__init__.py,sha256=0ne8XLJEQSLOWfzd2HdnqOYmQlUliKHbBED5kW_Vias,2895
354
354
  alita_sdk/tools/zephyr_squad/api_wrapper.py,sha256=kmw_xol8YIYFplBLWTqP_VKPRhL_1ItDD0_vXTe_UuI,14906
355
355
  alita_sdk/tools/zephyr_squad/zephyr_squad_cloud_client.py,sha256=R371waHsms4sllHCbijKYs90C-9Yu0sSR3N4SUfQOgU,5066
356
- alita_sdk-0.3.427.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
357
- alita_sdk-0.3.427.dist-info/METADATA,sha256=J0tNPenigoEpUHXwQ5dQPc5lBEnwsgNFrXbplG0QAZs,19071
358
- alita_sdk-0.3.427.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
359
- alita_sdk-0.3.427.dist-info/top_level.txt,sha256=0vJYy5p_jK6AwVb1aqXr7Kgqgk3WDtQ6t5C-XI9zkmg,10
360
- alita_sdk-0.3.427.dist-info/RECORD,,
356
+ alita_sdk-0.3.428.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
357
+ alita_sdk-0.3.428.dist-info/METADATA,sha256=ej9BznzDUgSAEvLoIGgbx97Sw4qGYdHkqAx3wyTN95E,19071
358
+ alita_sdk-0.3.428.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
359
+ alita_sdk-0.3.428.dist-info/top_level.txt,sha256=0vJYy5p_jK6AwVb1aqXr7Kgqgk3WDtQ6t5C-XI9zkmg,10
360
+ alita_sdk-0.3.428.dist-info/RECORD,,