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

Add schema validation and documentation for RemoteEvaluation #2575

Merged
merged 3 commits into from
Oct 11, 2024

Conversation

MrSerth
Copy link
Member

@MrSerth MrSerth commented Oct 7, 2024

This PR contains two major changes, aiming to improve the robustness of usefulness of the remote evaluation:

  • Add schema validation for RemoteEvaluation
  • Add OpenAPI documentation for RemoteEvaluationController

@MrSerth MrSerth added bug enhancement ruby Pull requests that update Ruby code labels Oct 7, 2024
@MrSerth MrSerth requested a review from Dome-GER October 7, 2024 11:01
@MrSerth MrSerth self-assigned this Oct 7, 2024
Copy link

codecov bot commented Oct 7, 2024

Codecov Report

Attention: Patch coverage is 70.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 69.52%. Comparing base (d99a715) to head (ad6d70a).
Report is 24 commits behind head on master.

Files with missing lines Patch % Lines
app/models/runner.rb 33.33% 2 Missing ⚠️
app/controllers/remote_evaluation_controller.rb 85.71% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2575   +/-   ##
=======================================
  Coverage   69.52%   69.52%           
=======================================
  Files         202      202           
  Lines        6360     6370   +10     
=======================================
+ Hits         4422     4429    +7     
- Misses       1938     1941    +3     

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

For the spec, we had to change a few things:
1. The parameters are now required in the body. Rails usually merges body and query parameters, but we are now checking the request body only.
2. `format: :json` to parse the response received as JSON
3. `as: :json` to send the correct Content-Type with the request

 Those changes have no impact on the functionality of the actual controller under test.
When the runner is already in use, we do not want to request a new runner or try copying files again. Hence, this improvement is needed to avoid an invalid state or other errors.
@Dome-GER Dome-GER merged commit c9c9d9b into master Oct 11, 2024
10 checks passed
@Dome-GER Dome-GER deleted the remote_evaluation branch October 11, 2024 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug enhancement ruby Pull requests that update Ruby code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants