Skip to content

Conversation

@ktyagiapphelix2u
Copy link
Contributor

Description

Removal And Cleanup of temprory rollout toggle ENABLE_SAML_CONFIG_SIGNAL_HANDLERS from signal handlers

Private Ticket Link

https://2u-internal.atlassian.net/browse/BOMS-64

Copy link

@chintanjoshi-apphelix-2u chintanjoshi-apphelix-2u left a comment

Choose a reason for hiding this comment

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

Approved, add related PRs in description.

@ktyagiapphelix2u ktyagiapphelix2u marked this pull request as ready for review November 19, 2025 16:42
Copy link
Contributor

@robrap robrap left a comment

Choose a reason for hiding this comment

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

Thanks.

Comment on lines 67 to 73
# Disconnect signal handlers to prevent automatic provider config updates during test setup
# These tests manually create multiple versions of configs and expect specific counts
signals.post_save.disconnect(
receiver=handlers.update_saml_provider_configs_on_configuration_change,
sender=SAMLConfiguration
)

Copy link
Contributor

Choose a reason for hiding this comment

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

It doesn't make sense to me to disable the signal handler if it would affect things for real. Could we just update counts accordingly?

@ktyagiapphelix2u ktyagiapphelix2u force-pushed the ktyagi/remove-toggle branch 3 times, most recently from 2f31a87 to 20ba3ee Compare November 20, 2025 07:46
Copy link

@chintanjoshi-apphelix-2u chintanjoshi-apphelix-2u left a comment

Choose a reason for hiding this comment

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

Looks good to me, can go for further approvals.

Comment on lines 72 to 81
site__domain='testserver.fake',
site__name='testserver.fake'
site__domain='setup.testserver.fake',
site__name='setup.testserver.fake'
)
self.provider_config = SAMLProviderConfigFactory.create(
site__domain='testserver.fake',
site__name='testserver.fake',
slug='test-shib',
name='TestShib College',
entity_id='https://idp.testshib.org/idp/shibboleth',
metadata_source='https://www.testshib.org/metadata/testshib-providers.xml',
saml_configuration=self.saml_config,
site__domain='setup.testserver.fake',
site__name='setup.testserver.fake',
slug='setup-test-shib',
name='Setup TestShib College',
entity_id='https://idp.testshib.org/idp/setup-shibboleth',
metadata_source='https://www.testshib.org/metadata/setup-testshib-providers.xml',
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you help explain why these changes are needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@robrap Previously, the test setup used names like testserver.fake and test-shib for both the base test data (created in setUp) and for additional test data created in individual test methods. This caused problems because some tests would accidentally interact with or be affected by the base data, leading to confusing or flaky test results.

By changing the setup data to use unique names (like setup.testserver.fake and setup-test-shib), make sure that the base data created for all tests is clearly separated from any test-specific data.

self.__create_saml_configurations__()

expected = "\nDone.\n1 provider(s) found in database.\n0 skipped and 1 attempted.\n1 updated and 0 failed.\n"
expected = "\nDone.\n2 provider(s) found in database.\n1 skipped and 1 attempted.\n1 updated and 0 failed.\n"
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you explain why removal of the toggle results in an additional provider?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now, with the toggle gone, the base setup always creates a provider and configuration (the "setup" provider). When the test method also creates its own providers, the total number of providers in the database increases by one compared to before. That’s why, for example, the expected count changes from 1 to 2 providers in the test output.

Copy link
Contributor

Choose a reason for hiding this comment

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

  • I'm forgetting what "skipped" means and what "attempted" means in this message.
  • I'm still not clear what the base setup creates a provider/configuration now with the toggle gone, but didn't before the toggle was gone. I'm still missing something.

one or more saml configurations are enabled.
"""
# Create enabled configurations
self.__create_saml_configurations__()
Copy link
Contributor

Choose a reason for hiding this comment

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

  • Why does __create_saml_configurations__ use this naming convention? Is it overriding something I am not seeing? If we simply want to indicate it is private, it would be _create_saml_configurations instead (just one underscore as a prefix, and no suffix).
  • Additionally, that method has a typo in its docstring: AMLProviderConfig is missing the leading S.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good Point, I will fix that change Thanks.

self.__create_saml_configurations__()

expected = "\nDone.\n1 provider(s) found in database.\n0 skipped and 1 attempted.\n1 updated and 0 failed.\n"
expected = "\nDone.\n2 provider(s) found in database.\n1 skipped and 1 attempted.\n1 updated and 0 failed.\n"
Copy link
Contributor

Choose a reason for hiding this comment

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

  • I'm forgetting what "skipped" means and what "attempted" means in this message.
  • I'm still not clear what the base setup creates a provider/configuration now with the toggle gone, but didn't before the toggle was gone. I'm still missing something.

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