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

Update /_health to accept GET requests #8234

Merged

Conversation

davidmauskop
Copy link
Contributor

Description of what you did:

I updated the health check to handle both GET and HEAD requests, where before it only handled HEAD requests.

More context:

I'm an engineer at Render, and recently worked on our Deploy Strapi doc and Strapi example repos. Render uses health checks to enable zero downtime deploys, as described here: https://render.com/docs/zero-downtime-deploys. Our health checks use GET requests, so currently we're recommending that people deploying Strapi on Render create a file at /public/healthz/index.html with contents OK, and specify /healthz as their health check path. This is okay, but it would be cleaner if we could use the existing health check at /_health.

I imagine this could be helpful for Strapi users on other platforms as well.

Signed-off-by: David Mauskop <david@render.com>
Copy link
Member

@derrickmehaffy derrickmehaffy left a comment

Choose a reason for hiding this comment

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

LGTM I would prefer this also, would be nice.

@codecov
Copy link

codecov bot commented Oct 7, 2020

Codecov Report

Merging #8234 into master will increase coverage by 0.07%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8234      +/-   ##
==========================================
+ Coverage   32.96%   33.03%   +0.07%     
==========================================
  Files        1197     1219      +22     
  Lines       13020    13563     +543     
  Branches     1286     1348      +62     
==========================================
+ Hits         4292     4481     +189     
- Misses       7885     8200     +315     
- Partials      843      882      +39     
Flag Coverage Δ
#front 24.71% <ø> (-0.35%) ⬇️
#unit 54.10% <ø> (+0.21%) ⬆️

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

Impacted Files Coverage Δ
...rapi-admin/admin/src/hooks/useFetchRole/reducer.js 80.00% <0.00%> (-20.00%) ⬇️
...min/admin/src/components/Roles/Permissions/init.js 80.00% <0.00%> (-20.00%) ⬇️
packages/strapi-admin/services/permission.js 77.57% <0.00%> (-14.00%) ⬇️
...in/src/containers/Users/ProtectedEditPage/index.js 87.50% <0.00%> (-12.50%) ⬇️
...t-type-builder/controllers/validation/relations.js 50.00% <0.00%> (-12.50%) ⬇️
.../admin/src/components/Roles/Permissions/reducer.js 85.41% <0.00%> (-12.15%) ⬇️
...ages/strapi/lib/services/entity-validator/index.js 54.11% <0.00%> (-9.78%) ⬇️
packages/strapi/lib/core-api/service.js 64.44% <0.00%> (-4.79%) ⬇️
.../admin/src/containers/Webhooks/EditView/reducer.js 82.35% <0.00%> (-4.32%) ⬇️
...admin/admin/src/containers/Roles/EditPage/index.js 55.17% <0.00%> (-4.09%) ⬇️
... and 106 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e0287c8...9f77209. Read the comment docs.

@davidmauskop
Copy link
Contributor Author

Great, thanks! I'll update the doc and our repos once this is part of a release.

@alexandrebodin alexandrebodin added this to the 3.2.2 milestone Oct 8, 2020
@alexandrebodin alexandrebodin added source: core:strapi Source is core/strapi package issue: enhancement Issue suggesting an enhancement to an existing feature labels Oct 8, 2020
@alexandrebodin alexandrebodin merged commit 43ff63c into strapi:master Oct 8, 2020
@nnennajohn
Copy link

Nice. I was just looking for this, and I also use render.com. Thanks @davidmauskop. How do I get this update as I see it just got merged, so does not yet work on v3.2.1.

@davidmauskop
Copy link
Contributor Author

davidmauskop commented Oct 9, 2020

@nnennajohn My pleasure! It looks like this change will be part of v3.2.2. I don't know exactly when v3.2.2 will be published, but the Strapi folks do a great job of making frequent releases, as you can see here: https://github.com/strapi/strapi/releases.

The Strapi on Render example repos (see https://render.com/docs/deploy-strapi) will be updated to use v3.2.2 shortly after it's published. If you aren't already, I'd recommend "watching" this repo if you want to be notified about releases.

@nnennajohn
Copy link

Ok. Great. Thanks @davidmauskop

@derrickmehaffy
Copy link
Member

FYI @davidmauskop @nnennajohn v3.2.3 has been released and this should be included in it.

@nnennajohn
Copy link

@davidmauskop great. Thanks so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: enhancement Issue suggesting an enhancement to an existing feature source: core:strapi Source is core/strapi package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants