Skip to content

Commit 758ac42

Browse files
authored
Change /healthz to /healthcheck and remove unused docker compose templates (#54171)
1 parent 785cb83 commit 758ac42

File tree

7 files changed

+8
-76
lines changed

7 files changed

+8
-76
lines changed

config/kubernetes/production/deployments/webapp.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,5 @@ spec:
5353
httpGet:
5454
# WARNING: This should be updated to a meaningful endpoint for your application which will return a 200 once the app is fully started.
5555
# See: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-readiness-probes
56-
path: /healthz
56+
path: /healthcheck
5757
port: http

src/frame/middleware/healthz.ts src/frame/middleware/healthcheck.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const router = express.Router()
99
* instance remains in the pool to handle requests
1010
* For example: if we have a failing database connection we may return a 500 status here.
1111
*/
12-
router.get('/', function healthz(req, res) {
12+
router.get('/', function healthcheck(req, res) {
1313
noCacheControl(res)
1414

1515
res.sendStatus(200)

src/frame/middleware/index.ts

+4-6
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import findPage from './find-page.js'
2727
import blockRobots from './block-robots'
2828
import archivedEnterpriseVersionsAssets from '@/archives/middleware/archived-enterprise-versions-assets'
2929
import api from './api'
30-
import healthz from './healthz'
30+
import healthcheck from './healthcheck'
3131
import manifestJson from './manifest-json'
3232
import buildInfo from './build-info'
3333
import reqHeaders from './req-headers'
@@ -66,16 +66,14 @@ import shielding from '@/shielding/middleware'
6666
import tracking from '@/tracking/middleware'
6767
import { MAX_REQUEST_TIMEOUT } from '@/frame/lib/constants.js'
6868

69-
const { DEPLOYMENT_ENV, NODE_ENV } = process.env
69+
const { NODE_ENV } = process.env
7070
const isTest = NODE_ENV === 'test' || process.env.GITHUB_ACTIONS === 'true'
7171

7272
// By default, logging each request (with morgan), is on. And by default
7373
// it's off if you're in a production environment or running automated tests.
7474
// But if you set the env var, that takes precedence.
7575
const ENABLE_DEV_LOGGING = Boolean(
76-
process.env.ENABLE_DEV_LOGGING
77-
? JSON.parse(process.env.ENABLE_DEV_LOGGING)
78-
: !(DEPLOYMENT_ENV === 'azure' || isTest),
76+
process.env.ENABLE_DEV_LOGGING ? JSON.parse(process.env.ENABLE_DEV_LOGGING) : !isTest,
7977
)
8078

8179
const ENABLE_FASTLY_TESTING = JSON.parse(process.env.ENABLE_FASTLY_TESTING || 'false')
@@ -120,7 +118,7 @@ export default function (app: Express) {
120118
// Put this early to make it as fast as possible because it's used,
121119
// and used very often, by the Azure load balancer to check the
122120
// health of each node.
123-
app.use('/healthz', healthz)
121+
app.use('/healthcheck', healthcheck)
124122

125123
// Must appear before static assets and all other requests
126124
// otherwise we won't be able to benefit from that functionality

src/redirects/middleware/handle-redirects.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export default function handleRedirects(req: ExtendedRequest, res: Response, nex
8787
// the language prefix.
8888
// We can't always force on the language prefix because some URLs
8989
// aren't pages. They're other middleware endpoints such as
90-
// `/healthz` which should never redirect.
90+
// `/healthcheck` which should never redirect.
9191
// But for example, a `/authentication/connecting-to-github-with-ssh`
9292
// needs to become `/en/authentication/connecting-to-github-with-ssh`
9393
const possibleRedirectTo = `/en${req.path}`

src/workflows/docker-compose.prod.tmpl.yaml

-33
This file was deleted.

src/workflows/docker-compose.staging.tmpl.yaml

-33
This file was deleted.

src/workflows/wait-until-url-is-healthy.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const DELAY_SECONDS = 15
66

77
/*
88
* Promise resolves once url is healthy or fails if timeout has passed
9-
* @param {string} url - health url, e.g. docs.com/healthz
9+
* @param {string} url - health url, e.g. docs.com/healthcheck
1010
*/
1111
export async function waitUntilUrlIsHealthy(url: string) {
1212
try {

0 commit comments

Comments
 (0)