Skip to content

Commit

Permalink
LITE-31241 Helpdesk tickets are created for extension owner
Browse files Browse the repository at this point in the history
  • Loading branch information
maxipavlovic committed Oct 23, 2024
1 parent 6831924 commit 16457a4
Show file tree
Hide file tree
Showing 6 changed files with 705 additions and 794 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM cloudblueconnect/connect-extension-runner:29.0
FROM cloudblueconnect/connect-extension-runner:33.2

COPY pyproject.toml /install_temp/.
COPY poetry.* /install_temp/.
Expand Down
34 changes: 13 additions & 21 deletions dbaas/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,21 +161,19 @@ async def reconfigure(
updated_events['reconfigured'] = cls._prepare_event(actor)
updates['events'] = updated_events

if not is_admin_context(context):
installation = await ConnectInstallation.retrieve(context.installation_id, client)

description = data.get('details') or '-'
helpdesk_case = await ConnectHelpdeskCase.create_from_db_document(
db_document,
action=data['action'],
description=description,
installation=installation,
client=client,
)
installation = await ConnectInstallation.retrieve(context.installation_id, client)
description = data.get('details') or '-'
helpdesk_case = await ConnectHelpdeskCase.create_from_db_document(
db_document,
action=data['action'],
description=description,
installation=installation,
client=client,
)

cases = updated_db_document.get('cases', [])
cases.append(cls._prepare_helpdesk_case(helpdesk_case))
updates['cases'] = cases
cases = updated_db_document.get('cases', [])
cases.append(cls._prepare_helpdesk_case(helpdesk_case))
updates['cases'] = cases

db_coll = db[cls.COLLECTION]
await db_coll.update_one(
Expand Down Expand Up @@ -412,20 +410,14 @@ async def _create_db_document(
client: AsyncConnectClient,
config: dict,
) -> dict:
is_admin_ctx = is_admin_context(context)
installation = None
if not is_admin_ctx:
installation = await ConnectInstallation.retrieve(context.installation_id, client)
installation = await ConnectInstallation.retrieve(context.installation_id, client)

async with await db.client.start_session() as db_session:
async with db_session.start_transaction():
db_document = await cls._create_db_document_in_db(
db_document, db_session, config, client.logger,
)

if is_admin_ctx:
return db_document

helpdesk_case = await ConnectHelpdeskCase.create_from_db_document(
db_document,
action=DBAction.CREATE,
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ services:
- .dbaas_dev.env

db_ram:
image: mongo:5
image: mongo:7
restart: always
tmpfs:
- /data/db
Expand Down
Loading

0 comments on commit 16457a4

Please sign in to comment.