-
Notifications
You must be signed in to change notification settings - Fork 93
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
feat(server): Use global config from file if provided #2458
Merged
+115
−22
Merged
Changes from 5 commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
dbc71f3
wip
TBS1996 a320a33
Merge branch 'master' into tor/static_config
TBS1996 dc8fe7a
wip
TBS1996 d631912
wip
TBS1996 c125ec5
wip
TBS1996 aed5e6e
wip
TBS1996 153c9f1
wip
TBS1996 9367f89
take relay modes into account
TBS1996 9068be4
merge
TBS1996 1a43645
Merge branch 'master' into tor/static_config
TBS1996 3776ec6
wip
TBS1996 2d56213
Merge branch 'tor/static_config' of https://github.com/getsentry/rela…
TBS1996 761198e
simplify match arms
TBS1996 c3221b7
move match to spawnhandler
TBS1996 8fa4521
ref
TBS1996 387c246
nit
TBS1996 0fadcea
self request
TBS1996 749306a
Merge branch 'master' into tor/static_config
TBS1996 5281b67
ref match
TBS1996 68b0bbf
move static config load to service
TBS1996 383d850
Merge branch 'tor/static_config' of https://github.com/getsentry/rela…
TBS1996 67d3f73
revert sleephandle logic
TBS1996 43e4b4c
Merge branch 'master' into tor/static_config
TBS1996 e9b7272
Merge branch 'tor/static_config' of https://github.com/getsentry/rela…
TBS1996 5e94b76
move globalconfig load
TBS1996 9e0f3e3
Merge branch 'master' into tor/static_config
TBS1996 4f87968
add tests
iker-barriocanal da63e18
undo rename to prevent bad error grouping
iker-barriocanal a5e9c03
Merge branch 'master' into tor/static_config
iker-barriocanal a7030d4
update docstrings
iker-barriocanal a5c0224
update changelog
TBS1996 a6efd91
Merge branch 'master' into tor/static_config
TBS1996 99f2acd
address some feedback
iker-barriocanal 20a593e
wip
TBS1996 17eba98
Merge branch 'tor/static_config' of https://github.com/getsentry/rela…
TBS1996 a6ada9f
wip
TBS1996 a69eb2f
wip
TBS1996 a4f5a14
t->T
TBS1996 c0e767d
remove test feat/dep
TBS1996 c9f0ef9
Merge branch 'master' into tor/static_config
TBS1996 c39f12c
Merge branch 'master' into tor/static_config
TBS1996 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
wasn't 100% sure if i should put it here or not. My reasoning was that if we fail to parse the file, it's better to fail early than later, and it just seems idiomatic within the codebase that we don't do these kind of risky IO-stuff in the services.
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.
We have a precedent where we defer the deserialization of a static config file to a service:
relay/relay-config/src/config.rs
Lines 1916 to 1919 in 498401a
That service reloads the config every 10 seconds though, which I think is overkill. In short, I think your way of doing it is better because it fails early. I'll leave final review to @jan-auer.
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 concur with this: We can load the global configs directly from within the actual service like we do it for project configs. That keeps the responsibility of the
relay-config
crate lower. The overall implementation in this PR does look good, so it would just have to be moved.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.
alright, I moved it now to the spawn handler, where I'll log an error if the file exists yet it fails to load it.