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

fix(confighttp): do not return 200 on errors #3385

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ReenigneArcher
Copy link
Member

@ReenigneArcher ReenigneArcher commented Nov 10, 2024

Description

  • Return 400 status code on config API errors
  • Add default_resource for requests that are not GET
  • Remove trailing commas in API examples
  • Clarify how index works when saving an app
  • Change xml responses to json
  • Add grouped tab code examples to API docs

TODO:

  • add tabbed examples for each endpoint in docs. e.g. curl, python, javascript, powershell
  • trying to delete app way out of index range shows as success
    >curl -u user:pass -X DELETE -k https://localhost:47990/api/apps/5000
    {
        "status": "true"
    }
    
    Note: existing check was useless since it could never actually be fired ( < 0 is not possible due to the regex of the endpoint), instead changed it to a clamp and checked the upper bounds.

Screenshot

image
image
image

Issues Fixed or Closed

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency update (updates to dependencies)
  • Documentation update (changes to documentation)
  • Repository update (changes to repository files, e.g. .github/...)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the in code docstring/documentation-blocks for new or existing methods/components

@ReenigneArcher ReenigneArcher force-pushed the fix/confighttp/do-not-return-200-on-errors branch from a18aef8 to eec6b6c Compare November 10, 2024 00:04
Copy link

codecov bot commented Nov 10, 2024

Codecov Report

Attention: Patch coverage is 0% with 56 lines in your changes missing coverage. Please review.

Project coverage is 6.17%. Comparing base (6a233cb) to head (d945065).

Files with missing lines Patch % Lines
src/confighttp.cpp 0.00% 56 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##           master   #3385      +/-   ##
=========================================
- Coverage    8.44%   6.17%   -2.27%     
=========================================
  Files          90      66      -24     
  Lines       16074   12002    -4072     
  Branches     7636    5602    -2034     
=========================================
- Hits         1357     741     -616     
+ Misses      12237   11084    -1153     
+ Partials     2480     177    -2303     
Flag Coverage Δ
Linux ?
Windows 6.17% <0.00%> (-0.01%) ⬇️

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

Files with missing lines Coverage Δ
src/confighttp.cpp 0.00% <0.00%> (ø)

... and 56 files with indirect coverage changes

@ReenigneArcher ReenigneArcher force-pushed the fix/confighttp/do-not-return-200-on-errors branch from eec6b6c to f65d517 Compare November 10, 2024 00:23
@ReenigneArcher ReenigneArcher force-pushed the fix/confighttp/do-not-return-200-on-errors branch from f65d517 to 45de0cc Compare January 8, 2025 02:37
@ReenigneArcher ReenigneArcher added the help wanted Extra attention is needed label Jan 8, 2025
@ReenigneArcher ReenigneArcher added this to the stable release milestone Jan 8, 2025
@ReenigneArcher ReenigneArcher force-pushed the fix/confighttp/do-not-return-200-on-errors branch from 45de0cc to 78b043a Compare January 9, 2025 00:55
@ReenigneArcher ReenigneArcher removed the help wanted Extra attention is needed label Jan 9, 2025
@ReenigneArcher ReenigneArcher force-pushed the fix/confighttp/do-not-return-200-on-errors branch 3 times, most recently from 10e6d57 to 2bf4c22 Compare January 9, 2025 04:53
@ReenigneArcher ReenigneArcher marked this pull request as ready for review January 9, 2025 04:54
@ReenigneArcher ReenigneArcher force-pushed the fix/confighttp/do-not-return-200-on-errors branch from 2bf4c22 to a7c5ed9 Compare January 9, 2025 05:02
@LizardByte LizardByte deleted a comment from sonarqubecloud bot Jan 9, 2025
@ReenigneArcher ReenigneArcher force-pushed the fix/confighttp/do-not-return-200-on-errors branch from a7c5ed9 to d945065 Compare January 9, 2025 05:07
Copy link

sonarqubecloud bot commented Jan 9, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
1 New issue
1 New Code Smells (required ≤ 0)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

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.

Beta API: POST /api/apps returns 200 OK on invalid input JSON
1 participant