feat(indexer): protected-main auto-deploy and /health git SHA #1276
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:implement
agent:implement
agent:open_issues
agent:ready
agent:research
agent:security_audit
agent:verify
architecture
backend
blocker:hybrid
blocker:launch
blocker:limit-orders
blocker:v2
block:log_only
block:security
bug
ci
contracts
correctness
deploy
dev
devops
docs
documentation
duplicate
e2e
enhancement
epic
feature
frontend
functional-completion
gas
good first issue
governance
help wanted
high-risk
hooks
hybrid
indexer
infra
infrastructure
integrators
invalid
launch-blocker
limit-orders
localnet
localterra
low priority
missing-implementation
needs-design
ops
performance
priority
high
priority
medium
product
qa
QA
question
ready
ready
research
scripts
security
security-hardening
smartcontracts
tech-debt
testing
ux
UX
v2
verification
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
code/cl8y-dex-terraclassic#1276
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Protected-branch land of this repo already rebuilds the frontend Coolify application (auto-deploy on). The indexer application for the same Forgejo path does not: auto-deploy is off, so merged tips stay off the live indexer until a manual deploy.
GET /healthreturns only{"status":"ok"}(indexer/src/api/mod.rs), so operators cannot attest which git SHA is serving without scraping Coolify logs (forbidden: never scrape SOURCE SHA lines).CAC grouped drain maps one Coolify uuid per
owner/repo(COOLIFY_APP_MAP). Frontend and indexer are two apps on one repo; drain therefore cannot be the only redeploy path for indexer. Product attestation belongs on indexer/health. CAC public/healthmust stay liveness-only with no SHA (#348 / leftover glance #352 — different process).This is not a +1 on:
/api/v1/health/fee-discount/health.Do not publish Coolify tokens, app uuids, hosts, or
/statusJSON. Do not scrape Coolify logs for SOURCE SHA.Current codebase
indexer/src/api/mod.rshealth()→{"status":"ok"}only; routeGET /health.indexer/tests/api_health.rsassertsstatus == "ok"only.indexer/src/api/fee_discount_health.rsseparate LCD probe (keep).git_commit_shamay be the literal branch token rather than the baked commit (build must record a real hex).drain_deploy_url+app_uuid_for_path: one uuid per forgejo path (crates/cl8y-agent-core/src/coolify.rs,merge_drain.rs).Why this is needed
Indexer schema/API landings (fee hops, quote scale, protocol events) are invisible on the live indexer until someone deploys by hand.
/healthcannot prove the serving binary matchesmain. Frontend already auto-deploys; indexer must match that production bar.Constraints / guardrails
/healthstays unauthenticated, fast, and liveness. Add at most a hexgit_sha(orcommit) field; no occupancy, pins, tokens, helper paths, or inventory.HEAD/ secret-shaped values (same idea as CAC drain SHA parser): omit the field rather than advertiseHEAD./status.Relevant files
indexer/src/api/mod.rsindexer/tests/api_health.rsindexer/tests/security.rs(health status)GIT_COMMIT/SOURCE_COMMITRecommended direction
mainlike frontend.SOURCE_COMMIT/ build-arg). If the platform would record the literalHEADtoken, set include-source-commit (or equivalent) so the env is a 40-char hex.GET /healthJSON:status=okplusgit_shawhen the value matches^[0-9a-f]{7,40}$(lowercase); otherwise omit.If CAC must deploy two uuids per path, that is a separate PlasticDigits/cl8y-agent-control issue (map shape). Do not block indexer auto-deploy on that.
Acceptance criteria
GET /healthincludes a hexgit_shamatching the baked commit after a main land (notHEAD).HEAD/ empty / secret-shaped omitted./api/v1/health/fee-discountunchanged.Test plan (all paths)
HEAD; empty; uppercase hex normalized or omitted (pick one, test it).Test plan (attack / hack / abuse)
/health.N|must be omitted./healthwait on LCD or DB (DoS); fee-discount stays the slow probe.Verification
Indexer unit/api tests. Operator glance after land: frontend and indexer serve the new tip;
GET /healthgit_shamatchesgit rev-parse HEADon that merge (prefix OK). No Coolify log scrape.First-pass model: grok-high
cl8y-agent-control: queued
design_authorjob6c0376c1-1fdb-4b6d-8377-005d871f4e6f(not executed; no Hetzner VM).Merge complete: PR #1282 landed on main (
5d11185e).Met (code): optional
git_shaonGET /health(hex 7–40, omit HEAD/secrets); Dockerfile runtimeGIT_SHA/SOURCE_COMMIT; colliding sqlx versions split to20260916120000USDT +20260916120001protocol-fee hops;make verify-issue-1276was green on the PR.Not met (operator leftover): Coolify protected-main auto-deploy, include-source-commit bake, and live
/healthgit_shamatching tip. This issue auto-closed from the PR "Closes" line; leftover is tracked in a new issue. Do not infer the checkbox from HTTP.Follow-up leftover: #1284 (Coolify auto-deploy + live git_sha).