Skip to content

Port a few more endpoints to the typed API#466

Merged
cguedes merged 11 commits into
mainfrom
update-more-endpoints
Sep 1, 2023
Merged

Port a few more endpoints to the typed API#466
cguedes merged 11 commits into
mainfrom
update-more-endpoints

Conversation

@danvk

@danvk danvk commented Aug 31, 2023

Copy link
Copy Markdown
Collaborator

I filled in the FastAPI / Pydantic schemas in a few places. Note that POST requests need a JSON payload with this system. If we want to support empty payloads, we'll need to add some more logic in typed-api.ts.

@codecov

codecov Bot commented Aug 31, 2023

Copy link
Copy Markdown

Codecov Report

Merging #466 (5c54caf) into main (451ec9b) will decrease coverage by 0.02%.
The diff coverage is 76.82%.

@@            Coverage Diff             @@
##             main     #466      +/-   ##
==========================================
- Coverage   80.48%   80.46%   -0.02%     
==========================================
  Files         188      188              
  Lines       11087    11140      +53     
  Branches     1076     1079       +3     
==========================================
+ Hits         8923     8964      +41     
- Misses       2150     2162      +12     
  Partials       14       14              
Files Changed Coverage Δ
src/api/projectsAPI.ts 31.97% <18.18%> (-0.67%) ⬇️
src/api/typed-api.ts 87.24% <72.72%> (-4.21%) ⬇️
src/api/ingestion.ts 95.87% <95.83%> (+0.63%) ⬆️
python/sidecar/http.py 81.56% <100.00%> (ø)
python/sidecar/search.py 45.45% <100.00%> (-3.12%) ⬇️
python/sidecar/typing.py 97.84% <100.00%> (+0.08%) ⬆️

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

@danvk danvk marked this pull request as ready for review August 31, 2023 22:32
@danvk danvk requested review from cguedes and gjreda August 31, 2023 22:32
@cguedes

cguedes commented Sep 1, 2023

Copy link
Copy Markdown
Collaborator

Note that POST requests need a JSON payload with this system.

I agree that POST should alway have a JSON payload, even though sometimes it can be empty.

cguedes
cguedes previously approved these changes Sep 1, 2023

@cguedes cguedes left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved with a note about the create project payload (querystring vs post body). We should update that later.

Comment thread python/sidecar/http.py

@references_api.post("/{project_id}")
async def ingest_references(project_id: str):
async def ingest_references(project_id: str, payload: EmptyRequest) -> IngestResponse:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this EmptyRequest is ok.

Comment thread python/sidecar/http.py Outdated
@project_api.post("/")
async def create_project(project_name: str, project_path: str = None):
async def create_project(
payload: EmptyRequest, project_name: str, project_path: str = None

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: We should move the project_name and project_path to inside a request payload instead of using the EmptyPayload. This was an oversight when I first reviewed this.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I did this change when I merged the from main.

sehyod
sehyod previously approved these changes Sep 1, 2023
@cguedes cguedes dismissed stale reviews from sehyod and themself via 5c54caf September 1, 2023 10:04
@cguedes cguedes merged commit 303c46a into main Sep 1, 2023
@cguedes cguedes deleted the update-more-endpoints branch September 1, 2023 10:35
Comment thread python/sidecar/http.py
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.

4 participants