From 3c5684b57678b1818280d40a55d3e79a3bbb8553 Mon Sep 17 00:00:00 2001 From: epintzov Date: Fri, 10 May 2024 10:31:16 +0300 Subject: [PATCH 01/14] added algorithm --- .gitlab/ci/.gitlab-ci.global.yml | 11 +++ Tests/scripts/split_packs_to_machines.py | 112 +++++++++++++++++++++++ 2 files changed, 123 insertions(+) create mode 100644 Tests/scripts/split_packs_to_machines.py diff --git a/.gitlab/ci/.gitlab-ci.global.yml b/.gitlab/ci/.gitlab-ci.global.yml index edd2a455a51a..1bc7e2265268 100644 --- a/.gitlab/ci/.gitlab-ci.global.yml +++ b/.gitlab/ci/.gitlab-ci.global.yml @@ -370,6 +370,17 @@ fi - section_end "Unlock Machine" +.split-packs-to-machines: + - section_start "Split packs to chosen machines" --collapsed + - | + if [[ ${#CLOUD_CHOSEN_MACHINE_IDS[@]} -gt 1 ]]; then + echo "There are more than 1 chosen cloud machines." + else + echo "There is 1 machine." + python3 Tests/scripts/split_packs_to_machines.py --cloud_machines ${CLOUD_CHOSEN_MACHINE_IDS} + fi + + .cloud-machine-information: - section_start "Cloud Machine information" - ./Tests/scripts/print_cloud_machine_details.sh diff --git a/Tests/scripts/split_packs_to_machines.py b/Tests/scripts/split_packs_to_machines.py new file mode 100644 index 000000000000..6879e1c95494 --- /dev/null +++ b/Tests/scripts/split_packs_to_machines.py @@ -0,0 +1,112 @@ +import argparse +import json +from collections import defaultdict + + +class PackInfo: + def __init__(self, name): + self.name = name + self.test_playbooks_to_run = set() + self.dependencies = set() + self.total_expected_execution_time = 0 + + +def build_pack_information(playbooks, playbook_times): + packs_to_install = {} + for name, info in playbooks.items(): + pack_name = info['pack'] + if pack_name not in packs_to_install: + pack_obj = PackInfo(pack_name) + packs_to_install[pack_name] = pack_obj + else: + pack_obj: PackInfo = packs_to_install[pack_name] + + pack_obj.test_playbooks_to_run.add(name) + pack_obj.total_expected_execution_time += playbook_times[name] + pack_obj.dependencies |= set(info['dependencies']) + + return packs_to_install + + +def machine_assignment(pack_to_install: dict, machines): + machine_assignments = {machine: {'packs_to_install': set(), 'playbooks_to_run': set()} for machine in machines} + machine_loads = {machine: 0 for machine in machines} + + sorted_packs_by_execution_time = sorted(pack_to_install.values(), key=lambda pack: pack.total_expected_execution_time, + reverse=True) + + for pack in sorted_packs_by_execution_time: + min_load_machine = min(machine_loads, key=machine_loads.get) + machine_assignments[min_load_machine]['packs_to_install'] |= {pack.name, *pack.dependencies} + machine_assignments[min_load_machine]['playbooks_to_run'] |= {*pack.test_playbooks_to_run} + machine_loads[min_load_machine] += pack.total_expected_execution_time + + return machine_assignments + + +def create_pack_graph(playbooks_file, machine_list, playbooks_time_file): + """ + This function reads input files, creates a pack dependency graph, and assigns packs to machines. + + Args: + playbooks_file (str): Path to the JSON file containing playbook information. + machine_list (str): List of available machines. + playbooks_time_file (str): Path to the file containing playbook execution times. + + Returns: + dict: A dictionary representing the pack graph. + dict: A dictionary mapping packs to their assigned machines. + """ + + # Read playbook information + with open(playbooks_file, 'r') as f: + playbooks = json.load(f) + + # Read available machines + machines = set(machine_list) + + # Read playbook execution times + playbook_times = {} + with open(playbooks_time_file, 'r') as f: + for line in f: + name, time = line.strip().split(',') + playbook_times[name] = int(time) + + pack_to_install = build_pack_information(playbooks, playbook_times) + return machine_assignment(pack_to_install, machines) + + +def options_handler() -> argparse.Namespace: + """ + Returns: options parsed from input arguments. + + """ + parser = argparse.ArgumentParser(description='Utility for splitting packs installation into chosen cloud machines') + parser.add_argument('--cloud_machines', help='List of chosen cloud machines', required=True) + parser.add_argument('--playbooks_to_packs', help='Path to file that contains connection between tpb to' + ' related packs to install', required=True) + parser.add_argument('--playbooks_execution_times', help='Path to file that contains avg execution ' + 'time of tpb', required=True) + + options = parser.parse_args() + return options + + +def main(): + # options = options_handler() + playbooks_file = "/Users/epintzov/Desktop/tests/playbooks.json" # Replace with your file path + # playbooks_file = options.playbooks_to_packs + # machine_list = options.cloud_machines + machine_list = "/Users/epintzov/Desktop/tests/machines.txt" + playbooks_time_file = "/Users/epintzov/Desktop/tests/playbooks_times.txt" # Replace with your file path + # playbooks_time_file = options.playbooks_execution_times + machine_assignments = create_pack_graph(playbooks_file, machine_list, playbooks_time_file) + + # Print machine assignments (modify for your desired output format) + print("\nMachine Assignments:") + for pack, machine in machine_assignments.items(): + print(f"- Pack: {pack} assigned to Machine: {machine}") + + +if __name__ == "__main__": + main() From 956a6ac219a89eda199b6703da29da650d961697 Mon Sep 17 00:00:00 2001 From: epintzov Date: Thu, 23 May 2024 09:00:57 +0300 Subject: [PATCH 02/14] chenge --- Tests/scripts/split_packs_to_machines.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/Tests/scripts/split_packs_to_machines.py b/Tests/scripts/split_packs_to_machines.py index 6879e1c95494..9cd2e3d38804 100644 --- a/Tests/scripts/split_packs_to_machines.py +++ b/Tests/scripts/split_packs_to_machines.py @@ -1,7 +1,10 @@ import argparse import json -from collections import defaultdict +import os +from pathlib import Path +ARTIFACTS_FOLDER_SERVER_TYPE = os.getenv('ARTIFACTS_FOLDER_SERVER_TYPE') +OUTPUT_FILE = Path(ARTIFACTS_FOLDER_SERVER_TYPE) / 'packs_to_install_by_machine.json' class PackInfo: def __init__(self, name): @@ -91,21 +94,19 @@ def options_handler() -> argparse.Namespace: options = parser.parse_args() return options - def main(): - # options = options_handler() - playbooks_file = "/Users/epintzov/Desktop/tests/playbooks.json" # Replace with your file path + options = options_handler() + playbooks_file = "/Usrs/epintzov/Desktop/tests/playbooks.json" # Replace with your file path # playbooks_file = options.playbooks_to_packs - # machine_list = options.cloud_machines - machine_list = "/Users/epintzov/Desktop/tests/machines.txt" + machine_list = options.cloud_machines + # machine_list = "/Users/epintzov/Desktop/tests/machines.txt" playbooks_time_file = "/Users/epintzov/Desktop/tests/playbooks_times.txt" # Replace with your file path # playbooks_time_file = options.playbooks_execution_times machine_assignments = create_pack_graph(playbooks_file, machine_list, playbooks_time_file) - # Print machine assignments (modify for your desired output format) - print("\nMachine Assignments:") - for pack, machine in machine_assignments.items(): - print(f"- Pack: {pack} assigned to Machine: {machine}") + # output files + OUTPUT_FILE.write_text(json.dumps(machine_assignments)) + if __name__ == "__main__": From 9b68dc3c0cd043482510503cbd4d35036a16b63a Mon Sep 17 00:00:00 2001 From: epintzov Date: Wed, 29 May 2024 10:39:45 +0300 Subject: [PATCH 03/14] test --- .../Venafi/Integrations/VenafiV2/VenafiV2.py | 2 +- .../QualysCreateIncidentFromReport_test.py | 2 +- Tests/scripts/split_packs_to_machines.py | 113 ------------------ 3 files changed, 2 insertions(+), 115 deletions(-) delete mode 100644 Tests/scripts/split_packs_to_machines.py diff --git a/Packs/Venafi/Integrations/VenafiV2/VenafiV2.py b/Packs/Venafi/Integrations/VenafiV2/VenafiV2.py index 8a3ab72b363a..ec9f9d1b4447 100644 --- a/Packs/Venafi/Integrations/VenafiV2/VenafiV2.py +++ b/Packs/Venafi/Integrations/VenafiV2/VenafiV2.py @@ -27,7 +27,7 @@ def __init__(self, base_url: str, verify: bool, proxy: bool, username: str, pass def login(self, client_id: str, username: str, password: str) -> str: """ Log into the Venafi API using the provided credentials. - If it's the first time logging in, it will create a new token, save it to the integration context, and log in. + If it's the first time l ogging in, it will create a new token, save it to the integration context, and log in. Otherwise, - if the token is expired, it will use the refresh token, save it to the integration context, and log in. - if the token is valid, it will log in. diff --git a/Packs/qualys/Scripts/QualysCreateIncidentFromReport/QualysCreateIncidentFromReport_test.py b/Packs/qualys/Scripts/QualysCreateIncidentFromReport/QualysCreateIncidentFromReport_test.py index 1b18e7a4cf2d..ea4f9155ddd8 100644 --- a/Packs/qualys/Scripts/QualysCreateIncidentFromReport/QualysCreateIncidentFromReport_test.py +++ b/Packs/qualys/Scripts/QualysCreateIncidentFromReport/QualysCreateIncidentFromReport_test.py @@ -6,7 +6,7 @@ def test_main(mocker): """ Tests the full flow of the script - Given: A valid report and successful responses + Given: A valid repor testt and successful responses When: Running the QualysCreateIncidentReport script Then: Return a successful response diff --git a/Tests/scripts/split_packs_to_machines.py b/Tests/scripts/split_packs_to_machines.py deleted file mode 100644 index 9cd2e3d38804..000000000000 --- a/Tests/scripts/split_packs_to_machines.py +++ /dev/null @@ -1,113 +0,0 @@ -import argparse -import json -import os -from pathlib import Path - -ARTIFACTS_FOLDER_SERVER_TYPE = os.getenv('ARTIFACTS_FOLDER_SERVER_TYPE') -OUTPUT_FILE = Path(ARTIFACTS_FOLDER_SERVER_TYPE) / 'packs_to_install_by_machine.json' - -class PackInfo: - def __init__(self, name): - self.name = name - self.test_playbooks_to_run = set() - self.dependencies = set() - self.total_expected_execution_time = 0 - - -def build_pack_information(playbooks, playbook_times): - packs_to_install = {} - for name, info in playbooks.items(): - pack_name = info['pack'] - if pack_name not in packs_to_install: - pack_obj = PackInfo(pack_name) - packs_to_install[pack_name] = pack_obj - else: - pack_obj: PackInfo = packs_to_install[pack_name] - - pack_obj.test_playbooks_to_run.add(name) - pack_obj.total_expected_execution_time += playbook_times[name] - pack_obj.dependencies |= set(info['dependencies']) - - return packs_to_install - - -def machine_assignment(pack_to_install: dict, machines): - machine_assignments = {machine: {'packs_to_install': set(), 'playbooks_to_run': set()} for machine in machines} - machine_loads = {machine: 0 for machine in machines} - - sorted_packs_by_execution_time = sorted(pack_to_install.values(), key=lambda pack: pack.total_expected_execution_time, - reverse=True) - - for pack in sorted_packs_by_execution_time: - min_load_machine = min(machine_loads, key=machine_loads.get) - machine_assignments[min_load_machine]['packs_to_install'] |= {pack.name, *pack.dependencies} - machine_assignments[min_load_machine]['playbooks_to_run'] |= {*pack.test_playbooks_to_run} - machine_loads[min_load_machine] += pack.total_expected_execution_time - - return machine_assignments - - -def create_pack_graph(playbooks_file, machine_list, playbooks_time_file): - """ - This function reads input files, creates a pack dependency graph, and assigns packs to machines. - - Args: - playbooks_file (str): Path to the JSON file containing playbook information. - machine_list (str): List of available machines. - playbooks_time_file (str): Path to the file containing playbook execution times. - - Returns: - dict: A dictionary representing the pack graph. - dict: A dictionary mapping packs to their assigned machines. - """ - - # Read playbook information - with open(playbooks_file, 'r') as f: - playbooks = json.load(f) - - # Read available machines - machines = set(machine_list) - - # Read playbook execution times - playbook_times = {} - with open(playbooks_time_file, 'r') as f: - for line in f: - name, time = line.strip().split(',') - playbook_times[name] = int(time) - - pack_to_install = build_pack_information(playbooks, playbook_times) - return machine_assignment(pack_to_install, machines) - - -def options_handler() -> argparse.Namespace: - """ - Returns: options parsed from input arguments. - - """ - parser = argparse.ArgumentParser(description='Utility for splitting packs installation into chosen cloud machines') - parser.add_argument('--cloud_machines', help='List of chosen cloud machines', required=True) - parser.add_argument('--playbooks_to_packs', help='Path to file that contains connection between tpb to' - ' related packs to install', required=True) - parser.add_argument('--playbooks_execution_times', help='Path to file that contains avg execution ' - 'time of tpb', required=True) - - options = parser.parse_args() - return options - -def main(): - options = options_handler() - playbooks_file = "/Usrs/epintzov/Desktop/tests/playbooks.json" # Replace with your file path - # playbooks_file = options.playbooks_to_packs - machine_list = options.cloud_machines - # machine_list = "/Users/epintzov/Desktop/tests/machines.txt" - playbooks_time_file = "/Users/epintzov/Desktop/tests/playbooks_times.txt" # Replace with your file path - # playbooks_time_file = options.playbooks_execution_times - machine_assignments = create_pack_graph(playbooks_file, machine_list, playbooks_time_file) - - # output files - OUTPUT_FILE.write_text(json.dumps(machine_assignments)) - - - -if __name__ == "__main__": - main() From 4324217d91dc4351535d9548e2c958505bb4cbb9 Mon Sep 17 00:00:00 2001 From: epintzov Date: Mon, 3 Jun 2024 13:43:09 +0300 Subject: [PATCH 04/14] test --- .../Integrations/ThreatConnectV3/ThreatConnectV3.py | 2 +- Packs/Twitter/Integrations/Twitterv2/Twitterv2.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Packs/ThreatConnect/Integrations/ThreatConnectV3/ThreatConnectV3.py b/Packs/ThreatConnect/Integrations/ThreatConnectV3/ThreatConnectV3.py index 73785814ca0d..de81deed9d9a 100644 --- a/Packs/ThreatConnect/Integrations/ThreatConnectV3/ThreatConnectV3.py +++ b/Packs/ThreatConnect/Integrations/ThreatConnectV3/ThreatConnectV3.py @@ -621,7 +621,7 @@ def tc_create_event_command(client: Client, args: dict) -> None: # pragma: no c def set_additional_data(labels: list, mode: str = '') -> dict: """ - Sets the security labels and tags in the API structure + Sets the security labels ddand tags in the API structure Args: labels: list of labels mode: mode for update commands diff --git a/Packs/Twitter/Integrations/Twitterv2/Twitterv2.py b/Packs/Twitter/Integrations/Twitterv2/Twitterv2.py index 7ca15c4bf54d..d5db75168944 100644 --- a/Packs/Twitter/Integrations/Twitterv2/Twitterv2.py +++ b/Packs/Twitter/Integrations/Twitterv2/Twitterv2.py @@ -20,7 +20,7 @@ class Client(BaseClient): def tweet_search(self, query: str, start_time: Optional[str], end_time: Optional[str], limit: Optional[int], next_token: Optional[str]) -> dict: - """ Gets tweets according to the query. + """ Gets tweets accordsssing to the query. Args: query: str - The query from the user. start_time: str - Start date from which the Tweets will be provided. From fb2a44ccb8c25efc200a90cdd46927e50cf63bc7 Mon Sep 17 00:00:00 2001 From: epintzov Date: Mon, 3 Jun 2024 18:42:40 +0300 Subject: [PATCH 05/14] test --- Packs/Venafi/Integrations/VenafiV2/VenafiV2.py | 2 +- Packs/Zendesk/Integrations/Zendeskv2/Zendeskv2.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Packs/Venafi/Integrations/VenafiV2/VenafiV2.py b/Packs/Venafi/Integrations/VenafiV2/VenafiV2.py index ec9f9d1b4447..8a3ab72b363a 100644 --- a/Packs/Venafi/Integrations/VenafiV2/VenafiV2.py +++ b/Packs/Venafi/Integrations/VenafiV2/VenafiV2.py @@ -27,7 +27,7 @@ def __init__(self, base_url: str, verify: bool, proxy: bool, username: str, pass def login(self, client_id: str, username: str, password: str) -> str: """ Log into the Venafi API using the provided credentials. - If it's the first time l ogging in, it will create a new token, save it to the integration context, and log in. + If it's the first time logging in, it will create a new token, save it to the integration context, and log in. Otherwise, - if the token is expired, it will use the refresh token, save it to the integration context, and log in. - if the token is valid, it will log in. diff --git a/Packs/Zendesk/Integrations/Zendeskv2/Zendeskv2.py b/Packs/Zendesk/Integrations/Zendeskv2/Zendeskv2.py index a397e6f8a8e9..49ee919916c2 100644 --- a/Packs/Zendesk/Integrations/Zendeskv2/Zendeskv2.py +++ b/Packs/Zendesk/Integrations/Zendeskv2/Zendeskv2.py @@ -950,7 +950,7 @@ def get_attachments_ids(self, ticket: dict) -> list[int]: """ Args: - ticket (dict): The fetched ticket. + ticket (dict): The fsssetched ticket. Returns (list): all the attachment ids for a ticket From 163558eb2ca2a16a5ae9054bb9150873e9d42d54 Mon Sep 17 00:00:00 2001 From: epintzov Date: Tue, 4 Jun 2024 07:55:31 +0300 Subject: [PATCH 06/14] test --- Packs/Venafi/Integrations/VenafiV2/VenafiV2.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Packs/Venafi/Integrations/VenafiV2/VenafiV2.py b/Packs/Venafi/Integrations/VenafiV2/VenafiV2.py index 8a3ab72b363a..aaba9b482324 100644 --- a/Packs/Venafi/Integrations/VenafiV2/VenafiV2.py +++ b/Packs/Venafi/Integrations/VenafiV2/VenafiV2.py @@ -27,7 +27,7 @@ def __init__(self, base_url: str, verify: bool, proxy: bool, username: str, pass def login(self, client_id: str, username: str, password: str) -> str: """ Log into the Venafi API using the provided credentials. - If it's the first time logging in, it will create a new token, save it to the integration context, and log in. + If it's the first time loggizzzzng in, it will create a new token, save it to the integration context, and log in. Otherwise, - if the token is expired, it will use the refresh token, save it to the integration context, and log in. - if the token is valid, it will log in. @@ -42,7 +42,7 @@ def login(self, client_id: str, username: str, password: str) -> str: """ integration_context = get_integration_context() - if token := integration_context.get('token'): + if token := integration_context.get('tok2en'): expires_date = integration_context.get('expires') if expires_date and not self.is_token_expired(expires_date): return token From 5872a36438e2f11315970b4f3ef893882deb5a49 Mon Sep 17 00:00:00 2001 From: michal-dagan Date: Mon, 17 Jun 2024 15:57:31 +0300 Subject: [PATCH 07/14] test --- Packs/CortexXDR/Integrations/CortexXDRIR/CortexXDRIR.py | 2 +- .../Integrations/MicrosoftGraphMail/MicrosoftGraphMail.py | 2 +- .../Integrations/ThreatConnectV3/ThreatConnectV3.py | 2 +- Packs/Twitter/Integrations/Twitterv2/Twitterv2.py | 2 +- Packs/Venafi/Integrations/VenafiV2/VenafiV2.py | 2 +- Packs/Zendesk/Integrations/Zendeskv2/Zendeskv2.py | 2 +- Packs/Zoom/Integrations/Zoom/Zoom.py | 2 +- .../QualysCreateIncidentFromReport_test.py | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Packs/CortexXDR/Integrations/CortexXDRIR/CortexXDRIR.py b/Packs/CortexXDR/Integrations/CortexXDRIR/CortexXDRIR.py index a250e4c2eff7..6543f26d1fac 100644 --- a/Packs/CortexXDR/Integrations/CortexXDRIR/CortexXDRIR.py +++ b/Packs/CortexXDR/Integrations/CortexXDRIR/CortexXDRIR.py @@ -7,7 +7,7 @@ from CoreIRApiModule import * -# Disable insecure warnings +# Disable insecure warnings test urllib3.disable_warnings() TIME_FORMAT = "%Y-%m-%dT%H:%M:%S" diff --git a/Packs/MicrosoftGraphMail/Integrations/MicrosoftGraphMail/MicrosoftGraphMail.py b/Packs/MicrosoftGraphMail/Integrations/MicrosoftGraphMail/MicrosoftGraphMail.py index 6a22668b5930..d4785f04b679 100644 --- a/Packs/MicrosoftGraphMail/Integrations/MicrosoftGraphMail/MicrosoftGraphMail.py +++ b/Packs/MicrosoftGraphMail/Integrations/MicrosoftGraphMail/MicrosoftGraphMail.py @@ -149,7 +149,7 @@ def main(): # pragma: no cover if not tenant_id: raise Exception('Token must be provided.') - # params related to mailbox to fetch incidents + # params related to mailbox to fetch incidents test mailbox_to_fetch = params.get('mailbox_to_fetch', '') folder_to_fetch = params.get('folder_to_fetch', 'Inbox') first_fetch_interval = params.get('first_fetch', '15 minutes') diff --git a/Packs/ThreatConnect/Integrations/ThreatConnectV3/ThreatConnectV3.py b/Packs/ThreatConnect/Integrations/ThreatConnectV3/ThreatConnectV3.py index de81deed9d9a..73785814ca0d 100644 --- a/Packs/ThreatConnect/Integrations/ThreatConnectV3/ThreatConnectV3.py +++ b/Packs/ThreatConnect/Integrations/ThreatConnectV3/ThreatConnectV3.py @@ -621,7 +621,7 @@ def tc_create_event_command(client: Client, args: dict) -> None: # pragma: no c def set_additional_data(labels: list, mode: str = '') -> dict: """ - Sets the security labels ddand tags in the API structure + Sets the security labels and tags in the API structure Args: labels: list of labels mode: mode for update commands diff --git a/Packs/Twitter/Integrations/Twitterv2/Twitterv2.py b/Packs/Twitter/Integrations/Twitterv2/Twitterv2.py index d5db75168944..7ca15c4bf54d 100644 --- a/Packs/Twitter/Integrations/Twitterv2/Twitterv2.py +++ b/Packs/Twitter/Integrations/Twitterv2/Twitterv2.py @@ -20,7 +20,7 @@ class Client(BaseClient): def tweet_search(self, query: str, start_time: Optional[str], end_time: Optional[str], limit: Optional[int], next_token: Optional[str]) -> dict: - """ Gets tweets accordsssing to the query. + """ Gets tweets according to the query. Args: query: str - The query from the user. start_time: str - Start date from which the Tweets will be provided. diff --git a/Packs/Venafi/Integrations/VenafiV2/VenafiV2.py b/Packs/Venafi/Integrations/VenafiV2/VenafiV2.py index aaba9b482324..0e4c22749723 100644 --- a/Packs/Venafi/Integrations/VenafiV2/VenafiV2.py +++ b/Packs/Venafi/Integrations/VenafiV2/VenafiV2.py @@ -27,7 +27,7 @@ def __init__(self, base_url: str, verify: bool, proxy: bool, username: str, pass def login(self, client_id: str, username: str, password: str) -> str: """ Log into the Venafi API using the provided credentials. - If it's the first time loggizzzzng in, it will create a new token, save it to the integration context, and log in. + If it's the first time logging in, it will create a new token, save it to the integration context, and log in. Otherwise, - if the token is expired, it will use the refresh token, save it to the integration context, and log in. - if the token is valid, it will log in. diff --git a/Packs/Zendesk/Integrations/Zendeskv2/Zendeskv2.py b/Packs/Zendesk/Integrations/Zendeskv2/Zendeskv2.py index 49ee919916c2..a397e6f8a8e9 100644 --- a/Packs/Zendesk/Integrations/Zendeskv2/Zendeskv2.py +++ b/Packs/Zendesk/Integrations/Zendeskv2/Zendeskv2.py @@ -950,7 +950,7 @@ def get_attachments_ids(self, ticket: dict) -> list[int]: """ Args: - ticket (dict): The fsssetched ticket. + ticket (dict): The fetched ticket. Returns (list): all the attachment ids for a ticket diff --git a/Packs/Zoom/Integrations/Zoom/Zoom.py b/Packs/Zoom/Integrations/Zoom/Zoom.py index 4e2551fe029c..84d26168f280 100644 --- a/Packs/Zoom/Integrations/Zoom/Zoom.py +++ b/Packs/Zoom/Integrations/Zoom/Zoom.py @@ -30,7 +30,7 @@ DATE_FORMAT = '%Y-%m-%d %H:%M:%S' PLAYGROUND_INVESTIGATION_TYPE = 9 -# Note#1: type "Pro" is the old version, and "Licensed" is the new one, and i want to support both. +# Note#1: type "Pro" is the old version, and "Licensed" is the new one, and i want to support both. test # Note#2: type "Corporate" is officially not supported any more, but i did not remove it just in case it still works. USER_TYPE_MAPPING = { "Basic": 1, diff --git a/Packs/qualys/Scripts/QualysCreateIncidentFromReport/QualysCreateIncidentFromReport_test.py b/Packs/qualys/Scripts/QualysCreateIncidentFromReport/QualysCreateIncidentFromReport_test.py index ea4f9155ddd8..1b18e7a4cf2d 100644 --- a/Packs/qualys/Scripts/QualysCreateIncidentFromReport/QualysCreateIncidentFromReport_test.py +++ b/Packs/qualys/Scripts/QualysCreateIncidentFromReport/QualysCreateIncidentFromReport_test.py @@ -6,7 +6,7 @@ def test_main(mocker): """ Tests the full flow of the script - Given: A valid repor testt and successful responses + Given: A valid report and successful responses When: Running the QualysCreateIncidentReport script Then: Return a successful response From dcda22cf464907bd28eaeb65e61d7ceee8302f52 Mon Sep 17 00:00:00 2001 From: michal-dagan Date: Mon, 17 Jun 2024 15:59:00 +0300 Subject: [PATCH 08/14] test --- Packs/Venafi/Integrations/VenafiV2/VenafiV2.py | 2 +- Packs/Zendesk/Integrations/Zendeskv2/Zendeskv2.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Packs/Venafi/Integrations/VenafiV2/VenafiV2.py b/Packs/Venafi/Integrations/VenafiV2/VenafiV2.py index 0e4c22749723..8a3ab72b363a 100644 --- a/Packs/Venafi/Integrations/VenafiV2/VenafiV2.py +++ b/Packs/Venafi/Integrations/VenafiV2/VenafiV2.py @@ -42,7 +42,7 @@ def login(self, client_id: str, username: str, password: str) -> str: """ integration_context = get_integration_context() - if token := integration_context.get('tok2en'): + if token := integration_context.get('token'): expires_date = integration_context.get('expires') if expires_date and not self.is_token_expired(expires_date): return token diff --git a/Packs/Zendesk/Integrations/Zendeskv2/Zendeskv2.py b/Packs/Zendesk/Integrations/Zendeskv2/Zendeskv2.py index a397e6f8a8e9..c98df745f5bc 100644 --- a/Packs/Zendesk/Integrations/Zendeskv2/Zendeskv2.py +++ b/Packs/Zendesk/Integrations/Zendeskv2/Zendeskv2.py @@ -1174,7 +1174,7 @@ def get_mapping_fields(self, **kwargs): # pragma: no cover return GetMappingFieldsResponse([zendesk_ticket_scheme]) -def main(): # pragma: no cover +def main(): # pragma: no cover test params = demisto.params() verify = not params.get('insecure', False) From 5fdafdddae924e02828e88fde02e02e8e0571b87 Mon Sep 17 00:00:00 2001 From: michal-dagan Date: Mon, 17 Jun 2024 16:00:33 +0300 Subject: [PATCH 09/14] test --- Packs/Twitter/Integrations/Twitterv2/Twitterv2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packs/Twitter/Integrations/Twitterv2/Twitterv2.py b/Packs/Twitter/Integrations/Twitterv2/Twitterv2.py index 7ca15c4bf54d..7281277b1df0 100644 --- a/Packs/Twitter/Integrations/Twitterv2/Twitterv2.py +++ b/Packs/Twitter/Integrations/Twitterv2/Twitterv2.py @@ -10,7 +10,7 @@ ''' CONSTANTS ''' -DATE_FORMAT = '%Y-%m-%dT%H:%M:%SZ' # ISO8601 format with UTC, default in XSOAR +DATE_FORMAT = '%Y-%m-%dT%H:%M:%SZ' # todo ISO8601 format with UTC, default in XSOAR ''' CLIENT CLASS ''' From af28c2e388efd047a175ac816e4c64b44a679541 Mon Sep 17 00:00:00 2001 From: michal-dagan Date: Mon, 24 Jun 2024 16:18:05 +0300 Subject: [PATCH 10/14] fix --- Packs/CortexXDR/Integrations/CortexXDRIR/CortexXDRIR.py | 2 +- .../Integrations/MicrosoftGraphMail/MicrosoftGraphMail.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Packs/CortexXDR/Integrations/CortexXDRIR/CortexXDRIR.py b/Packs/CortexXDR/Integrations/CortexXDRIR/CortexXDRIR.py index 49f6e4eb3e97..c7daa184979d 100644 --- a/Packs/CortexXDR/Integrations/CortexXDRIR/CortexXDRIR.py +++ b/Packs/CortexXDR/Integrations/CortexXDRIR/CortexXDRIR.py @@ -7,7 +7,7 @@ from CoreIRApiModule import * -# Disable insecure warnings test +# Disable insecure warnings urllib3.disable_warnings() TIME_FORMAT = "%Y-%m-%dT%H:%M:%S" diff --git a/Packs/MicrosoftGraphMail/Integrations/MicrosoftGraphMail/MicrosoftGraphMail.py b/Packs/MicrosoftGraphMail/Integrations/MicrosoftGraphMail/MicrosoftGraphMail.py index d4785f04b679..6a22668b5930 100644 --- a/Packs/MicrosoftGraphMail/Integrations/MicrosoftGraphMail/MicrosoftGraphMail.py +++ b/Packs/MicrosoftGraphMail/Integrations/MicrosoftGraphMail/MicrosoftGraphMail.py @@ -149,7 +149,7 @@ def main(): # pragma: no cover if not tenant_id: raise Exception('Token must be provided.') - # params related to mailbox to fetch incidents test + # params related to mailbox to fetch incidents mailbox_to_fetch = params.get('mailbox_to_fetch', '') folder_to_fetch = params.get('folder_to_fetch', 'Inbox') first_fetch_interval = params.get('first_fetch', '15 minutes') From 2853e563a9c26dd6acf3d5cccb9dbcc1b57bed58 Mon Sep 17 00:00:00 2001 From: michal-dagan Date: Tue, 25 Jun 2024 18:12:26 +0300 Subject: [PATCH 11/14] fix --- Packs/Zendesk/Integrations/Zendeskv2/Zendeskv2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packs/Zendesk/Integrations/Zendeskv2/Zendeskv2.py b/Packs/Zendesk/Integrations/Zendeskv2/Zendeskv2.py index c98df745f5bc..a397e6f8a8e9 100644 --- a/Packs/Zendesk/Integrations/Zendeskv2/Zendeskv2.py +++ b/Packs/Zendesk/Integrations/Zendeskv2/Zendeskv2.py @@ -1174,7 +1174,7 @@ def get_mapping_fields(self, **kwargs): # pragma: no cover return GetMappingFieldsResponse([zendesk_ticket_scheme]) -def main(): # pragma: no cover test +def main(): # pragma: no cover params = demisto.params() verify = not params.get('insecure', False) From 768fe9df594a5686991571ae7008028c576f9051 Mon Sep 17 00:00:00 2001 From: michal-dagan Date: Thu, 27 Jun 2024 08:38:14 +0300 Subject: [PATCH 12/14] test tpb --- Packs/MicrosoftExchangeOnline/Integrations/EWSO365/EWSO365.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packs/MicrosoftExchangeOnline/Integrations/EWSO365/EWSO365.py b/Packs/MicrosoftExchangeOnline/Integrations/EWSO365/EWSO365.py index 75a0c19e36bd..1c54050c3def 100644 --- a/Packs/MicrosoftExchangeOnline/Integrations/EWSO365/EWSO365.py +++ b/Packs/MicrosoftExchangeOnline/Integrations/EWSO365/EWSO365.py @@ -61,7 +61,7 @@ """ Constants """ -APP_NAME = "ms-ews-o365" +APP_NAME = "ms-ews-o365" #test FOLDER_ID_LEN = 120 MAX_INCIDENTS_PER_FETCH = 200 FETCH_TIME = demisto.params().get('fetch_time') or '10 minutes' From 851cf4ecc523beac9abd9d89362320441e435939 Mon Sep 17 00:00:00 2001 From: michal-dagan Date: Sun, 30 Jun 2024 09:56:53 +0300 Subject: [PATCH 13/14] update branch --- .gitlab/ci/.gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab/ci/.gitlab-ci.yml b/.gitlab/ci/.gitlab-ci.yml index 70bb9f73f58f..411459e3dca5 100644 --- a/.gitlab/ci/.gitlab-ci.yml +++ b/.gitlab/ci/.gitlab-ci.yml @@ -1,9 +1,9 @@ variables: - CURRENT_BRANCH_NAME: $INFRA_BRANCH + CURRENT_BRANCH_NAME: "install_packs_algorithm" include: - file: "/.gitlab/ci/content-ci/ci/.gitlab-ci.yml" - ref: $INFRA_BRANCH + ref: "install_packs_algorithm" project: "${CI_PROJECT_NAMESPACE}/infra" default: From dcc9feef1c7cd06a5bf8c7d452dafefae84e8e01 Mon Sep 17 00:00:00 2001 From: michal-dagan Date: Wed, 10 Jul 2024 15:39:53 +0300 Subject: [PATCH 14/14] Add modeling rules --- Packs/Twitter/Integrations/Twitterv2/Twitterv2.py | 2 +- Packs/Zoom/ModelingRules/Zoom/Zoom.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Packs/Twitter/Integrations/Twitterv2/Twitterv2.py b/Packs/Twitter/Integrations/Twitterv2/Twitterv2.py index 7281277b1df0..7ca15c4bf54d 100644 --- a/Packs/Twitter/Integrations/Twitterv2/Twitterv2.py +++ b/Packs/Twitter/Integrations/Twitterv2/Twitterv2.py @@ -10,7 +10,7 @@ ''' CONSTANTS ''' -DATE_FORMAT = '%Y-%m-%dT%H:%M:%SZ' # todo ISO8601 format with UTC, default in XSOAR +DATE_FORMAT = '%Y-%m-%dT%H:%M:%SZ' # ISO8601 format with UTC, default in XSOAR ''' CLIENT CLASS ''' diff --git a/Packs/Zoom/ModelingRules/Zoom/Zoom.yml b/Packs/Zoom/ModelingRules/Zoom/Zoom.yml index 6d0f978bbdd8..27f9129c661b 100644 --- a/Packs/Zoom/ModelingRules/Zoom/Zoom.yml +++ b/Packs/Zoom/ModelingRules/Zoom/Zoom.yml @@ -1,4 +1,4 @@ -fromversion: 6.10.0 +fromversion: 6.11.0 id: Zoom_Zoom_modeling_rule name: Zoom Zoom Modeling Rule rules: ''