Skip to content

Commit 16b434b

Browse files
Merge branch 'main' into feat/issue-485-di-container
2 parents 4f0280e + 321d2b5 commit 16b434b

242 files changed

Lines changed: 20628 additions & 1239 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/contracts-evm.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ jobs:
6060
- name: Compile contracts
6161
run: npx hardhat compile
6262

63+
- name: Validate upgrade safety (OZ dry-run)
64+
run: npx hardhat run scripts/upgrade.ts --network hardhat
65+
env:
66+
PROPOSE_ONLY: 'true'
67+
SPLITTER_CONTRACT: SplitterV2
68+
continue-on-error: true
69+
6370
- name: Type-check scripts & tests
6471
run: npm run lint
6572

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
name: Platform Services (#473–476)
2+
3+
on:
4+
push:
5+
branches: [main, dev]
6+
pull_request:
7+
branches: [main, dev]
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
backend-services:
16+
name: Archival / Upgrade / Bridge tests
17+
runs-on: ubuntu-latest
18+
timeout-minutes: 15
19+
defaults:
20+
run:
21+
working-directory: backend
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- uses: actions/setup-node@v4
26+
with:
27+
node-version: 22
28+
cache: npm
29+
cache-dependency-path: package-lock.json
30+
31+
- name: Install dependencies
32+
run: npm ci --ignore-scripts
33+
working-directory: .
34+
35+
- name: Generate Prisma client
36+
run: npm run db:generate
37+
working-directory: backend
38+
39+
- name: Run service tests (#473–475)
40+
run: npm test -- src/services/__tests__/issues-473-475.test.ts
41+
working-directory: backend
42+
43+
- name: Validate Prisma schema drift
44+
run: npm run db:migrate:check
45+
working-directory: backend
46+
env:
47+
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/agenticpay_ci
48+
49+
i18n:
50+
name: Translation parity check
51+
runs-on: ubuntu-latest
52+
timeout-minutes: 10
53+
defaults:
54+
run:
55+
working-directory: frontend
56+
steps:
57+
- uses: actions/checkout@v4
58+
59+
- uses: actions/setup-node@v4
60+
with:
61+
node-version: 22
62+
cache: npm
63+
cache-dependency-path: package-lock.json
64+
65+
- name: Install dependencies
66+
run: npm ci --ignore-scripts
67+
working-directory: .
68+
69+
- name: Check translation key parity
70+
run: npm run i18n:check
71+
working-directory: frontend
72+
73+
i18n-sync:
74+
name: DeepL translation sync (manual)
75+
if: github.event_name == 'workflow_dispatch'
76+
runs-on: ubuntu-latest
77+
timeout-minutes: 10
78+
defaults:
79+
run:
80+
working-directory: frontend
81+
steps:
82+
- uses: actions/checkout@v4
83+
84+
- uses: actions/setup-node@v4
85+
with:
86+
node-version: 22
87+
88+
- name: Install dependencies
89+
run: npm ci --ignore-scripts
90+
working-directory: .
91+
92+
- name: Sync missing translations via DeepL
93+
run: npm run i18n:sync
94+
working-directory: frontend
95+
env:
96+
DEEPL_API_KEY: ${{ secrets.DEEPL_API_KEY }}
97+
98+
- name: Verify parity after sync
99+
run: npm run i18n:check
100+
working-directory: frontend
101+
102+
upgrade-validation:
103+
name: Contract upgrade safety gate
104+
runs-on: ubuntu-latest
105+
timeout-minutes: 15
106+
defaults:
107+
run:
108+
working-directory: contracts/evm
109+
steps:
110+
- uses: actions/checkout@v4
111+
112+
- uses: actions/setup-node@v4
113+
with:
114+
node-version: 22
115+
cache: npm
116+
cache-dependency-path: contracts/evm/package-lock.json
117+
118+
- name: Install EVM contract dependencies
119+
run: npm ci --prefer-offline
120+
121+
- name: Compile contracts
122+
run: npx hardhat compile
123+
124+
- name: Run OZ upgrade validation (dry-run)
125+
run: npx hardhat run scripts/upgrade.ts --network hardhat
126+
env:
127+
PROPOSE_ONLY: 'true'
128+
SPLITTER_CONTRACT: SplitterV2
129+
continue-on-error: true
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Types Contract
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'packages/types/**'
7+
- 'backend/prisma/schema.prisma'
8+
- 'backend/src/**'
9+
- 'frontend/**'
10+
- 'packages/sdk/src/**'
11+
push:
12+
branches: [main]
13+
paths:
14+
- 'packages/types/**'
15+
- 'backend/prisma/schema.prisma'
16+
17+
jobs:
18+
shared-types:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
- uses: actions/setup-node@v4
25+
with:
26+
node-version: 22
27+
cache: npm
28+
- run: npm ci
29+
- run: npm run generate:prisma-types --workspace @agenticpay/types
30+
- run: npm run build --workspace @agenticpay/types
31+
- run: npm run check:duplicates --workspace @agenticpay/types
32+
- run: TYPE_API_BASE_REF=origin/main npm run check:breaking --workspace @agenticpay/types
33+
- run: npm run changelog --workspace @agenticpay/types
34+
- run: npm run migration-guide --workspace @agenticpay/types

backend/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"generate:vapid-keys": "node scripts/generate-vapid-keys.js"
3535
},
3636
"dependencies": {
37+
"@agenticpay/types": "*",
3738
"@prisma/client": "^5.22.0",
3839
"@sentry/node": "^10.50.0",
3940
"@sentry/profiling-node": "^10.50.0",
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
DROP TABLE IF EXISTS "plugin_audit_logs";
2+
DROP TABLE IF EXISTS "plugin_configs";
3+
DROP TABLE IF EXISTS "plugins";
4+
DROP TABLE IF EXISTS "outbox_events";
5+
DROP TYPE IF EXISTS "PluginStatus";
6+
DROP TYPE IF EXISTS "OutboxEventStatus";
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
-- CreateEnum
2+
CREATE TYPE "OutboxEventStatus" AS ENUM ('pending', 'publishing', 'published', 'dead_letter');
3+
4+
-- CreateEnum
5+
CREATE TYPE "PluginStatus" AS ENUM ('installed', 'enabled', 'disabled', 'error');
6+
7+
-- CreateTable
8+
CREATE TABLE "outbox_events" (
9+
"id" TEXT NOT NULL,
10+
"aggregate_type" TEXT NOT NULL,
11+
"aggregate_id" TEXT NOT NULL,
12+
"event_type" TEXT NOT NULL,
13+
"payload" JSONB NOT NULL,
14+
"status" "OutboxEventStatus" NOT NULL DEFAULT 'pending',
15+
"attempts" INTEGER NOT NULL DEFAULT 0,
16+
"last_error" TEXT,
17+
"published_at" TIMESTAMP(3),
18+
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
19+
"updated_at" TIMESTAMP(3) NOT NULL,
20+
21+
CONSTRAINT "outbox_events_pkey" PRIMARY KEY ("id")
22+
);
23+
24+
-- CreateTable
25+
CREATE TABLE "plugins" (
26+
"id" TEXT NOT NULL,
27+
"name" TEXT NOT NULL,
28+
"version" TEXT NOT NULL,
29+
"source" TEXT NOT NULL,
30+
"status" "PluginStatus" NOT NULL DEFAULT 'installed',
31+
"compatibility" JSONB NOT NULL,
32+
"health" JSONB NOT NULL,
33+
"installed_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
34+
"updated_at" TIMESTAMP(3) NOT NULL,
35+
"disabled_at" TIMESTAMP(3),
36+
37+
CONSTRAINT "plugins_pkey" PRIMARY KEY ("id")
38+
);
39+
40+
-- CreateTable
41+
CREATE TABLE "plugin_configs" (
42+
"id" TEXT NOT NULL,
43+
"plugin_id" TEXT NOT NULL,
44+
"environment" TEXT NOT NULL DEFAULT 'default',
45+
"config" JSONB NOT NULL,
46+
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
47+
"updated_at" TIMESTAMP(3) NOT NULL,
48+
49+
CONSTRAINT "plugin_configs_pkey" PRIMARY KEY ("id")
50+
);
51+
52+
-- CreateTable
53+
CREATE TABLE "plugin_audit_logs" (
54+
"id" TEXT NOT NULL,
55+
"plugin_id" TEXT NOT NULL,
56+
"actor_id" TEXT,
57+
"action" TEXT NOT NULL,
58+
"details" JSONB,
59+
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
60+
61+
CONSTRAINT "plugin_audit_logs_pkey" PRIMARY KEY ("id")
62+
);
63+
64+
-- CreateIndex
65+
CREATE INDEX "outbox_events_status_created_at_idx" ON "outbox_events"("status", "created_at");
66+
67+
-- CreateIndex
68+
CREATE INDEX "outbox_events_aggregate_type_aggregate_id_idx" ON "outbox_events"("aggregate_type", "aggregate_id");
69+
70+
-- CreateIndex
71+
CREATE INDEX "outbox_events_event_type_idx" ON "outbox_events"("event_type");
72+
73+
-- CreateIndex
74+
CREATE INDEX "outbox_events_published_at_idx" ON "outbox_events"("published_at");
75+
76+
-- CreateIndex
77+
CREATE UNIQUE INDEX "plugins_name_key" ON "plugins"("name");
78+
79+
-- CreateIndex
80+
CREATE INDEX "plugins_status_idx" ON "plugins"("status");
81+
82+
-- CreateIndex
83+
CREATE INDEX "plugins_name_version_idx" ON "plugins"("name", "version");
84+
85+
-- CreateIndex
86+
CREATE UNIQUE INDEX "plugin_configs_plugin_id_environment_key" ON "plugin_configs"("plugin_id", "environment");
87+
88+
-- CreateIndex
89+
CREATE INDEX "plugin_audit_logs_plugin_id_created_at_idx" ON "plugin_audit_logs"("plugin_id", "created_at");
90+
91+
-- AddForeignKey
92+
ALTER TABLE "plugin_configs" ADD CONSTRAINT "plugin_configs_plugin_id_fkey" FOREIGN KEY ("plugin_id") REFERENCES "plugins"("id") ON DELETE CASCADE ON UPDATE CASCADE;
93+
94+
-- AddForeignKey
95+
ALTER TABLE "plugin_audit_logs" ADD CONSTRAINT "plugin_audit_logs_plugin_id_fkey" FOREIGN KEY ("plugin_id") REFERENCES "plugins"("id") ON DELETE CASCADE ON UPDATE CASCADE;

0 commit comments

Comments
 (0)