Skip to content
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

fix: toggle report missing settings #337

Merged
merged 1 commit into from
Jan 31, 2024
Merged

Conversation

robrap
Copy link
Contributor

@robrap robrap commented Jan 31, 2024

Description:

Adds missing settings to the toggle report.

Fixes #310

Merge checklist:

  • All reviewers approved
  • CI build is green
  • Version bumped
  • Changelog record added
  • Documentation updated (not only docstrings)
  • Commits are squashed

Post merge:

  • Create a tag
  • Check new version is pushed to PyPi after tag-triggered build is
    finished.
  • Delete working branch (if not needed anymore)

Adds missing settings to the toggle report.

#310
@@ -14,6 +14,11 @@ Change Log
Unreleased
~~~~~~~~~~

[5.1.1] - 2024-01-31
Copy link
Contributor

Choose a reason for hiding this comment

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

Remember to bump the version in code as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Someone already updated the version here:

__version__ = '5.1.1'

But it was never released: https://pypi.org/project/edx-toggles/

Copy link
Contributor

Choose a reason for hiding this comment

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

Hah, OK. :-)

@@ -213,7 +213,14 @@ def _add_settings(settings_dict):
"""
Fill the `settings_dict`: will only include values that are set to true or false.
"""
for setting_name, setting_value in vars(settings).items():
Copy link
Contributor

Choose a reason for hiding this comment

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

Was the issue that vars just doesn't work at all with the settings object?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It works, but only for settings that were previously requested. So if I set a new test setting, and then if I retrieve that setting in middleware, before the view that uses this report, then it starts appearing. I imagine this is due to lazy loading of settings.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: I did ensure that the new test I added failed without the fix.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, very interesting. And that makes sense.

@robrap robrap merged commit 94619c2 into master Jan 31, 2024
9 checks passed
@robrap robrap deleted the robrap/fix-toggle-report branch January 31, 2024 19:42
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.

Possible issue with edx-platform toggle report
2 participants