Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LITE-31241 Helpdesk tickets are created for extension owner #31

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading