Description
apps/subgraph is the dealbot-specific subgraph (currently powering retrieval++, likely more later). It has no CI, no deploy automation, no operational monitoring, and no schema-migration discipline. Operationalize it using the conventions already in use on FilOzone/filecoin-pay-explorer (newer pattern, tag-driven Goldsky deploys) and FilOzone/pdp-explorer (per-network manifests).
Impact
Manual goldsky subgraph deploy runs are non-reproducible and untracked. PRs touching apps/subgraph can land schema regressions or compile failures unnoticed. When the deployed subgraph falls behind, lags, or errors, no one is alerted. As we expand the subgraph past retrieval++, this drift compounds.
Proposed Approach
Mirror the conventions from filecoin-pay-explorer.
CI on PRs (path-filtered to apps/subgraph/**)
graph codegen
graph build matrix across calibration + mainnet manifests
graph test (run only when test files exist)
- biome + typecheck on the subgraph package
- All required for merge
Deploy automation
- Triggered by
v* git tags
- Matrix deploy to calibration + mainnet via Goldsky CLI (
goldsky subgraph deploy "dealbot-${network}/$VERSION")
GOLDSKY_API_KEY from repo secrets
- Build pulls network via env var (per filecoin-pay-explorer's
NETWORK=${matrix.network})
Schema migration discipline
- Per-network manifest pattern (pdp-explorer's
subgraph_mainnet.yaml / subgraph_testnet.yaml)
- Tag equals subgraph version. Versioned slugs in Goldsky.
Health monitoring + alerts (BetterStack, route to existing dealbot ops Slack)
- Indexing lag: head block vs subgraph latest block, alert when >5 minutes behind
- Goldsky deploy status: alert on failed redeploy
- Subgraph error rate from Goldsky logs, alert on sustained 5xx
Acceptance
- CI workflow at
.github/workflows/subgraph.yml runs codegen + build + test + lint on PRs touching apps/subgraph
- Deploy workflow on
v* tags publishes to Goldsky for both networks; rollback is git revert then re-tag
- Per-network manifest files committed
- Three BetterStack alerts wired and verified, route to dealbot ops Slack
- README in
apps/subgraph/ documents how to deploy locally and how to cut a release tag
Description
apps/subgraphis the dealbot-specific subgraph (currently powering retrieval++, likely more later). It has no CI, no deploy automation, no operational monitoring, and no schema-migration discipline. Operationalize it using the conventions already in use on FilOzone/filecoin-pay-explorer (newer pattern, tag-driven Goldsky deploys) and FilOzone/pdp-explorer (per-network manifests).Impact
Manual
goldsky subgraph deployruns are non-reproducible and untracked. PRs touchingapps/subgraphcan land schema regressions or compile failures unnoticed. When the deployed subgraph falls behind, lags, or errors, no one is alerted. As we expand the subgraph past retrieval++, this drift compounds.Proposed Approach
Mirror the conventions from filecoin-pay-explorer.
CI on PRs (path-filtered to
apps/subgraph/**)graph codegengraph buildmatrix across calibration + mainnet manifestsgraph test(run only when test files exist)Deploy automation
v*git tagsgoldsky subgraph deploy "dealbot-${network}/$VERSION")GOLDSKY_API_KEYfrom repo secretsNETWORK=${matrix.network})Schema migration discipline
subgraph_mainnet.yaml/subgraph_testnet.yaml)Health monitoring + alerts (BetterStack, route to existing dealbot ops Slack)
Acceptance
.github/workflows/subgraph.ymlruns codegen + build + test + lint on PRs touchingapps/subgraphv*tags publishes to Goldsky for both networks; rollback isgit revertthen re-tagapps/subgraph/documents how to deploy locally and how to cut a release tag