From ae54639919938d6de29efd3eb868a530276dac53 Mon Sep 17 00:00:00 2001 From: Taha Yassine Kraiem Date: Fri, 28 Oct 2022 11:41:31 +0200 Subject: [PATCH 1/4] chore(build): build all images in parallel (faster full build) --- scripts/helmcharts/build_deploy_parallel.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/helmcharts/build_deploy_parallel.sh b/scripts/helmcharts/build_deploy_parallel.sh index e6b1fd1df..5b395fa29 100644 --- a/scripts/helmcharts/build_deploy_parallel.sh +++ b/scripts/helmcharts/build_deploy_parallel.sh @@ -14,6 +14,7 @@ echo $DOCKER_REPO exit 1 } || { docker login $DOCKER_REPO + tmux set-option remain-on-exit on tmux split-window "cd ../../backend && IMAGE_TAG=$IMAGE_TAG DOCKER_REPO=$DOCKER_REPO PUSH_IMAGE=1 bash build.sh $@" tmux split-window "cd ../../utilities && IMAGE_TAG=$IMAGE_TAG DOCKER_REPO=$DOCKER_REPO PUSH_IMAGE=1 bash build.sh $@" tmux select-layout tiled From 2d521a11143b20fddc341babaad4688569db439a Mon Sep 17 00:00:00 2001 From: Taha Yassine Kraiem Date: Fri, 28 Oct 2022 15:00:58 +0200 Subject: [PATCH 2/4] chore(build): build all images in parallel (faster full build) --- scripts/helmcharts/build_deploy_parallel.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/helmcharts/build_deploy_parallel.sh b/scripts/helmcharts/build_deploy_parallel.sh index 5b395fa29..6f321e53b 100644 --- a/scripts/helmcharts/build_deploy_parallel.sh +++ b/scripts/helmcharts/build_deploy_parallel.sh @@ -1,6 +1,6 @@ #!/bin/bash set -e - +# Must run inside tmux # This script will build and push docker image to registry # Usage: IMAGE_TAG=latest DOCKER_REPO=rg.fr-par.scw.cloud/foss bash build_deploy.sh From 6b1a93b55bfa8e6a8dc23029f9dc13d7c67f549d Mon Sep 17 00:00:00 2001 From: Taha Yassine Kraiem Date: Fri, 28 Oct 2022 17:08:29 +0200 Subject: [PATCH 3/4] feat(chalice): refactored endpoints --- api/routers/core.py | 2 +- api/routers/core_dynamic.py | 5 ----- ee/api/routers/core_dynamic.py | 9 --------- 3 files changed, 1 insertion(+), 15 deletions(-) diff --git a/api/routers/core.py b/api/routers/core.py index 511e60477..7d4492f38 100644 --- a/api/routers/core.py +++ b/api/routers/core.py @@ -444,7 +444,7 @@ def get_all_assignments(projectId: int, context: schemas.CurrentContext = Depend } -@app.post('/{projectId}/sessions2/{sessionId}/assign/projects/{integrationProjectId}', tags=["assignment"]) +@app.post('/{projectId}/sessions/{sessionId}/assign/projects/{integrationProjectId}', tags=["assignment"]) def create_issue_assignment(projectId: int, sessionId: int, integrationProjectId, data: schemas.AssignmentSchema = Body(...), context: schemas.CurrentContext = Depends(OR_context)): diff --git a/api/routers/core_dynamic.py b/api/routers/core_dynamic.py index 58d29793a..2ac658d73 100644 --- a/api/routers/core_dynamic.py +++ b/api/routers/core_dynamic.py @@ -165,7 +165,6 @@ def get_projects(context: schemas.CurrentContext = Depends(OR_context)): @app.get('/{projectId}/sessions/{sessionId}', tags=["sessions"]) -@app.get('/{projectId}/sessions2/{sessionId}', tags=["sessions"]) def get_session(projectId: int, sessionId: Union[int, str], background_tasks: BackgroundTasks, context: schemas.CurrentContext = Depends(OR_context)): if isinstance(sessionId, str): @@ -183,7 +182,6 @@ def get_session(projectId: int, sessionId: Union[int, str], background_tasks: Ba @app.get('/{projectId}/sessions/{sessionId}/errors/{errorId}/sourcemaps', tags=["sessions", "sourcemaps"]) -@app.get('/{projectId}/sessions2/{sessionId}/errors/{errorId}/sourcemaps', tags=["sessions", "sourcemaps"]) def get_error_trace(projectId: int, sessionId: int, errorId: str, context: schemas.CurrentContext = Depends(OR_context)): data = errors.get_trace(project_id=projectId, error_id=errorId) @@ -323,7 +321,6 @@ def add_remove_favorite_session2(projectId: int, sessionId: int, @app.get('/{projectId}/sessions/{sessionId}/assign', tags=["sessions"]) -@app.get('/{projectId}/sessions2/{sessionId}/assign', tags=["sessions"]) def assign_session(projectId: int, sessionId, context: schemas.CurrentContext = Depends(OR_context)): data = sessions_assignments.get_by_session(project_id=projectId, session_id=sessionId, tenant_id=context.tenant_id, @@ -336,7 +333,6 @@ def assign_session(projectId: int, sessionId, context: schemas.CurrentContext = @app.get('/{projectId}/sessions/{sessionId}/assign/{issueId}', tags=["sessions", "issueTracking"]) -@app.get('/{projectId}/sessions2/{sessionId}/assign/{issueId}', tags=["sessions", "issueTracking"]) def assign_session(projectId: int, sessionId: int, issueId: str, context: schemas.CurrentContext = Depends(OR_context)): data = sessions_assignments.get(project_id=projectId, session_id=sessionId, assignment_id=issueId, @@ -349,7 +345,6 @@ def assign_session(projectId: int, sessionId: int, issueId: str, @app.post('/{projectId}/sessions/{sessionId}/assign/{issueId}/comment', tags=["sessions", "issueTracking"]) -@app.post('/{projectId}/sessions2/{sessionId}/assign/{issueId}/comment', tags=["sessions", "issueTracking"]) def comment_assignment(projectId: int, sessionId: int, issueId: str, data: schemas.CommentAssignmentSchema = Body(...), context: schemas.CurrentContext = Depends(OR_context)): data = sessions_assignments.comment(tenant_id=context.tenant_id, project_id=projectId, diff --git a/ee/api/routers/core_dynamic.py b/ee/api/routers/core_dynamic.py index 047ecaca4..54d940e19 100644 --- a/ee/api/routers/core_dynamic.py +++ b/ee/api/routers/core_dynamic.py @@ -173,7 +173,6 @@ def get_projects(context: schemas.CurrentContext = Depends(OR_context)): @app.get('/{projectId}/sessions/{sessionId}', tags=["sessions"], dependencies=[OR_scope(Permissions.session_replay)]) -@app.get('/{projectId}/sessions2/{sessionId}', tags=["sessions"], dependencies=[OR_scope(Permissions.session_replay)]) def get_session(projectId: int, sessionId: Union[int, str], background_tasks: BackgroundTasks, context: schemas.CurrentContext = Depends(OR_context)): if isinstance(sessionId, str): @@ -192,8 +191,6 @@ def get_session(projectId: int, sessionId: Union[int, str], background_tasks: Ba @app.get('/{projectId}/sessions/{sessionId}/errors/{errorId}/sourcemaps', tags=["sessions", "sourcemaps"], dependencies=[OR_scope(Permissions.session_replay, Permissions.errors)]) -@app.get('/{projectId}/sessions2/{sessionId}/errors/{errorId}/sourcemaps', tags=["sessions", "sourcemaps"], - dependencies=[OR_scope(Permissions.session_replay, Permissions.errors)]) def get_error_trace(projectId: int, sessionId: int, errorId: str, context: schemas.CurrentContext = Depends(OR_context)): data = errors.get_trace(project_id=projectId, error_id=errorId) @@ -337,8 +334,6 @@ def add_remove_favorite_session2(projectId: int, sessionId: int, @app.get('/{projectId}/sessions/{sessionId}/assign', tags=["sessions"], dependencies=[OR_scope(Permissions.session_replay)]) -@app.get('/{projectId}/sessions2/{sessionId}/assign', tags=["sessions"], - dependencies=[OR_scope(Permissions.session_replay)]) def assign_session(projectId: int, sessionId, context: schemas.CurrentContext = Depends(OR_context)): data = sessions_assignments.get_by_session(project_id=projectId, session_id=sessionId, tenant_id=context.tenant_id, @@ -352,8 +347,6 @@ def assign_session(projectId: int, sessionId, context: schemas.CurrentContext = @app.get('/{projectId}/sessions/{sessionId}/assign/{issueId}', tags=["sessions", "issueTracking"], dependencies=[OR_scope(Permissions.session_replay)]) -@app.get('/{projectId}/sessions2/{sessionId}/assign/{issueId}', tags=["sessions", "issueTracking"], - dependencies=[OR_scope(Permissions.session_replay)]) def assign_session(projectId: int, sessionId: int, issueId: str, context: schemas.CurrentContext = Depends(OR_context)): data = sessions_assignments.get(project_id=projectId, session_id=sessionId, assignment_id=issueId, @@ -367,8 +360,6 @@ def assign_session(projectId: int, sessionId: int, issueId: str, @app.post('/{projectId}/sessions/{sessionId}/assign/{issueId}/comment', tags=["sessions", "issueTracking"], dependencies=[OR_scope(Permissions.session_replay)]) -@app.post('/{projectId}/sessions2/{sessionId}/assign/{issueId}/comment', tags=["sessions", "issueTracking"], - dependencies=[OR_scope(Permissions.session_replay)]) def comment_assignment(projectId: int, sessionId: int, issueId: str, data: schemas.CommentAssignmentSchema = Body(...), context: schemas.CurrentContext = Depends(OR_context)): data = sessions_assignments.comment(tenant_id=context.tenant_id, project_id=projectId, From d95597ce8638c2cffc58575e3abfd26c8b031d9e Mon Sep 17 00:00:00 2001 From: Taha Yassine Kraiem Date: Fri, 28 Oct 2022 17:11:25 +0200 Subject: [PATCH 4/4] feat(chalice): debug sourcemaps.pye --- api/chalicelib/core/sourcemaps.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/api/chalicelib/core/sourcemaps.py b/api/chalicelib/core/sourcemaps.py index 31c8d884e..1cf598f01 100644 --- a/api/chalicelib/core/sourcemaps.py +++ b/api/chalicelib/core/sourcemaps.py @@ -148,8 +148,13 @@ MAX_COLUMN_OFFSET = 60 def fetch_missed_contexts(frames): source_cache = {} for i in range(len(frames)): - if len(frames[i]["context"]) > 0: - continue + try: + if len(frames[i]["context"]) > 0: + continue + except Exception: + print(">>>>>>>> fetch_missed_contexts exception:") + print(frames) + print("------------------") file_abs_path = frames[i]["frame"]["absPath"] if file_abs_path in source_cache: file = source_cache[file_abs_path]