Skip to content

Commit

Permalink
fix typo and get collabGUID func
Browse files Browse the repository at this point in the history
Signed-off-by: jnathangreeg <[email protected]>
  • Loading branch information
jnathangreeg committed Dec 30, 2024
1 parent 4b4ed1d commit 0c0782e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion infrastructure/backend_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2878,7 +2878,7 @@ def get_runtime_policies_uniquevalues(self, body):
self.customer, r.status_code, r.text))
return r

def laget_integration_status(self, provider: str):
def get_integration_status(self, provider: str):
url = API_INTEGRATIONS + "/connectionV2/status"
r = self.get(url, params={"customerGUID": self.selected_tenant_id, "provider": provider})
assert 200 <= r.status_code < 300, f"{inspect.currentframe().f_code.co_name}, url: '{url}', customer: '{self.customer}' code: {r.status_code}, message: '{r.text}'"
Expand Down
18 changes: 13 additions & 5 deletions tests_scripts/helm/jira_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def start(self):

def setup_jira_config(self):
Logger.logger.info('check jira connection status')
connectionStatus = self.backend.laget_integration_status("jira")
connectionStatus = self.backend.get_integration_status("jira")
assert connectionStatus, "Connection status is empty"
assert len(connectionStatus) == 1, "Got more than one connection status"
jiraStatus = next((status for status in connectionStatus if status['provider'] == 'jira'), None)
Expand Down Expand Up @@ -118,10 +118,18 @@ def get_jira_collaboration_guid(self):
jira_connections = config.get("jiraConnections", [])
if not jira_connections:
raise Exception("No Jira connections found in the response")
collabGUID = jira_connections[0].get("jiraCollabGUID", "")
if not collabGUID:
raise Exception("Jira collaboration GUID is empty or missing")
return collabGUID

for connection in jira_connections:
selected_site = connection.get("selectedSite", {})
if selected_site.get("name") == "cyberarmor-io":
collabGUID = connection.get("jiraCollabGUID", "")
if collabGUID:
return collabGUID
else:
raise Exception("Jira collaboration GUID is empty or missing for site 'cyberarmor-io'")

raise Exception("No Jira collaboration found for site 'cyberarmor-io'")



def setup_cluster_and_run_posture_scan(self):
Expand Down

0 comments on commit 0c0782e

Please sign in to comment.