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

Adds server settings models #15758

Merged
merged 6 commits into from
Oct 21, 2024
Merged

Adds server settings models #15758

merged 6 commits into from
Oct 21, 2024

Conversation

desertaxle
Copy link
Member

@desertaxle desertaxle commented Oct 18, 2024

This PR adds four new settings models:

  • ServerSettings
  • ServerAPISettings
  • ServerDatabaseSettings
  • ServerEphemeralSettings

In general, many settings previously in the PREFECT_API_ namespace will move under the ServerSetting model.

Support for the old names is maintained via validation aliases for backward compatibility. A new source EnvFilterSettingsSource is also added to be able to filer environment variables. It turns out all entries in validation_alias are used to load values via environment variables. I ran into this with the user field on ServerDatabaseSettings model since Unix-based operating systems have a USER environment variable that was getting picked up. Now, all AliasPath alias choices will be excluded when looking for values via environment variables.

Copy link

codspeed-hq bot commented Oct 18, 2024

CodSpeed Performance Report

Merging #15758 will not alter performance

Comparing create-server-settings-models (0b25738) with main (dcf250b)

Summary

✅ 3 untouched benchmarks

@desertaxle desertaxle changed the title Create ServerSettings model Adds server settings models Oct 19, 2024
@desertaxle desertaxle marked this pull request as ready for review October 19, 2024 03:35
Copy link
Collaborator

@zzstoatzz zzstoatzz left a comment

Choose a reason for hiding this comment

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

lgtm! just something I thought while reviewing, not necessarily an ask for this PR, do you think its worth adding gt / le for numbers where appropriate?

src/prefect/settings.py Outdated Show resolved Hide resolved
src/prefect/settings.py Outdated Show resolved Hide resolved
@desertaxle
Copy link
Member Author

do you think its worth adding gt / le for numbers where appropriate?

Yeah, that's a good idea! We can add those at some point.

@desertaxle desertaxle force-pushed the create-even-more-settings-groups branch from 91e54f3 to b740680 Compare October 21, 2024 14:59
@desertaxle desertaxle force-pushed the create-server-settings-models branch from 8259038 to 312d765 Compare October 21, 2024 15:00
Base automatically changed from create-even-more-settings-groups to main October 21, 2024 15:51
@desertaxle desertaxle force-pushed the create-server-settings-models branch from 312d765 to 0b25738 Compare October 21, 2024 15:53
@desertaxle desertaxle merged commit fb79db3 into main Oct 21, 2024
35 checks passed
@desertaxle desertaxle deleted the create-server-settings-models branch October 21, 2024 16:09
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