fix: adopt estate health envelope kit, fix blank BUILD_TIME - #83
Merged
Conversation
Replace the hand-rolled 4-field /health response with @agentage/observability/health: adds version/startedAt/uptimeSeconds, shortens commit to 7 chars (full sha moves to version), and fixes buildTime "" -> null. service now resolves from OTEL_SERVICE_NAME (already agentage-landing in docker-compose.yml). Root cause of the "" buildTime in prod: deploy.yml only ever passed COMMIT_SHA as a build-arg, so the Dockerfile's ARG BUILD_TIME="" default was baked into every image. Deploy now generates and passes BUILD_TIME too.
|
✅ CI - Verify PASSED Commit:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adopts
@agentage/observability@0.8.0(subpath/health) for landing's/healthroute per
~/vaults/agentage/specs/health-endpoints.md(P2e). Fixes three livedefects visible in prod's current response:
buildTime: ""→null.process.env.BUILD_TIME ?? nullpassed the emptystring through; the kit's
|| nulldoes not.commitwas the full 40-char sha → now the 7-char short form (H12); thefull sha now lives in
version.version/startedAt/uptimeSecondswere missing entirely → now present.servicestaysagentage-landingvia the kit'sOTEL_SERVICE_NAMEdefault(already set to
agentage-landingindocker-compose.ymlfor tracing) - norename needed in the route itself, no
serviceargument passed.Root cause of the blank
BUILD_TIMEdeploy.yml's image build only ever passedCOMMIT_SHAas a build-arg. TheDockerfile's
ARG BUILD_TIME=""default was therefore baked into every image,which is why prod has shipped
buildTime: ""since day one. Fixed by generatinga UTC timestamp in a
varsstep and passing it asBUILD_TIME, matching thepattern already used in
auth/dashboard/admin/api-gateway/web.Changes
packages/landing/package.json- bump@agentage/observability^0.6.1->^0.8.0(already a dependency, used for OTEL bootstrap via the
/nextsubpath)packages/landing/src/app/health/route.ts- replace the hand-rolled responsewith
healthResponse()from@agentage/observability/healthpackages/landing/src/app/health/route.test.ts- new unit test asserting thev1 envelope shape (7-char commit, null buildTime on a blank env var, service
name, version/startedAt/uptimeSeconds)
.github/workflows/deploy.yml- generate + passBUILD_TIMEas a build-argNo dependency checks added, per the spec's Next.js profile (SSR shell, no
downstream probes). Dockerfile
HEALTHCHECKunchanged, verified still passes.Test plan
npm run verifygreen (type-check, lint, format, unit tests, realnext build)-
/healthshows asƒ(Dynamic) in the build output, confirming no prerenderdocker build --target runner --build-arg COMMIT_SHA=testsha1234567890(blankBUILD_TIME) -> ran container ->curl /health->buildTime: null,commit: "testsha",version: "testsha1234567890"OTEL_SERVICE_NAME=agentage-landing(matches prod compose) ->service: "agentage-landing"BUILD_TIMEset -> got a real ISO 8601 UTC timestamp, confirmingthe deploy.yml fix produces the right value
HEALTHCHECK(wget -q --spider http://localhost:3000/health)still reports
healthyNot deployed - draft only, per repo convention (deploy.yml ships both dev+prod on
push to master).