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

Cleanup controllers and change delete 204 to 200 #1666

Merged
merged 2 commits into from
Oct 26, 2024
Merged

Cleanup controllers and change delete 204 to 200 #1666

merged 2 commits into from
Oct 26, 2024

Conversation

jmthomas
Copy link
Member

Setting status to 204 means "No content" yet we were returning content in almost all the delete cases. This was causing a bug that we just worked around in calendar.rb but was just wrong based on our use. I also changed all the controllers to match the more common Rails style of symbol keys:

render json: { key: value, more: stuff}

rather than our existing mix of hash rocket with some symbol and some string keys:

render :json => { 'key' => value, :more => stuff}

Copy link

codecov bot commented Oct 25, 2024

Codecov Report

Attention: Patch coverage is 32.93173% with 167 lines in your changes missing coverage. Please review.

Project coverage is 76.53%. Comparing base (6b5acfc) to head (362a7f7).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...cmd-tlm-api/app/controllers/reaction_controller.rb 20.68% 23 Missing ⚠️
...-cmd-tlm-api/app/controllers/trigger_controller.rb 20.83% 19 Missing ⚠️
...cmd-tlm-api/app/controllers/activity_controller.rb 57.89% 16 Missing ⚠️
...-cmd-tlm-api/app/controllers/storage_controller.rb 0.00% 15 Missing ⚠️
...s-cmd-tlm-api/app/controllers/tables_controller.rb 0.00% 13 Missing ⚠️
...cmd-tlm-api/app/controllers/timeline_controller.rb 37.50% 10 Missing ⚠️
...lm-api/app/controllers/trigger_group_controller.rb 35.71% 9 Missing ⚠️
...cmd-tlm-api/app/controllers/packages_controller.rb 0.00% 8 Missing ⚠️
...-cmd-tlm-api/app/controllers/plugins_controller.rb 0.00% 7 Missing ⚠️
...t-runner-api/app/controllers/scripts_controller.rb 25.00% 6 Missing ⚠️
... and 21 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1666      +/-   ##
==========================================
+ Coverage   76.44%   76.53%   +0.09%     
==========================================
  Files         618      618              
  Lines       46891    46895       +4     
  Branches      849      849              
==========================================
+ Hits        35844    35891      +47     
+ Misses      10952    10909      -43     
  Partials       95       95              
Flag Coverage Δ
frontend 56.14% <ø> (-0.11%) ⬇️
python 83.93% <ø> (-0.02%) ⬇️
ruby-api 48.82% <33.06%> (+1.22%) ⬆️
ruby-backend 82.54% <0.00%> (+<0.01%) ⬆️

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

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

Copy link

sonarcloud bot commented Oct 25, 2024

@ryanmelt ryanmelt merged commit 987deb1 into main Oct 26, 2024
27 checks passed
@ryanmelt ryanmelt deleted the controllers branch October 26, 2024 15:08
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