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 provideRunner with no managers enabled. #704

Merged
merged 2 commits into from
Sep 28, 2024
Merged

Conversation

mpass99
Copy link
Collaborator

@mpass99 mpass99 commented Sep 27, 2024

If only AWS was enabled, a 500 error instead of a 404 error was returned. If both Nomad and AWS was disabled, the requests returned with a 200 response but an empty body. A silent nil-dereference was triggered.

Closes https://github.com/orgs/openHPI/projects/4/views/1?pane=issue&itemId=81052193

If only AWS was enabled, a 500 error instead of a 404 error was returned.
If both Nomad and AWS was disabled, the requests returned with a 200 response but an empty body. A silent nil-dereference was triggered.
@mpass99 mpass99 self-assigned this Sep 27, 2024

This comment was marked as off-topic.

Copy link

codecov bot commented Sep 27, 2024

Codecov Report

Attention: Patch coverage is 88.23529% with 2 lines in your changes missing coverage. Please review.

Project coverage is 76.40%. Comparing base (5b64aee) to head (11b18aa).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
internal/environment/abstract_manager.go 80.00% 1 Missing ⚠️
internal/runner/nomad_manager.go 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #704      +/-   ##
==========================================
+ Coverage   76.03%   76.40%   +0.37%     
==========================================
  Files          43       43              
  Lines        3676     3688      +12     
==========================================
+ Hits         2795     2818      +23     
+ Misses        645      635      -10     
+ Partials      236      235       -1     

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

Previously, the abstract manager would still return a successful response of 204, even if the environment was not stored at all. Now, we return a "proper" 500 code if no environment manager is able to handle the request.
Copy link
Member

@MrSerth MrSerth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thank you! I tested the functionality and was able to confirm that it now works as expected.

As part of my review process, I also observed that synchronizing any environment to Poseidon was successful when no runner manager was enabled. Hence, I amended your PR to change this behavior and further fix a superfluous header write (due to a missing return statement). With that, I am happy to merge this PR 👍.

@MrSerth MrSerth merged commit b5a32ef into main Sep 28, 2024
12 checks passed
@MrSerth MrSerth deleted the fix/#draft-provide-runner branch September 28, 2024 09:50
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