Skip to content

Reorg FastAPI backend into submodules#495

Merged
cguedes merged 30 commits into
mainfrom
415-break-up-httppy
Sep 7, 2023
Merged

Reorg FastAPI backend into submodules#495
cguedes merged 30 commits into
mainfrom
415-break-up-httppy

Conversation

@gjreda

@gjreda gjreda commented Sep 5, 2023

Copy link
Copy Markdown
Collaborator

fixes #415

Break up the backend into submodules. This layout largely follows the FastAPI best practices listed here, which is inspired by Netflix's Dispatch project.


fc10954 also fixes #494. Threw it on here since it was going to lead to merge conflicts.

@cguedes

cguedes commented Sep 5, 2023

Copy link
Copy Markdown
Collaborator

@gjreda what do you think of removing the top level sidecar folder (well, keep it to the server cmd)? IMO That's now more of an implementation detail.

@gjreda

gjreda commented Sep 5, 2023

Copy link
Copy Markdown
Collaborator Author

@cguedes I'd like to keep it (or rename it) in order to follow a fairly standard python project layout. sidecar still feels like a fairly apt name (as does backend or something similar).

@cguedes

cguedes commented Sep 6, 2023

Copy link
Copy Markdown
Collaborator

@gjreda two notes before the review:

  • we need to update the project.json script for the yarn web:api
  • I would like (need) the API url to start with a /api. This is useful to create a (rewrite/proxy) rule when running the client in dev mode. Would also be useful if we serve the client app (html, css, ...) via the same backend server.

@codecov

codecov Bot commented Sep 6, 2023

Copy link
Copy Markdown

Codecov Report

Merging #495 (8f96715) into main (5ebffb3) will increase coverage by 0.16%.
The diff coverage is 86.77%.

@@            Coverage Diff             @@
##             main     #495      +/-   ##
==========================================
+ Coverage   81.52%   81.68%   +0.16%     
==========================================
  Files         202      213      +11     
  Lines       12089    12109      +20     
  Branches     1181     1181              
==========================================
+ Hits         9855     9891      +36     
+ Misses       2220     2204      -16     
  Partials       14       14              
Files Changed Coverage Δ
python/generate_schema.py 0.00% <0.00%> (ø)
python/main.py 0.00% <0.00%> (ø)
python/sidecar/search/constants.py 100.00% <ø> (ø)
python/sidecar/typing.py 80.95% <ø> (-17.07%) ⬇️
python/sidecar/meta/router.py 57.14% <57.14%> (ø)
python/sidecar/filesystem/router.py 78.26% <78.26%> (ø)
python/sidecar/references/router.py 78.57% <78.57%> (ø)
python/sidecar/references/storage.py 84.44% <81.25%> (ø)
python/sidecar/projects/router.py 87.50% <87.50%> (ø)
python/sidecar/api.py 94.73% <94.73%> (ø)
... and 18 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@gjreda

gjreda commented Sep 6, 2023

Copy link
Copy Markdown
Collaborator Author

@cguedes I think this is good to go now. The codegen schemas look ok to me, but can you verify on your end as well? There aren't any tests for that code, so it was hard to verify that the changes were ok.

I'll write some tests for generate_schema.py in a follow-up PR.

@gjreda gjreda requested a review from cguedes September 6, 2023 19:21
@cguedes cguedes merged commit 28e9047 into main Sep 7, 2023
@cguedes cguedes deleted the 415-break-up-httppy branch September 7, 2023 09:24
cguedes added a commit that referenced this pull request Sep 8, 2023
- We forgot to update this in #495
gjreda pushed a commit that referenced this pull request Sep 8, 2023
* Fix the code that set logger enabled/disabled

* Fix the Python: FastAPI launch script

- We forgot to update this in #495
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.

Remove the deprecated current_directory setting from the backend API Break up http.py

2 participants