Skip to content
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

Download file endpoint #235

Merged
merged 4 commits into from
Dec 11, 2023
Merged

Download file endpoint #235

merged 4 commits into from
Dec 11, 2023

Conversation

johnml1135
Copy link
Collaborator

@johnml1135 johnml1135 commented Dec 8, 2023

This resolves #232.


This change is Reviewable

Copy link
Contributor

@ddaspit ddaspit left a comment

Choose a reason for hiding this comment

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

Reviewed 14 of 14 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @johnml1135)


src/Serval.ApiServer/Startup.cs line 119 at r1 (raw file):

        foreach (Version version in versions)
        {
            services.AddSwaggerGen(o =>

I don't think this is necessary. I tried removing it and the generated client still looks correct.


src/Serval.DataFiles/Controllers/DataFilesController.cs line 149 at r1 (raw file):

    /// <response code="503">A necessary service is currently unavailable. Check `/health` for more details. </response>
    [Authorize(Scopes.ReadFiles)]
    [HttpPost("{id}/download")]

I would prefer the endpoint {id}/contents. Nouns are preferred for hypertext resources.

@johnml1135
Copy link
Collaborator Author

src/Serval.ApiServer/Startup.cs line 119 at r1 (raw file):

Previously, ddaspit (Damien Daspit) wrote…

I don't think this is necessary. I tried removing it and the generated client still looks correct.

I removed swashbuckle too. I don't know why it is all working now...

@johnml1135
Copy link
Collaborator Author

src/Serval.DataFiles/Controllers/DataFilesController.cs line 149 at r1 (raw file):

Previously, ddaspit (Damien Daspit) wrote…

I would prefer the endpoint {id}/contents. Nouns are preferred for hypertext resources.

Done.

@johnml1135
Copy link
Collaborator Author

src/Serval.ApiServer/Startup.cs line 119 at r1 (raw file):

Previously, johnml1135 (John Lambert) wrote…

I removed swashbuckle too. I don't know why it is all working now...

Correction - swashbuckle is needed but no other configuration.

Copy link
Contributor

@ddaspit ddaspit left a comment

Choose a reason for hiding this comment

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

Reviewable status: 11 of 14 files reviewed, 2 unresolved discussions (waiting on @johnml1135)


src/Serval.ApiServer/Startup.cs line 119 at r1 (raw file):

Previously, johnml1135 (John Lambert) wrote…

Correction - swashbuckle is needed but no other configuration.

I removed Swashbuckle and it seems to work fine without it.

@johnml1135
Copy link
Collaborator Author

src/Serval.ApiServer/Startup.cs line 119 at r1 (raw file):

Previously, ddaspit (Damien Daspit) wrote…

I removed Swashbuckle and it seems to work fine without it.

Rebuild and run the integration E2E tests.

@codecov-commenter
Copy link

codecov-commenter commented Dec 8, 2023

Codecov Report

Attention: 31 lines in your changes are missing coverage. Please review.

Comparison is base (8c25097) 62.39% compared to head (46f5cc6) 62.50%.
Report is 3 commits behind head on main.

Files Patch % Lines
src/Serval.Client/Client.g.cs 63.29% 20 Missing and 9 partials ⚠️
...erval.DataFiles/Controllers/DataFilesController.cs 81.81% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #235      +/-   ##
==========================================
+ Coverage   62.39%   62.50%   +0.11%     
==========================================
  Files         134      134              
  Lines        5826     5926     +100     
  Branches      912      936      +24     
==========================================
+ Hits         3635     3704      +69     
- Misses       1803     1824      +21     
- Partials      388      398      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@ddaspit ddaspit left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 3 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @johnml1135)


src/Serval.ApiServer/Startup.cs line 119 at r1 (raw file):

Previously, johnml1135 (John Lambert) wrote…

Rebuild and run the integration E2E tests.

I rebuilt and ran the integration tests. They all passed. What is failing on your end?

@johnml1135
Copy link
Collaborator Author

src/Serval.ApiServer/Startup.cs line 119 at r1 (raw file):

Previously, ddaspit (Damien Daspit) wrote…

I rebuilt and ran the integration tests. They all passed. What is failing on your end?

I checked again and now all the tests are passing without Swashbuckle. I removed it.

Copy link
Contributor

@ddaspit ddaspit left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @johnml1135)

@johnml1135 johnml1135 merged commit 0e04bae into main Dec 11, 2023
1 of 2 checks passed
@ddaspit ddaspit deleted the download_files branch December 11, 2023 20:18
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.

Add file and corpus download endpoints
3 participants