Skip to content

feat: B2C Subscription Inclusion Flag for Program Algolia Reindex#61

Merged
skumargupta83 merged 1 commit into
masterfrom
SUBS/ENHA-820
Jul 24, 2026
Merged

feat: B2C Subscription Inclusion Flag for Program Algolia Reindex#61
skumargupta83 merged 1 commit into
masterfrom
SUBS/ENHA-820

Conversation

@skumargupta83

Copy link
Copy Markdown

No description provided.

Copilot AI review requested due to automatic review settings July 23, 2026 17:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Algolia proxy model layer to rely on the underlying Program.b2c_subscription_inclusion model field (instead of a custom proxy property) and removes the corresponding Algolia-model tests for programs.

Changes:

  • Removed the AlgoliaProxyProgram.b2c_subscription_inclusion property override in algolia_models.py.
  • Deleted program-focused b2c_subscription_inclusion tests from test_algolia_models.py.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
course_discovery/apps/course_metadata/algolia_models.py Removes the program-level b2c_subscription_inclusion override in the Algolia proxy model implementation.
course_discovery/apps/course_metadata/tests/test_algolia_models.py Removes program b2c_subscription_inclusion tests near the end of the Algolia proxy program test suite.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 754 to 756


class SearchDefaultResultsConfiguration(models.Model):
def b2c_subscription_inclusion(self, value):
self.__dict__['_b2c_subscription_inclusion'] = value


Comment on lines 963 to 965
'translation_languages': [],
'transcription_languages': []
}
Copilot AI review requested due to automatic review settings July 23, 2026 17:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

course_discovery/apps/course_metadata/tests/test_algolia_models.py:964

  • The program-focused b2c_subscription_inclusion tests were removed, leaving no coverage in this module that AlgoliaProxyProgram exposes/persists the flag correctly. Adding at least one focused regression test would help ensure the field continues to be included for program indexing.
    def test_program_ai_languages(self):
        program = AlgoliaProxyProgramFactory(partner=self.__class__.edxPartner)
        assert program.product_ai_languages == {
            'translation_languages': [],
            'transcription_languages': []

Comment on lines 747 to 751
@property
def product_external_url(self):
if hasattr(self, 'degree') and hasattr(self.degree, 'additional_metadata'):
return self.degree.additional_metadata.external_url
else:
Copilot AI review requested due to automatic review settings July 23, 2026 17:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

course_discovery/apps/course_metadata/tests/test_algolia_models.py:965

  • The PR removes all AlgoliaProxyProgram tests covering b2c_subscription_inclusion. Since the Algolia reindex uses the proxy model (not the base Program model), it’s useful to keep at least one proxy-level test to guard against regressions where the proxy accidentally shadows or mis-reads the database-backed field (which wouldn’t be caught by course_metadata/tests/test_models.py’s ProgramFactory tests).
    def test_program_ai_languages(self):
        program = AlgoliaProxyProgramFactory(partner=self.__class__.edxPartner)
        assert program.product_ai_languages == {
            'translation_languages': [],
            'transcription_languages': []
        }

@2usatishkumar 2usatishkumar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approved for testing!

@skumargupta83
skumargupta83 merged commit 003cf55 into master Jul 24, 2026
20 of 21 checks passed
@skumargupta83
skumargupta83 requested a review from rjv31 July 24, 2026 03:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants