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

Rename IntegrationConfiguration settings property to settings_dict #1303

Merged
merged 2 commits into from
Aug 9, 2023

Conversation

jonathangreen
Copy link
Member

Description

Rename the IntegrationConfiguration settings property to settings_dict. This aligns properties on IntegrationConfiguration with those on Library making the code a bit easier to reason about.

This also opens up the opportunity to add a settings property on IntegrationConfiguration that loads the settings class from the settings_dict, similar to the method on Library.

Motivation and Context

While working on PP-94, it was confusing the different properties used to store settings between IntegrationConfiguration and Library now that #1281 has gone in.

How Has This Been Tested?

  • Running tests locally

Checklist

  • I have updated the documentation accordingly.
  • All new and existing tests passed.

@codecov
Copy link

codecov bot commented Aug 1, 2023

Codecov Report

Patch coverage: 93.54% and project coverage change: -0.04% ⚠️

Comparison is base (f25b091) 89.85% compared to head (380eed6) 89.82%.

❗ Current head 380eed6 differs from pull request most recent head 0f51c60. Consider uploading reports for the commit 0f51c60 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1303      +/-   ##
==========================================
- Coverage   89.85%   89.82%   -0.04%     
==========================================
  Files         210      208       -2     
  Lines       28655    28549     -106     
  Branches     6556     6545      -11     
==========================================
- Hits        25749    25644     -105     
  Misses       1893     1893              
+ Partials     1013     1012       -1     
Files Changed Coverage Δ
api/lcp/mirror.py 85.48% <ø> (ø)
core/opds_import.py 89.29% <0.00%> (ø)
...admin/controller/patron_auth_service_self_tests.py 94.20% <50.00%> (ø)
api/admin/controller/collection_settings.py 91.17% <100.00%> (ø)
api/admin/controller/patron_auth_services.py 91.39% <100.00%> (ø)
api/admin/controller/settings.py 77.96% <100.00%> (ø)
api/lcp/encrypt.py 83.22% <100.00%> (ø)
api/shared_collection.py 93.27% <100.00%> (ø)
core/configuration/ignored_identifier.py 86.66% <100.00%> (ø)
core/model/collection.py 96.03% <100.00%> (ø)
... and 3 more

... and 5 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jonathangreen jonathangreen force-pushed the feature/rename-integration-settings-property branch from 380eed6 to 925d28a Compare August 3, 2023 15:10
@jonathangreen jonathangreen force-pushed the feature/rename-integration-settings-property branch from 925d28a to 0f51c60 Compare August 7, 2023 14:28
Copy link
Contributor

@tdilauro tdilauro 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! Just one minor comment, but certainly not a showstopper.

Comment on lines +956 to +958
settings = config.settings_dict.copy()
settings[ExternalIntegration.TOKEN_AUTH] = link.href
config.settings = settings
config.settings_dict = settings
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: In some cases we're using the variable settings and in others (e.g., core/model/collection.py ll. 363-365), settings_dict. Would be nice to keep these consistent throughout.

Copy link
Member Author

Choose a reason for hiding this comment

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

This has been hanging out there for awhile, so I'd like to get it merged. I'll try to address this comment in a follow up PR.

@jonathangreen jonathangreen merged commit 992955f into main Aug 9, 2023
@jonathangreen jonathangreen deleted the feature/rename-integration-settings-property branch August 9, 2023 22:24
jonathangreen added a commit that referenced this pull request Aug 10, 2023
In #1303 I mistakenly updated a call to settings on an ExternalIntegration to a call to settings_dict.

This PR fixes the issue, and adds a test for the function that the issue occurred in, since it wasn't tested before.
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.

2 participants