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

Implement HEAD handler for v2/pkgs/tools/installed (required by frontend) #844

Merged
merged 2 commits into from
Oct 10, 2023

Conversation

umbynos
Copy link
Contributor

@umbynos umbynos commented Oct 10, 2023

Please check if the PR fulfills these requirements

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • Tests for the changes have been added (for bug fixes / features)
  • What kind of change does this PR introduce?

Fix regression

  • What is the current behavior?

Currently, the frontend runs a HEAD request to the v2/pkgs/tools/installed endpoint before running the GET request. Probably this broke when we bumped GOA (#815). With agent 1.3.2 the request has 200 as status code. After the bump the status code returned was 405.

  • What is the new behavior?

Since in #815 no change in the design was made, I had to implement a custom method.

  • Does this PR introduce a breaking change?

no

  • Other information:

Without this the server returns 405 when called with HEAD to `v2/pkgs/tools/installed`
This breaks the install of the tools
@umbynos umbynos added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Oct 10, 2023
@umbynos umbynos self-assigned this Oct 10, 2023
@codecov-commenter
Copy link

Codecov Report

Attention: 25 lines in your changes are missing coverage. Please review.

Comparison is base (15fcb43) 19.09% compared to head (c4cebc9) 19.62%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #844      +/-   ##
==========================================
+ Coverage   19.09%   19.62%   +0.53%     
==========================================
  Files          46       46              
  Lines        3635     3684      +49     
==========================================
+ Hits          694      723      +29     
- Misses       2850     2867      +17     
- Partials       91       94       +3     
Flag Coverage Δ
unit 19.62% <59.67%> (+0.53%) ⬆️

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

Files Coverage Δ
gen/http/tools/server/encode_decode.go 31.46% <100.00%> (+4.07%) ⬆️
gen/tools/service.go 18.51% <ø> (ø)
v2/pkgs/tools.go 72.83% <100.00%> (+0.31%) ⬆️
gen/tools/endpoints.go 46.15% <90.00%> (+4.84%) ⬆️
gen/http/tools/server/paths.go 0.00% <0.00%> (ø)
gen/tools/client.go 0.00% <0.00%> (ø)
gen/http/tools/server/server.go 44.50% <61.76%> (+2.55%) ⬆️

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

Copy link

@csarnataro csarnataro left a comment

Choose a reason for hiding this comment

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

Looks good to me.
I tested the latest build (after the HEAD method has been added to /pkgs/tools/installed) and it worked as expected.

@umbynos umbynos merged commit 9a500b4 into main Oct 10, 2023
39 checks passed
@umbynos umbynos deleted the head-back branch October 10, 2023 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants