Dragonfly2 icon indicating copy to clipboard operation
Dragonfly2 copied to clipboard

Feat/handler error handling and docs

Open retr0-kernel opened this issue 7 months ago • 2 comments

Description

  • Improved error handling and validation in API handlers (application.go, audit.go)
  • Updated Swagger comments to document all error responses (422, 500, etc.)

Related Issue

Closes #4094

Motivation and Context

These changes improve API robustness, make error responses more predictable, and help new contributors understand and follow best practices.

Screenshots (if appropriate)

N/A

Types of changes

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] Documentation Update (if none of the other choices apply)

Checklist

  • [ ] My change requires a change to the documentation.
  • [ ] I have updated the documentation accordingly.
  • [x] I have read the CONTRIBUTING document.
  • [ ] I have added tests to cover my changes.

retr0-kernel avatar May 24 '25 08:05 retr0-kernel

Codecov Report

:x: Patch coverage is 14.28571% with 36 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 33.17%. Comparing base (e23bd66) to head (a8f7bd8). :warning: Report is 168 commits behind head on main.

Files with missing lines Patch % Lines
manager/handlers/application.go 9.67% 22 Missing and 6 partials :warning:
manager/handlers/audit.go 27.27% 6 Missing and 2 partials :warning:

:x: Your project status has failed because the head coverage (33.17%) is below the target coverage (34.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4095      +/-   ##
==========================================
- Coverage   34.36%   33.17%   -1.19%     
==========================================
  Files         346      346              
  Lines       40489    40625     +136     
==========================================
- Hits        13913    13478     -435     
- Misses      25660    26248     +588     
+ Partials      916      899      -17     
Flag Coverage Δ
unittests 33.17% <14.28%> (-1.19%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
manager/handlers/audit.go 54.16% <27.27%> (-17.27%) :arrow_down:
manager/handlers/application.go 53.26% <9.67%> (-16.44%) :arrow_down:

... and 27 files with indirect coverage changes

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar May 24 '25 08:05 codecov[bot]

@gaius-qi I guess we need to re-run the jobs not sure what are the errors for the second job (which is a required one)

retr0-kernel avatar May 24 '25 10:05 retr0-kernel