Skip to content
Closed
14 changes: 7 additions & 7 deletions .github/workflows/update-geolite-database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
branch:
description: "Target branch against which to create PR"
required: false
default: "master"
default: "release-ulmo"

env:
MAXMIND_URL: "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country&license_key=${{ secrets.MAXMIND_LICENSE_KEY }}&suffix=tar.gz"
Expand Down Expand Up @@ -70,22 +70,22 @@ jobs:
id: create-pr
run: |
BRANCH="${{ github.actor }}/geoip2-bot-update-country-database-$(echo "${{ github.sha }}" | cut -c 1-7)"
git checkout -b $BRANCH
git checkout -b "$BRANCH"
git add .
git status
git commit -m "chore: geoip2: update maxmind geolite country database"
git push --set-upstream origin $BRANCH
git push --set-upstream origin "$BRANCH"
PR_URL=$(gh pr create \
--title "Update GeoLite Database" \
--body "PR generated by workflow `${{ github.workflow }}` on behalf of @${{ github.actor }}." \
--head $BRANCH \
--base 'master' \
--reviewer 'feanil' \
--head "$BRANCH" \
--base 'release-ulmo' \
--reviewer 'edx/orbi-bom' \
| grep -o 'https://github.com/.*/pull/[0-9]*')
echo "PR Created: ${PR_URL}"
echo "pull-request-url=$PR_URL" >> $GITHUB_OUTPUT
env:
GH_TOKEN: ${{ github.token }}
GH_TOKEN: ${{ secrets.GH_PAT_WITH_ORG }}

- name: Job summary
run: |
Expand Down
Binary file modified common/static/data/geoip/GeoLite2-Country.mmdb
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from consent.models import DataSharingConsent
from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user
from django.contrib.sites.models import Site
from django.conf import settings
from django.core import mail
from django.core.cache import cache
from django.test import TestCase
Expand All @@ -21,7 +22,6 @@
EnterpriseCustomerUser,
PendingEnterpriseCustomerUser
)
from integrated_channels.sap_success_factors.models import SapSuccessFactorsLearnerDataTransmissionAudit
from opaque_keys.edx.keys import CourseKey
from rest_framework import status
from social_django.models import UserSocialAuth
Expand Down Expand Up @@ -87,6 +87,12 @@
setup_retirement_states
)

# This is a temporary import path while we transition from integrated_channels to channel_integrations
if getattr(settings, 'ENABLE_LEGACY_INTEGRATED_CHANNELS', True):
from integrated_channels.sap_success_factors.models import SapSuccessFactorsLearnerDataTransmissionAudit
else:
from channel_integrations.sap_success_factors.models import SapSuccessFactorsLearnerDataTransmissionAudit


def build_jwt_headers(user):
"""
Expand Down
11 changes: 9 additions & 2 deletions openedx/core/djangoapps/user_api/accounts/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
from edx_rest_framework_extensions.auth.jwt.authentication import JwtAuthentication
from edx_rest_framework_extensions.auth.session.authentication import SessionAuthenticationAllowInactiveUser
from enterprise.models import EnterpriseCourseEnrollment, EnterpriseCustomerUser, PendingEnterpriseCustomerUser
from integrated_channels.degreed.models import DegreedLearnerDataTransmissionAudit
from integrated_channels.sap_success_factors.models import SapSuccessFactorsLearnerDataTransmissionAudit
from rest_framework import permissions, status
from rest_framework.authentication import SessionAuthentication
from rest_framework.exceptions import UnsupportedMediaType
Expand Down Expand Up @@ -97,6 +95,15 @@
from .signals import USER_RETIRE_LMS_CRITICAL, USER_RETIRE_LMS_MISC, USER_RETIRE_MAILINGS
from .utils import create_retirement_request_and_deactivate_account, username_suffix_generator

# This is a temporary import path while we transition from integrated_channels to channel_integrations
if getattr(settings, 'ENABLE_LEGACY_INTEGRATED_CHANNELS', True):
from integrated_channels.degreed.models import DegreedLearnerDataTransmissionAudit
from integrated_channels.sap_success_factors.models import SapSuccessFactorsLearnerDataTransmissionAudit
else:
from channel_integrations.degreed2.models import Degreed2LearnerDataTransmissionAudit \
as DegreedLearnerDataTransmissionAudit
from channel_integrations.sap_success_factors.models import SapSuccessFactorsLearnerDataTransmissionAudit

log = logging.getLogger(__name__)

USER_PROFILE_PII = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@

from consent.models import DataSharingConsent
from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user
from django.conf import settings
from django.core.management.base import BaseCommand
from enterprise.models import (
EnterpriseCourseEnrollment,
EnterpriseCustomer,
EnterpriseCustomerUser,
PendingEnterpriseCustomerUser
)
from integrated_channels.sap_success_factors.models import SapSuccessFactorsLearnerDataTransmissionAudit
from opaque_keys.edx.keys import CourseKey
from pytz import UTC

Expand All @@ -31,6 +31,12 @@

from ...models import UserOrgTag

# This is a temporary import path while we transition from integrated_channels to channel_integrations
if getattr(settings, 'ENABLE_LEGACY_INTEGRATED_CHANNELS', True):
from integrated_channels.sap_success_factors.models import SapSuccessFactorsLearnerDataTransmissionAudit
else:
from channel_integrations.sap_success_factors.models import SapSuccessFactorsLearnerDataTransmissionAudit


class Command(BaseCommand):
"""
Expand Down
16 changes: 12 additions & 4 deletions openedx/features/enterprise_support/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
from django.db.models.signals import post_save, pre_save
from django.dispatch import receiver
from enterprise.models import EnterpriseCourseEnrollment, EnterpriseCustomer
from integrated_channels.integrated_channel.tasks import (
transmit_single_learner_data,
transmit_single_subsection_learner_data
)
from slumber.exceptions import HttpClientError

from common.djangoapps.student.signals import UNENROLL_DONE
Expand All @@ -22,6 +18,18 @@
from openedx.features.enterprise_support.tasks import clear_enterprise_customer_data_consent_share_cache
from openedx.features.enterprise_support.utils import clear_data_consent_share_cache, is_enterprise_learner

# This is a temporary import path while we transition from integrated_channels to channel_integrations
if getattr(settings, 'ENABLE_LEGACY_INTEGRATED_CHANNELS', True):
from integrated_channels.integrated_channel.tasks import (
transmit_single_learner_data,
transmit_single_subsection_learner_data
)
else:
from channel_integrations.integrated_channel.tasks import (
transmit_single_learner_data,
transmit_single_subsection_learner_data
)

log = logging.getLogger(__name__)


Expand Down
9 changes: 7 additions & 2 deletions openedx/features/enterprise_support/tests/test_signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from unittest.mock import patch

import ddt
from django.conf import settings
from django.test.utils import override_settings
from django.utils.timezone import now
from edx_django_utils.cache import TieredCache
Expand Down Expand Up @@ -196,7 +197,9 @@ def test_handle_enterprise_learner_passing_grade(self):
Test to assert transmit_single_learner_data is called when COURSE_GRADE_NOW_PASSED signal is fired
"""
with patch(
'integrated_channels.integrated_channel.tasks.transmit_single_learner_data.apply_async',
'integrated_channels.integrated_channel.tasks.transmit_single_learner_data.apply_async'
if getattr(settings, 'ENABLE_LEGACY_INTEGRATED_CHANNELS', True) else
'channel_integrations.integrated_channel.tasks.transmit_single_learner_data.apply_async',
Comment on lines +200 to +202
Copy link

Copilot AI Nov 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The conditional expression spans multiple lines but is missing proper parentheses for clarity. While Python allows this syntax, wrapping the entire expression in parentheses would improve readability and make it clear that this is a single argument to patch().

Consider reformatting as:

with patch(
    (
        'integrated_channels.integrated_channel.tasks.transmit_single_learner_data.apply_async'
        if getattr(settings, 'ENABLE_LEGACY_INTEGRATED_CHANNELS', True) else
        'channel_integrations.integrated_channel.tasks.transmit_single_learner_data.apply_async'
    ),
    return_value=None
) as mock_task_apply:
Suggested change
'integrated_channels.integrated_channel.tasks.transmit_single_learner_data.apply_async'
if getattr(settings, 'ENABLE_LEGACY_INTEGRATED_CHANNELS', True) else
'channel_integrations.integrated_channel.tasks.transmit_single_learner_data.apply_async',
(
'integrated_channels.integrated_channel.tasks.transmit_single_learner_data.apply_async'
if getattr(settings, 'ENABLE_LEGACY_INTEGRATED_CHANNELS', True) else
'channel_integrations.integrated_channel.tasks.transmit_single_learner_data.apply_async'
),

Copilot uses AI. Check for mistakes.
return_value=None
) as mock_task_apply:
course_key = CourseKey.from_string(self.course_id)
Expand All @@ -218,7 +221,9 @@ def test_handle_enterprise_learner_subsection(self):
Test to assert transmit_subsection_learner_data is called when COURSE_ASSESSMENT_GRADE_CHANGED signal is fired.
"""
with patch(
'integrated_channels.integrated_channel.tasks.transmit_single_subsection_learner_data.apply_async',
'integrated_channels.integrated_channel.tasks.transmit_single_subsection_learner_data.apply_async'
if getattr(settings, 'ENABLE_LEGACY_INTEGRATED_CHANNELS', True) else
'channel_integrations.integrated_channel.tasks.transmit_single_subsection_learner_data.apply_async',
Comment on lines +224 to +226
Copy link

Copilot AI Nov 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The conditional expression spans multiple lines but is missing proper parentheses for clarity. While Python allows this syntax, wrapping the entire expression in parentheses would improve readability and make it clear that this is a single argument to patch().

Consider reformatting as:

with patch(
    (
        'integrated_channels.integrated_channel.tasks.transmit_single_subsection_learner_data.apply_async'
        if getattr(settings, 'ENABLE_LEGACY_INTEGRATED_CHANNELS', True) else
        'channel_integrations.integrated_channel.tasks.transmit_single_subsection_learner_data.apply_async'
    ),
    return_value=None
) as mock_task_apply:

Copilot uses AI. Check for mistakes.
return_value=None
) as mock_task_apply:
course_key = CourseKey.from_string(self.course_id)
Expand Down
Loading