From 3baf62451edb5ebc7fa24729d167d8016a4e7cb3 Mon Sep 17 00:00:00 2001 From: Matias Bordese Date: Thu, 5 Dec 2024 09:51:09 -0300 Subject: [PATCH] WIP --- Makefile | 3 +++ dev/.env.dev.example | 1 + engine/apps/api/tests/test_organization.py | 3 --- engine/settings/base.py | 4 ++-- engine/settings/celery_task_routes.py | 6 +++--- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 9498a0f4ce..40d1e3b3d0 100644 --- a/Makefile +++ b/Makefile @@ -275,6 +275,9 @@ run-backend-server: run-backend-celery: $(call backend_command,python manage.py start_celery) +run-backend-test: + $(call backend_command,pytest --ds=extensions.engine_enterprise.settings.ci_test --reuse-db $(ARGS)) + backend-command: $(call backend_command,$(CMD)) diff --git a/dev/.env.dev.example b/dev/.env.dev.example index da276f8a23..426c2cd46b 100644 --- a/dev/.env.dev.example +++ b/dev/.env.dev.example @@ -18,6 +18,7 @@ MATTERMOST_CLIENT_OAUTH_SECRET= MATTERMOST_HOST= MATTERMOST_BOT_TOKEN= MATTERMOST_LOGIN_RETURN_REDIRECT_HOST=http://localhost:8080 +MATTERMOST_SIGNING_SECRET= DJANGO_SETTINGS_MODULE=settings.dev SECRET_KEY=jyRnfRIeMjYfKdoFa9dKXcNaEGGc8GH1TChmYoWW diff --git a/engine/apps/api/tests/test_organization.py b/engine/apps/api/tests/test_organization.py index 46f7cc6552..f4545cd6b8 100644 --- a/engine/apps/api/tests/test_organization.py +++ b/engine/apps/api/tests/test_organization.py @@ -361,6 +361,3 @@ def test_get_organization_telegram_config_checks( assert response.status_code == status.HTTP_200_OK expected_result["is_integration_chatops_connected"] = True assert response.json() == expected_result - - -# TODO: Add test to validate mattermost is integrated once integration PR changes are made diff --git a/engine/settings/base.py b/engine/settings/base.py index 883501fcd3..c645689737 100644 --- a/engine/settings/base.py +++ b/engine/settings/base.py @@ -311,7 +311,7 @@ class DatabaseTypes: "drf_spectacular", "apps.google", "apps.chatops_proxy", - "apps.mattermost", + # "apps.mattermost", ] if DATABASE_TYPE == DatabaseTypes.MYSQL: @@ -731,7 +731,7 @@ class BrokerTypes: SLACK_INTEGRATION_MAINTENANCE_ENABLED = os.environ.get("SLACK_INTEGRATION_MAINTENANCE_ENABLED", False) # Mattermost -FEATURE_MATTERMOST_INTEGRATION_ENABLED = os.environ.get("FEATURE_MATTERMOST_INTEGRATION_ENABLED", True) +FEATURE_MATTERMOST_INTEGRATION_ENABLED = os.environ.get("FEATURE_MATTERMOST_INTEGRATION_ENABLED", False) MATTERMOST_CLIENT_OAUTH_ID = os.environ.get("MATTERMOST_CLIENT_OAUTH_ID") MATTERMOST_CLIENT_OAUTH_SECRET = os.environ.get("MATTERMOST_CLIENT_OAUTH_SECRET") MATTERMOST_HOST = os.environ.get("MATTERMOST_HOST") diff --git a/engine/settings/celery_task_routes.py b/engine/settings/celery_task_routes.py index 49e6bd1a29..0f2e6e3ed9 100644 --- a/engine/settings/celery_task_routes.py +++ b/engine/settings/celery_task_routes.py @@ -190,7 +190,7 @@ "apps.webhooks.tasks.alert_group_status.alert_group_created": {"queue": "webhook"}, "apps.webhooks.tasks.alert_group_status.alert_group_status_change": {"queue": "webhook"}, # MATTERMOST - "apps.mattermost.tasks.on_create_alert_async": {"queue": "mattermost"}, - "apps.mattermost.tasks.on_alert_group_action_triggered_async": {"queue": "mattermost"}, - "apps.mattermost.tasks.notify_user_about_alert_async": {"queue": "mattermost"}, + # "apps.mattermost.tasks.on_create_alert_async": {"queue": "mattermost"}, + # "apps.mattermost.tasks.on_alert_group_action_triggered_async": {"queue": "mattermost"}, + # "apps.mattermost.tasks.notify_user_about_alert_async": {"queue": "mattermost"}, }