Skip to content

feat(ops): add production readiness check#53

Open
Dayz-tech-co wants to merge 3 commits into
karagozemin:mainfrom
Dayz-tech-co:feat/production-readiness-check
Open

feat(ops): add production readiness check#53
Dayz-tech-co wants to merge 3 commits into
karagozemin:mainfrom
Dayz-tech-co:feat/production-readiness-check

Conversation

@Dayz-tech-co

Copy link
Copy Markdown

Closes #51

Summary

  • add a production readiness checker for Fortexa deployments
  • fail non-zero when production env config is missing or unsafe
  • validate Stellar Horizon URL, network passphrase, auth secret, wallet allowlists, persistence, and shared security state
  • stop hardcoding testnet passphrase in Stellar runtime helpers
  • add focused readiness tests and document the pre-deploy command

What the readiness check validates

  • STELLAR_HORIZON_URL
  • STELLAR_NETWORK_PASSPHRASE
  • FORTEXA_AUTH_SECRET
  • FORTEXA_OPERATOR_WALLETS
  • DATABASE_URL or FORTEXA_STORE_DIR
  • REDIS_URL or FORTEXA_SHARED_STATE_PATH

Why

Fortexa currently falls back to several local/demo-safe defaults:

  • testnet Horizon / passphrase
  • implicit local file persistence
  • empty operator allowlists that fall back to operator access

Those are convenient for local development but unsafe for production payment flows. This change gives operators a clear pre-deploy gate with actionable remediations and no secret leakage.

Notes

  • errors name the setting to fix but do not print secret values
  • payment build/submit now use env-driven Stellar network config instead of a hardcoded testnet passphrase
  • explorer links now follow the configured network

Validation

Intended commands:

  • npm run test
  • npm run lint
  • npm run check:production-readiness

Local limitation:

  • full validation was blocked on this machine by npm install failing with ENOSPC (disk full), so I could not complete the requested local lint/test run here

@vercel

vercel Bot commented Jun 28, 2026

Copy link
Copy Markdown

@Dayz-tech-co is attempting to deploy a commit to the karagoz's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jun 28, 2026

Copy link
Copy Markdown

@Dayz-tech-co Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@karagozemin

Copy link
Copy Markdown
Owner

Thanks for the production readiness work. I checked this against #51 and cannot merge it yet because the test suite is not green.

Commands run:

  • npm test — failed
  • npm run lint — passed with one warning
  • npm run check:production-readiness — failed as expected in this local env because required production vars are absent
  • git diff --check main...HEAD — passed

Blocking test failure:

src/lib/readiness/production.test.ts > production readiness > formats actionable output without exposing secret values

The test expects the formatted report to include FORTEXA_AUTH_SECRET, but the report generated in the test does not include that check. Vitest reports:

AssertionError: expected ... to contain FORTEXA_AUTH_SECRET

Please update the test fixture or readiness validation so the test expectation matches the intended behavior, then rerun npm test and npm run lint.

Small cleanup: lint also reports an unused getStellarNetworkPassphrase import in src/lib/readiness/production.ts. It is only a warning right now, but worth removing before re-review.

@karagozemin

Copy link
Copy Markdown
Owner

Thanks for the production readiness PR. I cannot merge it yet because the new readiness test fails.

Command run:

npm ci
npm test -- src/lib/readiness/production.test.ts

Blocking failure:

formats actionable output without exposing secret values
expected formatted output to contain FORTEXA_AUTH_SECRET

The generated report currently lists other missing production settings but not FORTEXA_AUTH_SECRET, so the test and implementation are out of sync. Please fix the readiness check/report behavior or adjust the test expectation, then re-run the test and npm run build.

@karagozemin

Copy link
Copy Markdown
Owner

Thanks for the PR! GitHub reports this branch is conflicting with main and can't be merged as-is. Could you rebase onto the latest main and resolve the conflicts? Once it's mergeable I'll get it merged. 🙏

@Dayz-tech-co
Dayz-tech-co force-pushed the feat/production-readiness-check branch from b486256 to 55151fa Compare July 24, 2026 16:16
@Dayz-tech-co

Copy link
Copy Markdown
Author

Rebased this branch onto current main and resolved the reported conflicts while preserving the newer payment quote, body-size, wallet/XDR, metrics, and idempotency protections. I also fixed the previously reported readiness test mismatch and current-main test defects that prevented the required full suite from going green.\n\nValidation on commit 55151fa:\n- npm test: 62 files passed, 433 tests passed\n- npm run lint: passed (0 errors; 6 existing warnings)\n- npm run build: passed\n- valid production readiness fixture: exit 0\n- unsafe/missing production fixture: exit 1 with actionable setting names and no secret values\n- git diff --check: passed\n\nGitHub now reports the PR as MERGEABLE. Ready for re-review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Production environment readiness check for Fortexa deployments

2 participants