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

Refactor AppSettingAPI.get_all() into get_all_by_scope(), deprecate #1534

Closed
6 tasks done
mikkonie opened this issue Jan 6, 2025 · 2 comments
Closed
6 tasks done
Assignees
Labels
app: projectroles Issue in the projectroles app feature Requested feature or enhancement
Milestone

Comments

@mikkonie
Copy link
Collaborator

mikkonie commented Jan 6, 2025

This method seems to be some kind of a remnant from a time long past. It's called get_all() but only returns app setting values with APP_SETTING_SCOPE_PROJECT.

In SODAR Core this is only used in tests, while in SODAR there is one use in taskflowbackend.plugins. I don't know about Varfish or Kiosc yet but will check.

I need to review its use and see if this should be removed completely, or refactored into something sensible. This may be a breaking change depending on which course I'll take.

Issues with the method:

  • It says in the docstring it "returns all settings"
  • In reality, it only gets definitions of APP_SETTING_SCOPE_PROJECT
  • However, in parameters it allows setting user kwarg and no project

If filtering results to a specific scope are needed, this can be done by checking against definitions.

Spec

  • Create get_all_by_scope() which works similarly, but explicitly requiring the scope
  • Update usages
  • Call get_all_by_scope() from get_all()
  • Deprecate get_all() with a warning
  • Document as breaking change

Tasks

@mikkonie mikkonie added breaking Breaking change, to be implemented and documented with care feature Requested feature or enhancement tbd Comments wanted, spec/schedule/prioritization to be decided, etc. app: projectroles Issue in the projectroles app labels Jan 6, 2025
@mikkonie mikkonie added this to the v1.1.0 milestone Jan 6, 2025
@mikkonie mikkonie self-assigned this Jan 6, 2025
@mikkonie
Copy link
Collaborator Author

mikkonie commented Jan 6, 2025

Update: @stolpeo confirmed that this is used in Varfish. So we'll need to see about the usage there too.

@mikkonie mikkonie changed the title Remove or refactor AppSettingAPI.get_all() Remove, deprecate or refactor AppSettingAPI.get_all() Jan 6, 2025
@mikkonie mikkonie changed the title Remove, deprecate or refactor AppSettingAPI.get_all() Refactor AppSettingAPI.get_all() Jan 9, 2025
@mikkonie mikkonie changed the title Refactor AppSettingAPI.get_all() AppSettingAPI.get_all() only returns PROJECT scope settings Jan 9, 2025
@mikkonie mikkonie added bug Something isn't working and removed feature Requested feature or enhancement tbd Comments wanted, spec/schedule/prioritization to be decided, etc. labels Jan 9, 2025
@mikkonie mikkonie changed the title AppSettingAPI.get_all() only returns PROJECT scope settings Fix and refactor AppSettingAPI.get_all() Jan 9, 2025
@mikkonie mikkonie changed the title Fix and refactor AppSettingAPI.get_all() Refactor AppSettingAPI.get_all() into get_all_by_scope(), deprecate Jan 9, 2025
@mikkonie mikkonie added the feature Requested feature or enhancement label Jan 9, 2025
@mikkonie mikkonie removed bug Something isn't working breaking Breaking change, to be implemented and documented with care labels Jan 9, 2025
@mikkonie
Copy link
Collaborator Author

mikkonie commented Jan 9, 2025

Done.

@mikkonie mikkonie closed this as completed Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app: projectroles Issue in the projectroles app feature Requested feature or enhancement
Projects
None yet
Development

No branches or pull requests

1 participant