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

builder: add more consistency and finer granularity to build status #1037

Merged
merged 1 commit into from
Oct 17, 2024

Conversation

efahl
Copy link
Contributor

@efahl efahl commented Oct 15, 2024

Ensure that 'imagebuilder_status' is reported at all phases of build, and add a final "done" status.

Ensure that all GET and HEAD requests to '/build' receive all x-headers regardless of build phase.

After reading through all the FastAPI docs, it turns out you can put '@get' and '@Head' on the same function and it works just as you would expect. Reduces code size a bit.

Extended the 'build_get' test to also include the HEAD request and confirm that sequential HEAD and GET requests receive the same data.

Copy link

codecov bot commented Oct 15, 2024

Codecov Report

Attention: Patch coverage is 89.58333% with 5 lines in your changes missing coverage. Please review.

Project coverage is 90.72%. Comparing base (5e65dec) to head (f40c8d1).
Report is 133 commits behind head on main.

Files with missing lines Patch % Lines
asu/routers/api.py 76.19% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1037      +/-   ##
==========================================
+ Coverage   80.75%   90.72%   +9.96%     
==========================================
  Files          15       14       -1     
  Lines         977     1110     +133     
==========================================
+ Hits          789     1007     +218     
+ Misses        188      103      -85     

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

@aparcar
Copy link
Member

aparcar commented Oct 16, 2024

Overall super nice work! I'd be nice if you could split things into smaller commits in the future to make things easier to review and later on find errors

asu/build.py Outdated Show resolved Hide resolved
asu/build.py Show resolved Hide resolved
asu/routers/api.py Outdated Show resolved Hide resolved
asu/build.py Outdated Show resolved Hide resolved
Ensure that 'imagebuilder_status' is reported at all phases of build,
and add a final "done" status.

Ensure that all GET and HEAD requests to '/build' receive all
x-headers regardless of build phase.

After reading through all the FastAPI docs, it turns out you can
put '@get' and '@Head' on the same function and it works just as
you would expect.  Reduces code size a bit.

Extended the 'build_get' test to also include the HEAD request and
confirm that sequential HEAD and GET requests receive the same data.

Signed-off-by: Eric Fahlgren <[email protected]>
@aparcar aparcar merged commit cdf2a5d into openwrt:main Oct 17, 2024
4 checks passed
@efahl efahl deleted the status-consistency branch October 17, 2024 15:27
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.

2 participants