Conversation
fix: fixed tests and quality failures
There was a problem hiding this comment.
Pull Request Overview
This PR contains two distinct sets of changes that appear to have been merged together: workflow configuration updates for the GeoLite database automation, and code changes implementing conditional imports for a package migration from integrated_channels to channel_integrations.
Key Changes:
- Updated GitHub workflow to target
release-ulmobranch instead ofmaster, with improved reviewer configuration and authentication - Implemented conditional import pattern across multiple files to support migration from
integrated_channelstochannel_integrationspackage based onENABLE_LEGACY_INTEGRATED_CHANNELSsetting - Updated test mocks to use the same conditional import pattern for maintaining test compatibility during the migration
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/update-geolite-database.yml |
Updated workflow to target release-ulmo branch, changed reviewer to team, and switched to PAT authentication for org access |
openedx/features/enterprise_support/signals.py |
Added conditional imports to support migration from integrated_channels to channel_integrations |
openedx/features/enterprise_support/tests/test_signals.py |
Updated test mocks to use conditional import paths matching the signal changes |
openedx/core/djangoapps/user_api/accounts/views.py |
Added conditional imports for Degreed and SAP SuccessFactors models with package migration support |
openedx/core/djangoapps/user_api/management/commands/create_user_gdpr_testing.py |
Added conditional import for SAP SuccessFactors models to support package migration |
openedx/core/djangoapps/user_api/accounts/tests/test_retirement_views.py |
Added conditional import for SAP SuccessFactors models in test file to match main code changes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| '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', |
There was a problem hiding this comment.
[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:| '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' | |
| ), |
| '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', |
There was a problem hiding this comment.
[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:
PR generated by workflow on behalf of @ktyagiapphelix2u.