-
Notifications
You must be signed in to change notification settings - Fork 44
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
Isolate runserver CLI in client module and move AppState into views #9605
Conversation
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## dev #9605 +/- ##
============================================
- Coverage 42.49% 42.43% -0.07%
Complexity 2272 2272
============================================
Files 1312 1314 +2
Lines 105608 105820 +212
Branches 3305 3305
============================================
+ Hits 44881 44901 +20
- Misses 58774 58966 +192
Partials 1953 1953
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
5d3f8c2
to
c3e4ea7
Compare
c3e4ea7
to
2b73a1f
Compare
0bc1a49
to
ac3ab65
Compare
To merge after #9580, it shouldn't conflict, but just to be sure. |
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 have to ask... Why is it the client module if it contains the runserver cli?
@Khoyo We only have one binary for now. And it likely won't change until we have a proper split in crates. In which case it will be trivial to move the The biggest part of this PR is actually to remove the dependency of |
ac3ab65
to
15674e1
Compare
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.
Looks fine, just a few minor comments.
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.
Re: client, could we call it command? I really don't see how it is a client
Otherwise, LGTM. (But I only did a cursory review)
Agreed on the naming. It never really was a true "client" since it just runs commands on its own (no command forge a request that is sent to an editoast server). |
@woshilapin I rolled back the changes to the structure |
Looks good, even for the rolled back on |
Signed-off-by: Leo Valais <[email protected]>
Signed-off-by: Leo Valais <[email protected]>
Introduces a `ServerConfig` struct to aggregate all server parameters. We won't be able to use structs defined in `client` once it will be its own crate. Signed-off-by: Leo Valais <[email protected]>
Signed-off-by: Leo Valais <[email protected]>
Signed-off-by: Leo Valais <[email protected]>
Signed-off-by: Leo Valais <[email protected]>
Signed-off-by: Leo Valais <[email protected]>
Signed-off-by: Leo Valais <[email protected]>
Signed-off-by: Leo Valais <[email protected]>
331966d
to
c57059d
Compare
Follow up of #9349
Moves in the
client
module the following commands:Reaching a proper split (import wise) of the run server command required a bit of refactoring. We want
client
to depend ofviews
, and not the other way around. So we cannot useclient
definitions anywhere inviews
.What's done to achieve that:
ServerConfig
structure that aggregates all server parameters.AppState
intoviews
(still re-exported at crate-level, for now at least)client
definitions usage outside of the module.MapLayerConfig
has been removed from the state,ValkeyConfig
moved inmod valkey_utils
,PostgresConfig
andCoreConfig
duplicated inmod views
.What's been done simultaneously:
url::Url
instead ofString
where it makes senseDefault
implementations inclient
client
structs visibility where possible.Next steps
match
in therun
function in theclient
moduleROOT-URL
andDYNAMIC_ASSET_PATH
inclap
and remove their accessor functions fromclient
get_app_version
ineditoast_common
valkey_utils
ineditoast_common
(wdyt?)db_pool_v1
from theAppState
return Box::new(CliError::new(...
byanyhow::bail!
sinceanyhow
's paradigm fits perfectly our error management on theclient
sideAppState.config.disable_authorization
and removeAppState.disable_authorization
editoast_client
crate is ready to be split!(Some of these points could be included in the current PR, but I figured it's big enough already...)