From 2bb0f3e74f4674e6a4004de1b31358a2d85f3edb Mon Sep 17 00:00:00 2001 From: Kraiem Taha Yassine Date: Wed, 8 Nov 2023 16:44:52 +0100 Subject: [PATCH] Api v1.15.0 (#1629) * fix(chalice): fixed add MSTeams fix(chalice): fixed update MSTeams fix(chalice): fixed add Slack fix(chalice): fixed update Slack * fix(chalice): removed mobs from ios replay --- api/chalicelib/core/collaboration_msteams.py | 2 +- api/chalicelib/core/collaboration_slack.py | 2 +- api/chalicelib/core/sessions_mobs.py | 13 ------------- api/chalicelib/core/sessions_replay.py | 5 ++--- api/env.default | 1 - api/env.dev | 1 - api/routers/core.py | 2 +- api/routers/core_dynamic.py | 2 +- ee/api/Pipfile | 3 ++- ee/api/chalicelib/core/sessions_replay.py | 5 ++--- ee/api/env.default | 1 - ee/api/env.dev | 1 - ee/api/routers/core_dynamic.py | 2 +- 13 files changed, 11 insertions(+), 29 deletions(-) diff --git a/api/chalicelib/core/collaboration_msteams.py b/api/chalicelib/core/collaboration_msteams.py index 3b8b2a05e..d6e7b6c64 100644 --- a/api/chalicelib/core/collaboration_msteams.py +++ b/api/chalicelib/core/collaboration_msteams.py @@ -17,7 +17,7 @@ class MSTeams(BaseCollaboration): raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail=f"name already exists.") if cls.say_hello(data.url): return webhook.add(tenant_id=tenant_id, - endpoint=data.url, + endpoint=data.url.unicode_string(), webhook_type=schemas.WebhookType.msteams, name=data.name) return None diff --git a/api/chalicelib/core/collaboration_slack.py b/api/chalicelib/core/collaboration_slack.py index 707e28c59..f75f3ffd7 100644 --- a/api/chalicelib/core/collaboration_slack.py +++ b/api/chalicelib/core/collaboration_slack.py @@ -17,7 +17,7 @@ class Slack(BaseCollaboration): raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail=f"name already exists.") if cls.say_hello(data.url): return webhook.add(tenant_id=tenant_id, - endpoint=data.url, + endpoint=data.url.unicode_string(), webhook_type=schemas.WebhookType.slack, name=data.name) return None diff --git a/api/chalicelib/core/sessions_mobs.py b/api/chalicelib/core/sessions_mobs.py index cd27d1abd..4fe5f6a3d 100644 --- a/api/chalicelib/core/sessions_mobs.py +++ b/api/chalicelib/core/sessions_mobs.py @@ -54,19 +54,6 @@ def get_urls_depercated(session_id, check_existence: bool = True): return results -def get_ios(session_id, project_id, check_existence=False): - results = [] - for k in __get_mob_keys(project_id=project_id, session_id=session_id): - if check_existence and not StorageClient.exists(bucket=config("IOS_BUCKET"), key=k): - continue - results.append(StorageClient.get_presigned_url_for_sharing( - bucket=config("IOS_BUCKET"), - expires_in=config("PRESIGNED_URL_EXPIRATION", cast=int, default=900), - key=k - )) - return results - - def get_ios_videos(session_id, project_id, check_existence=False): results = [] for k in __get_ios_video_keys(project_id=project_id, session_id=session_id): diff --git a/api/chalicelib/core/sessions_replay.py b/api/chalicelib/core/sessions_replay.py index 0c0922602..694ff57e7 100644 --- a/api/chalicelib/core/sessions_replay.py +++ b/api/chalicelib/core/sessions_replay.py @@ -55,7 +55,7 @@ def get_by_id2_pg(project_id, session_id, context: schemas.CurrentContext, full_ data['crashes'] = events_ios.get_crashes_by_session_id(session_id=session_id) data['userEvents'] = events_ios.get_customs_by_session_id(project_id=project_id, session_id=session_id) - data['mobsUrl'] = sessions_mobs.get_ios(session_id=session_id, project_id=project_id) + data['mobsUrl'] = [] else: data['events'] = events.get_by_session_id(project_id=project_id, session_id=session_id, group_clickrage=True) @@ -122,8 +122,7 @@ def get_replay(project_id, session_id, context: schemas.CurrentContext, full_dat data = helper.dict_to_camel_case(data) if full_data: if data["platform"] == 'ios': - data['domURL'] = sessions_mobs.get_ios(session_id=session_id, project_id=project_id, - check_existence=False) + data['domURL'] = [] data['videoURL'] = sessions_mobs.get_ios_videos(session_id=session_id, project_id=project_id, check_existence=False) else: diff --git a/api/env.default b/api/env.default index 0eb100aed..1d88927f0 100644 --- a/api/env.default +++ b/api/env.default @@ -58,6 +58,5 @@ ASSIST_JWT_SECRET= PYTHONUNBUFFERED=1 REDIS_STRING=redis://redis-master.db.svc.cluster.local:6379 SCH_DELETE_DAYS=30 -IOS_BUCKET=mobs IOS_VIDEO_BUCKET=mobs TZ=UTC \ No newline at end of file diff --git a/api/env.dev b/api/env.dev index eed9fb904..63721c24a 100644 --- a/api/env.dev +++ b/api/env.dev @@ -62,6 +62,5 @@ TZ=UTC docs_url=/docs root_path='' docs_url=/docs -IOS_BUCKET=mobs IOS_VIDEO_BUCKET=mobs SESSION_IOS_VIDEO_PATTERN=%(sessionId)s/replay.mp4 \ No newline at end of file diff --git a/api/routers/core.py b/api/routers/core.py index 3bbc3deb7..3edcb9045 100644 --- a/api/routers/core.py +++ b/api/routers/core.py @@ -825,7 +825,7 @@ def edit_msteams_integration(webhookId: int, data: schemas.EditCollaborationSche "We couldn't send you a test message on your Microsoft Teams channel. Please verify your webhook url."] } return {"data": webhook.update(tenant_id=context.tenant_id, webhook_id=webhookId, - changes={"name": data.name, "endpoint": data.url})} + changes={"name": data.name, "endpoint": data.url.unicode_string()})} @app.delete('/integrations/msteams/{webhookId}', tags=["integrations"]) diff --git a/api/routers/core_dynamic.py b/api/routers/core_dynamic.py index 79b9a6508..3dde4e7d6 100644 --- a/api/routers/core_dynamic.py +++ b/api/routers/core_dynamic.py @@ -147,7 +147,7 @@ def edit_slack_integration(integrationId: int, data: schemas.EditCollaborationSc "We couldn't send you a test message on your Slack channel. Please verify your webhook url."] } return {"data": webhook.update(tenant_id=context.tenant_id, webhook_id=integrationId, - changes={"name": data.name, "endpoint": data.url})} + changes={"name": data.name, "endpoint": data.url.unicode_string()})} @app.post('/client/members', tags=["client"], dependencies=[OR_role("owner", "admin")]) diff --git a/ee/api/Pipfile b/ee/api/Pipfile index 997fcd03c..1342801c7 100644 --- a/ee/api/Pipfile +++ b/ee/api/Pipfile @@ -17,10 +17,11 @@ python-decouple = "==3.8" apscheduler = "==3.10.4" python-multipart = "==0.0.6" redis = "==5.0.1" -azure-storage-blob = "==12.18.3" uvicorn = {extras = ["standard"], version = "==0.23.2"} pydantic = {extras = ["email"], version = "==2.3.0"} clickhouse-driver = {extras = ["lz4"], version = "==0.2.6"} +python3-saml = "==1.16.0" +azure-storage-blob = "==12.18.3" [dev-packages] diff --git a/ee/api/chalicelib/core/sessions_replay.py b/ee/api/chalicelib/core/sessions_replay.py index b29a0bada..8015f5995 100644 --- a/ee/api/chalicelib/core/sessions_replay.py +++ b/ee/api/chalicelib/core/sessions_replay.py @@ -59,7 +59,7 @@ def get_by_id2_pg(project_id, session_id, context: schemas.CurrentContext, full_ data['crashes'] = events_ios.get_crashes_by_session_id(session_id=session_id) data['userEvents'] = events_ios.get_customs_by_sessionId(project_id=project_id, session_id=session_id) - data['mobsUrl'] = sessions_mobs.get_ios(session_id=session_id) + data['mobsUrl'] = [] else: data['events'] = events.get_by_session_id(project_id=project_id, session_id=session_id, group_clickrage=True) @@ -130,8 +130,7 @@ def get_replay(project_id, session_id, context: schemas.CurrentContext, full_dat data = helper.dict_to_camel_case(data) if full_data: if data["platform"] == 'ios': - data['mobsUrl'] = sessions_mobs.get_ios(session_id=session_id, project_id=project_id, - check_existence=False) + data['mobsUrl'] = [] data['videoURL'] = sessions_mobs.get_ios_videos(session_id=session_id, project_id=project_id, check_existence=False) else: diff --git a/ee/api/env.default b/ee/api/env.default index df17d2f0c..bf7b6fee7 100644 --- a/ee/api/env.default +++ b/ee/api/env.default @@ -78,5 +78,4 @@ KAFKA_USE_SSL=false SCH_DELETE_DAYS=30 TZ=UTC CH_COMPRESSION=true -IOS_BUCKET=mobs IOS_VIDEO_BUCKET=mobs \ No newline at end of file diff --git a/ee/api/env.dev b/ee/api/env.dev index c2bb06ce2..1aa609137 100644 --- a/ee/api/env.dev +++ b/ee/api/env.dev @@ -79,6 +79,5 @@ TZ=UTC docs_url=/docs root_path='' docs_url=/docs -IOS_BUCKET=mobs IOS_VIDEO_BUCKET=mobs SESSION_IOS_VIDEO_PATTERN=%(sessionId)s/replay.mp4 \ No newline at end of file diff --git a/ee/api/routers/core_dynamic.py b/ee/api/routers/core_dynamic.py index 494ce8b31..9af7dd964 100644 --- a/ee/api/routers/core_dynamic.py +++ b/ee/api/routers/core_dynamic.py @@ -153,7 +153,7 @@ def edit_slack_integration(integrationId: int, data: schemas.EditCollaborationSc "We couldn't send you a test message on your Slack channel. Please verify your webhook url."] } return {"data": webhook.update(tenant_id=context.tenant_id, webhook_id=integrationId, - changes={"name": data.name, "endpoint": data.url})} + changes={"name": data.name, "endpoint": data.url.unicode_string()})} @app.post('/client/members', tags=["client"], dependencies=[OR_role("owner", "admin")])