Files
conversation-history/FetcherPay/Marketing Deployment Engineering Review - 2026-06-21.md
T

166 lines
6.1 KiB
Markdown

# Marketing Deployment Engineering Review - 2026-06-21
## Summary
The static FetcherPay marketing site currently builds and the live homepage responds successfully, but the deployment path and runtime integrations have several issues that can break updates or specific features.
Current live server: `art0` at `104.190.60.129` over SSH port `2222`.
Current live marketing image: `localhost:32000/fetcherpay/marketing:20250319.3`.
## Current Status
- `https://fetcherpay.com/` returns `200`.
- `npm --workspace @fetcherpay/marketing run build` passes.
- `POST https://fetcherpay.com/api/chat` returns `500`.
- `npm run build` at repo root fails.
- `npm run type-check` at repo root fails.
- `npm --workspace @fetcherpay/api test -- --runInBand` fails before tests run due TypeScript/Jest typing errors.
## P1 - Fix Before Relying on Deploys
### 1. Update the Gitea marketing deploy target
File: `.gitea/workflows/deploy-marketing.yml`
Problem: the workflow still hardcodes the old server IP `23.120.207.35`. The current server is `104.190.60.129`.
Needed work:
- Replace hardcoded IPs with a deployment secret such as `MARKETING_DEPLOY_HOST`.
- Set that secret to `104.190.60.129`.
- Keep SSH port `2222` unless the server changes.
- Run one workflow deployment and verify rollout on `art0`.
Verification:
```bash
ssh -p 2222 garfield@104.190.60.129 'microk8s kubectl rollout status deployment/fetcherpay-marketing -n fetcherpay-marketing'
```
### 2. Fix the marketing chat API service URL
File: `apps/marketing/pages/api/chat.ts`
Problem: the chat API calls `http://ollama:11434/api/generate`, but the live Ollama Kubernetes service is in namespace `fetcherpay`, while marketing runs in namespace `fetcherpay-marketing`. The short DNS name does not resolve cross-namespace.
Needed work:
- Add an env var such as `OLLAMA_URL`.
- Set it in `apps/marketing/k8s/deployment.yaml` to `http://ollama.fetcherpay.svc.cluster.local:11434`.
- Use the env var in `pages/api/chat.ts`, with a safe local default.
- Redeploy and smoke test `/api/chat`.
Verification:
```bash
curl -sS -H 'content-type: application/json' \
-d '{"messages":[{"role":"user","content":"hello"}]}' \
https://fetcherpay.com/api/chat
```
### 3. Restore repo build/type-check gates
Files likely involved:
- `sdks/node/package.json`
- missing `sdks/node/rollup.config.js`
- `apps/admin/package.json`
- `apps/docs/package.json`
- `apps/api/src/middleware/auth.ts`
- `apps/api/src/lambda/__tests__/transactionCategorizer.test.ts`
- `apps/api/src/__tests__/transactionEndpoints.test.ts`
Problems found:
- Root `npm run build` fails because `sdks/node/rollup.config.js` is missing.
- Root `npm run type-check` fails because admin/docs run `tsc --noEmit` without usable project config.
- API build/test fail on TypeScript errors, including `apps/api/src/middleware/auth.ts:169` and Jest mock typing errors.
Needed work:
- Decide whether `sdks/node` should be part of the root workspace build; if yes, restore its Rollup config.
- Add or correct TypeScript configs/scripts for `apps/admin` and `apps/docs`, or remove invalid type-check scripts from the root pipeline.
- Fix API TS errors and Jest mock typings.
- Make `npm run build`, `npm run type-check`, and `npm --workspace @fetcherpay/api test -- --runInBand` pass.
Verification:
```bash
npm run build
npm run type-check
npm --workspace @fetcherpay/api test -- --runInBand
```
## P2 - Clean Up Deployment Reliability
### 4. Collapse marketing deployment into one documented path
Files:
- `apps/marketing/DEPLOYMENT.md`
- `apps/marketing/deploy.sh`
- `apps/marketing/deploy-production.sh`
- `apps/marketing/deploy-to-server.sh`
- `.gitea/workflows/deploy-marketing.yml`
- `helm/fetcherpay-marketing/values.yaml`
Problem: there are several competing deployment paths. The docs use placeholders and mention `latest`; the live system uses explicit image tag `20250319.3`; the workflow builds on the server; the local scripts assume local Docker/kubectl access; Helm appears staging-oriented.
Needed work:
- Pick the canonical production path.
- Recommended: Gitea workflow builds on `art0`, pushes to local MicroK8s registry, applies `apps/marketing/k8s/*`, and sets an explicit image tag.
- Mark local scripts as manual fallback or remove them.
- Update `apps/marketing/DEPLOYMENT.md` with the actual server, SSH port, namespace, registry, image naming, rollback, and smoke tests.
Verification:
```bash
ssh -p 2222 garfield@104.190.60.129 'microk8s kubectl get deploy,pods,svc,ingress -n fetcherpay-marketing'
```
### 5. Clean up local secret/generated-file hygiene
Current risky/noisy files in the worktree include:
- `keys.md`
- local `.env` files
- Playwright reports/results
- local screenshots
- generated local DB files
Needed work:
- Do not commit `keys.md`.
- Review `.gitignore`; remove noisy exceptions around `apps/node_modules` if they are not intentional.
- Add ignores for Playwright output, local DB files, screenshots, and generated artifacts if they should remain local.
- Move any real secrets into the appropriate secret store.
## Suggested Order
1. Fix Gitea deploy host and deploy one no-op marketing release.
2. Fix `OLLAMA_URL` and verify `/api/chat` returns `200`.
3. Update `apps/marketing/DEPLOYMENT.md` to match the real production flow.
4. Fix monorepo build/type-check/test gates.
5. Clean local secret/generated artifacts and tighten ignore rules.
## Smoke Test Checklist
After the next deploy:
```bash
curl -I https://fetcherpay.com/
curl -sS -H 'content-type: application/json' \
-d '{"name":"Test","email":"test@example.com","company":"TestCo","volume":"50k-250k","industry":"retail","painPoints":"test"}' \
https://fetcherpay.com/api/contact
curl -sS -H 'content-type: application/json' \
-d '{"messages":[{"role":"user","content":"hello"}]}' \
https://fetcherpay.com/api/chat
ssh -p 2222 garfield@104.190.60.129 'microk8s kubectl get pods -n fetcherpay-marketing'
```
## Decision Needed
The main decision is whether Gitea should be the only production deploy path. My recommendation: yes. Keep one documented production deploy path and treat local Docker/kubectl scripts as emergency fallback only.