From eed3f667ffbde6b5ed16cd49725dc943ee1a008d Mon Sep 17 00:00:00 2001 From: Jillian Vogel Date: Sun, 10 Mar 2024 14:46:26 +1030 Subject: [PATCH 1/6] feat: uses platform-plugin-aspects 0.3.0 and updates variables accordingly --- tutoraspects/patches/openedx-common-settings | 8 +++++--- tutoraspects/patches/openedx-development-settings | 9 ++++----- tutoraspects/plugin.py | 5 ++++- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/tutoraspects/patches/openedx-common-settings b/tutoraspects/patches/openedx-common-settings index da17d3b45..062ac7b04 100644 --- a/tutoraspects/patches/openedx-common-settings +++ b/tutoraspects/patches/openedx-common-settings @@ -7,10 +7,12 @@ EVENT_SINK_CLICKHOUSE_BACKEND_CONFIG = { "timeout_secs": {{ ASPECTS_EVENT_SINK_CLICKHOUSE_TIMEOUT_SECS }} } SUPERSET_CONFIG = { - "service_url": "http://superset:{{ SUPERSET_PORT }}/", - "host": "{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ SUPERSET_HOST }}", + "internal_service_url": "http://superset:{{ SUPERSET_PORT }}/", + "service_url": "{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ SUPERSET_HOST }}", "username": "{{ SUPERSET_LMS_USERNAME }}", "password": "{{ SUPERSET_LMS_PASSWORD }}", - "email": "{{ SUPERSET_LMS_EMAIL }}", } EVENT_SINK_CLICKHOUSE_PII_MODELS = {{ EVENT_SINK_PII_MODELS }} + +ASPECTS_INSTRUCTOR_DASHBOARD_UUID = "{{ ASPECTS_INSTRUCTOR_DASHBOARD_UUID }}" +SUPERSET_EXTRA_FILTERS_FORMAT = {{ ASPECTS_SUPERSET_EXTRA_FILTERS_FORMAT }} diff --git a/tutoraspects/patches/openedx-development-settings b/tutoraspects/patches/openedx-development-settings index beefbc5e6..267a2784d 100644 --- a/tutoraspects/patches/openedx-development-settings +++ b/tutoraspects/patches/openedx-development-settings @@ -1,7 +1,6 @@ SUPERSET_CONFIG = { - "service_url": "http://superset:{{ SUPERSET_PORT }}/", - "host": "{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ SUPERSET_HOST }}:{{ SUPERSET_PORT }}", - "username": "{{ SUPERSET_LMS_USERNAME }}", - "password": "{{ SUPERSET_LMS_PASSWORD }}", - "email": "{{ SUPERSET_LMS_EMAIL }}", + "internal_service_url": "http://superset:{{ SUPERSET_PORT }}/", + "service_url": "{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ SUPERSET_HOST }}:{{ SUPERSET_PORT }}", + "username": "{{ SUPERSET_LMS_USERNAME }}", + "password": "{{ SUPERSET_LMS_PASSWORD }}", } diff --git a/tutoraspects/plugin.py b/tutoraspects/plugin.py index 44ccdfa34..dd55aa624 100644 --- a/tutoraspects/plugin.py +++ b/tutoraspects/plugin.py @@ -41,7 +41,7 @@ ( "OPENEDX_EXTRA_PIP_REQUIREMENTS", [ - "platform-plugin-aspects==0.2.0", + "git+https://github.com/openedx/platform-plugin-aspects.git@jill/migrate-xblock#egg=platform-plugin-aspects==0.3.0", "edx-event-routing-backends==v8.1.1", ], ), @@ -76,6 +76,9 @@ "reference/operator_reports.html)\\n" "* [Superset Resources](https://github.com/apache/superset#resources)\\n", ), + # Use the base Instructor Dashboard uuid by default. TODO use locale + ("ASPECTS_INSTRUCTOR_DASHBOARD_UUID", "1d6bf904-f53f-47fd-b1c9-6cd7e284d286"), + ("ASPECTS_SUPERSET_EXTRA_FILTERS_FORMAT", []), # ClickHouse xAPI settings ("ASPECTS_XAPI_DATABASE", "xapi"), ("ASPECTS_RAW_XAPI_TABLE", "xapi_events_all"), From 082a6c4d8137fc731559c57d864eb687aa93911f Mon Sep 17 00:00:00 2001 From: Jillian Vogel Date: Sun, 10 Mar 2024 14:47:04 +1030 Subject: [PATCH 2/6] feat: adds ASPECTS_ENABLE_INSTRUCTOR_DASHBOARD_PLUGIN which configures the Instructor Dashboard plugin filter when enabled --- tutoraspects/patches/openedx-common-settings | 10 ++++++++++ tutoraspects/plugin.py | 1 + 2 files changed, 11 insertions(+) diff --git a/tutoraspects/patches/openedx-common-settings b/tutoraspects/patches/openedx-common-settings index 062ac7b04..9199977de 100644 --- a/tutoraspects/patches/openedx-common-settings +++ b/tutoraspects/patches/openedx-common-settings @@ -16,3 +16,13 @@ EVENT_SINK_CLICKHOUSE_PII_MODELS = {{ EVENT_SINK_PII_MODELS }} ASPECTS_INSTRUCTOR_DASHBOARD_UUID = "{{ ASPECTS_INSTRUCTOR_DASHBOARD_UUID }}" SUPERSET_EXTRA_FILTERS_FORMAT = {{ ASPECTS_SUPERSET_EXTRA_FILTERS_FORMAT }} +{% if ASPECTS_ENABLE_INSTRUCTOR_DASHBOARD_PLUGIN %} +OPEN_EDX_FILTERS_CONFIG = { + "org.openedx.learning.instructor.dashboard.render.started.v1": { + "fail_silently": False, + "pipeline": [ + "platform_plugin_aspects.extensions.filters.AddSupersetTab", + ] + }, +} +{% endif %} diff --git a/tutoraspects/plugin.py b/tutoraspects/plugin.py index dd55aa624..235580448 100644 --- a/tutoraspects/plugin.py +++ b/tutoraspects/plugin.py @@ -76,6 +76,7 @@ "reference/operator_reports.html)\\n" "* [Superset Resources](https://github.com/apache/superset#resources)\\n", ), + ("ASPECTS_ENABLE_INSTRUCTOR_DASHBOARD_PLUGIN", False), # Use the base Instructor Dashboard uuid by default. TODO use locale ("ASPECTS_INSTRUCTOR_DASHBOARD_UUID", "1d6bf904-f53f-47fd-b1c9-6cd7e284d286"), ("ASPECTS_SUPERSET_EXTRA_FILTERS_FORMAT", []), From 1d8bec16f9c8a6ed2cfc5edb83fd2479bb641720 Mon Sep 17 00:00:00 2001 From: Jillian Vogel Date: Tue, 12 Mar 2024 10:00:18 +1030 Subject: [PATCH 3/6] fix: ASPECTS_ENABLE_INSTRUCTOR_DASHBOARD_PLUGIN config * changed default to True * avoid overwriting existing OPEN_EDX_FILTERS_CONFIG --- tutoraspects/patches/openedx-common-settings | 18 ++++++++++-------- tutoraspects/plugin.py | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/tutoraspects/patches/openedx-common-settings b/tutoraspects/patches/openedx-common-settings index 9199977de..6fecc7997 100644 --- a/tutoraspects/patches/openedx-common-settings +++ b/tutoraspects/patches/openedx-common-settings @@ -17,12 +17,14 @@ EVENT_SINK_CLICKHOUSE_PII_MODELS = {{ EVENT_SINK_PII_MODELS }} ASPECTS_INSTRUCTOR_DASHBOARD_UUID = "{{ ASPECTS_INSTRUCTOR_DASHBOARD_UUID }}" SUPERSET_EXTRA_FILTERS_FORMAT = {{ ASPECTS_SUPERSET_EXTRA_FILTERS_FORMAT }} {% if ASPECTS_ENABLE_INSTRUCTOR_DASHBOARD_PLUGIN %} -OPEN_EDX_FILTERS_CONFIG = { - "org.openedx.learning.instructor.dashboard.render.started.v1": { - "fail_silently": False, - "pipeline": [ - "platform_plugin_aspects.extensions.filters.AddSupersetTab", - ] - }, -} +try: + not OPEN_EDX_FILTERS_CONFIG +except NameError: # OPEN_EDX_FILTERS_CONFIG is not defined + OPEN_EDX_FILTERS_CONFIG = {} +if not OPEN_EDX_FILTERS_CONFIG.get("org.openedx.learning.instructor.dashboard.render.started.v1"): + OPEN_EDX_FILTERS_CONFIG["org.openedx.learning.instructor.dashboard.render.started.v1"] = { + "fail_silently": False, + "pipeline": [], + } +OPEN_EDX_FILTERS_CONFIG["org.openedx.learning.instructor.dashboard.render.started.v1"]["pipeline"].append("platform_plugin_aspects.extensions.filters.AddSupersetTab") {% endif %} diff --git a/tutoraspects/plugin.py b/tutoraspects/plugin.py index 235580448..08793a296 100644 --- a/tutoraspects/plugin.py +++ b/tutoraspects/plugin.py @@ -76,7 +76,7 @@ "reference/operator_reports.html)\\n" "* [Superset Resources](https://github.com/apache/superset#resources)\\n", ), - ("ASPECTS_ENABLE_INSTRUCTOR_DASHBOARD_PLUGIN", False), + ("ASPECTS_ENABLE_INSTRUCTOR_DASHBOARD_PLUGIN", True), # Use the base Instructor Dashboard uuid by default. TODO use locale ("ASPECTS_INSTRUCTOR_DASHBOARD_UUID", "1d6bf904-f53f-47fd-b1c9-6cd7e284d286"), ("ASPECTS_SUPERSET_EXTRA_FILTERS_FORMAT", []), From 7648807c7f5112efa368cb10137d54a42ff605a0 Mon Sep 17 00:00:00 2001 From: Jillian Vogel Date: Tue, 12 Mar 2024 10:04:33 +1030 Subject: [PATCH 4/6] fix: quality --- tutoraspects/plugin.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tutoraspects/plugin.py b/tutoraspects/plugin.py index 08793a296..caaaf097e 100644 --- a/tutoraspects/plugin.py +++ b/tutoraspects/plugin.py @@ -41,7 +41,10 @@ ( "OPENEDX_EXTRA_PIP_REQUIREMENTS", [ - "git+https://github.com/openedx/platform-plugin-aspects.git@jill/migrate-xblock#egg=platform-plugin-aspects==0.3.0", + ( + "git+https://github.com/openedx/platform-plugin-aspects.git@jill/migrate-xblock" + "#egg=platform-plugin-aspects==0.3.0" + ), "edx-event-routing-backends==v8.1.1", ], ), From 9ffd73fe4b3bf138b94fc7972772da44eb0d2efe Mon Sep 17 00:00:00 2001 From: Cristhian Garcia Date: Wed, 13 Mar 2024 14:41:06 -0500 Subject: [PATCH 5/6] chore: install platform-plugin-aspects v0.3.0 --- tutoraspects/plugin.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tutoraspects/plugin.py b/tutoraspects/plugin.py index caaaf097e..85231c588 100644 --- a/tutoraspects/plugin.py +++ b/tutoraspects/plugin.py @@ -41,10 +41,7 @@ ( "OPENEDX_EXTRA_PIP_REQUIREMENTS", [ - ( - "git+https://github.com/openedx/platform-plugin-aspects.git@jill/migrate-xblock" - "#egg=platform-plugin-aspects==0.3.0" - ), + "platform-plugin-aspects==0.3.0", "edx-event-routing-backends==v8.1.1", ], ), From 8bf4076db7cfee7dfb124609381f9f9cdaa91891 Mon Sep 17 00:00:00 2001 From: Cristhian Garcia Date: Wed, 13 Mar 2024 14:50:43 -0500 Subject: [PATCH 6/6] build: don't cache PR images to registry --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index c38d16766..996062308 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -81,7 +81,7 @@ jobs: - name: Build Aspects Docker Images if: github.event.action == 'opened' || github.event.action == 'synchronize' run: | - tutor images build ${{ matrix.service.name }} --cache-to-registry + tutor images build ${{ matrix.service.name }} tutor images push ${{ matrix.service.name }} - name: Build Aspects Docker Images Latest if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'bot/v')