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 health check for hgweb to match api version #679

Merged
merged 5 commits into from
May 23, 2024
Merged

Conversation

hahn-kev
Copy link
Collaborator

@hahn-kev hahn-kev commented Mar 28, 2024

this adds a health check to the api so when /api/healthz is called it verifies that hgweb is running the same version, if it's not then the health is degraded.

todo:

  • disable in develop
  • fix the deploy script to fail deployments that never become healthy.

closes #672

@hahn-kev hahn-kev requested review from myieye and rmunn and removed request for myieye March 28, 2024 21:20
Copy link

github-actions bot commented Mar 28, 2024

C# Unit Tests

35 tests   35 ✅  4s ⏱️
 8 suites   0 💤
 1 files     0 ❌

Results for commit 899e635.

♻️ This comment has been updated with latest results.

@hahn-kev hahn-kev enabled auto-merge (rebase) April 1, 2024 22:04
@myieye
Copy link
Contributor

myieye commented Apr 2, 2024

It won't work properly in develop, because we only deploy what changed, is that right?
So, either:

  1. A PR changed both and they have the same version
  2. A PR only changes 1, which should indicate that the new version of that is compatible with the old version of the other

So, yeah, disabling it in develop sounds good to me.

@hahn-kev
Copy link
Collaborator Author

hahn-kev commented Apr 2, 2024

Yeah that's right about develop, we only push the changes that were made.

Copy link
Contributor

@myieye myieye left a comment

Choose a reason for hiding this comment

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

So, it seems to be working, but what do we get out of this?

[lexbox-api] warn: Microsoft.Extensions.Diagnostics.HealthChecks.DefaultHealthCheckService[103]
[lexbox-api]       => TraceId:fd6314267ee0210d42d107a3b5fbc5f7 => ConnectionId:0HN2JQPNPPUSR => RequestPath:/api/healthz RequestId:0HN2JQPNPPUSR:00000001 => Microsoft.Extensions.Diagnostics.HealthChecks.HealthCheckLogScope
[lexbox-api]       Health check hgweb with status Degraded completed after 50.4235ms with message 'api version: 'dockerDev' hg version: 'dockerDev2' mismatch'

I don't see the degraded status anywhere in k8s and it deploys the version regardless of the health being degraded. What do we want to happen?

@hahn-kev
Copy link
Collaborator Author

hahn-kev commented Apr 3, 2024

that's a good point, my thinking was that the deploy script would catch it, but right now it only checks the version header and not the status code to see the response. Need to fix the script to keep trying until the service is healthy

@myieye myieye marked this pull request as draft April 9, 2024 08:43
auto-merge was automatically disabled April 9, 2024 08:43

Pull request was converted to draft

# Conflicts:
#	backend/LexBoxApi/LexBoxKernel.cs
#	hgweb/command-runner.sh
@hahn-kev hahn-kev marked this pull request as ready for review May 22, 2024 17:48
Copy link

github-actions bot commented May 22, 2024

UI unit Tests

11 tests   11 ✅  0s ⏱️
 3 suites   0 💤
 1 files     0 ❌

Results for commit 899e635.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@rmunn rmunn left a comment

Choose a reason for hiding this comment

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

LGTM.

@hahn-kev hahn-kev merged commit 62c170a into develop May 23, 2024
16 checks passed
@hahn-kev hahn-kev deleted the chore/hgweb-health branch July 9, 2024 07:25
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.

we are not notified when hgweb does not deploy properly
3 participants