-
Notifications
You must be signed in to change notification settings - Fork 4.2k
fix: removal of temporary saml toggle #37651
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
fix: removal of temporary saml toggle #37651
Conversation
9311038 to
1e6958f
Compare
chintanjoshi-apphelix-2u
left a comment
There was a problem hiding this 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.
robrap
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
| # 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 | ||
| ) | ||
|
|
There was a problem hiding this comment.
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?
2f31a87 to
20ba3ee
Compare
20ba3ee to
599fb53
Compare
chintanjoshi-apphelix-2u
left a comment
There was a problem hiding this 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.
| 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', |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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__() |
There was a problem hiding this comment.
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_configurationsinstead (just one underscore as a prefix, and no suffix). - Additionally, that method has a typo in its docstring:
AMLProviderConfigis missing the leadingS.
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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.
…x-platform into ktyagi/remove-toggle
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