refactor!: use origin instead of base_url in configuration#979
Open
Conversation
Collaborator
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
e925b44 to
70e86a3
Compare
b63562e to
4927662
Compare
a97b75b to
1d29010
Compare
Streamlines configuration. Whereas previously we had `base_url=origin+root_path`, which forced us to check if the two matched, we now have only the two constituent pieces `origin` and `root_path`
0cef192 to
2bd9071
Compare
4927662 to
8687bfb
Compare
Contributor
maartenbreddels
left a comment
There was a problem hiding this comment.
nice work, just the None to signal no configuration would be nice to keep in
Comment on lines
+259
to
+260
| "SOLARA_BASE_URL is deprecated, please use SOLARA_ORIGIN and SOLARA_ROOT_PATH instead. " | ||
| "SOLARA_BASE_URL will be removed in a future major version of Solara.", |
| timing: bool = False | ||
| root_path: Optional[str] = None # e.g. /myapp (without trailing slash) | ||
| base_url: str = "" # e.g. https://myapp.solara.run/myapp/ | ||
| root_path: str = "" # e.g. /myapp (without trailing slash) |
Contributor
There was a problem hiding this comment.
We used the None option to signal it's not configured, which then in starlette.py will recognize it (put a comment there where we do that)
| scope = request.scope | ||
| root_path_asgi = scope.get("route_root_path", scope.get("root_path", "")) | ||
| if settings.main.root_path is None: | ||
| if settings.main.root_path == "": |
Contributor
There was a problem hiding this comment.
I think we want to keep this to None, to make sure we only do this when it is not explicitly configured.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

All Submissions:
pre-commitprior to committing my changes (see development setup docs).Changes to / New Features:
Description of changes
This streamlines the url configuration for Solara server, since we no longer have redundant information in
base_url, and both remaining parameters are without trailing slashes.