Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ This document describes the architecture and flow of the CI/CD pipeline for Open
┌─────────────────────────────────────────┐
│ Setup Node.js (actions/setup-node@v4) │
│ - Version: 18.x │
│ - Version: 22.x │
│ - Cache: npm │
└──────────────┬──────────────────────────┘
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ Ensure AWS IAM user/role has these permissions:
## Version Information

- **GitHub Actions:** v4
- **Node.js:** 18.x
- **Node.js:** 22.x
- **Serverless Framework:** 3.x
- **AWS Actions:** v4

Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
node-version: '22.x'
cache: 'npm'

- name: Install dependencies
Expand Down Expand Up @@ -106,6 +106,7 @@ jobs:
DOMAIN: ${{ secrets.DEV_DOMAIN }}
CERTIFICATE_DOMAIN: ${{ secrets.DEV_CERTIFICATE_DOMAIN }}
DISABLE_DOMAIN: ${{ secrets.DEV_DISABLE_DOMAIN }}
INFURA_API_KEY: ${{ secrets.INFURA_API_KEY }}

# Deploy Storage Service
deploy-storage:
Expand All @@ -127,6 +128,7 @@ jobs:
DOMAIN: ${{ secrets.DEV_DOMAIN }}
CERTIFICATE_DOMAIN: ${{ secrets.DEV_CERTIFICATE_DOMAIN }}
DISABLE_DOMAIN: ${{ secrets.DEV_DISABLE_DOMAIN }}
INFURA_API_KEY: ${{ secrets.INFURA_API_KEY }}

# Deploy Verify Service - Development (Sepolia)
deploy-verify-dev:
Expand All @@ -146,6 +148,7 @@ jobs:
DOMAIN: ${{ secrets.DEV_DOMAIN }}
CERTIFICATE_DOMAIN: ${{ secrets.DEV_CERTIFICATE_DOMAIN }}
DISABLE_DOMAIN: ${{ secrets.DEV_DISABLE_DOMAIN }}
INFURA_API_KEY: ${{ secrets.INFURA_API_KEY }}

# Deployment summary
deployment-summary:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/deploy-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ on:
required: false
DISABLE_DOMAIN:
required: false
INFURA_API_KEY:
required: false

jobs:
deploy:
Expand All @@ -66,7 +68,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
node-version: '22.x'
cache: 'npm'

- name: Install dependencies
Expand Down Expand Up @@ -95,6 +97,7 @@ jobs:
DOMAIN=${{ secrets.DOMAIN }}
CERTIFICATE_DOMAIN=${{ secrets.CERTIFICATE_DOMAIN }}
DISABLE_DOMAIN=${{ secrets.DISABLE_DOMAIN || 'false' }}
INFURA_API_KEY=${{ secrets.INFURA_API_KEY }}
EOF

- name: Install Serverless Framework
Expand Down
33 changes: 6 additions & 27 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
node-version: '22.x'
cache: 'npm'

- name: Install dependencies
Expand Down Expand Up @@ -102,27 +102,8 @@ jobs:
DOMAIN: ${{ secrets.DOMAIN }}
CERTIFICATE_DOMAIN: ${{ secrets.CERTIFICATE_DOMAIN }}
DISABLE_DOMAIN: ${{ secrets.DISABLE_DOMAIN }}

# Deploy Storage Service
deploy-storage:
name: Deploy Storage Service
needs: determine-deployment
if: needs.determine-deployment.outputs.deploy-storage == 'true'
uses: ./.github/workflows/deploy-service.yml
with:
service-name: storage
service-path: src/storage
environment: prod
secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
BUCKET_NAME: ${{ secrets.BUCKET_NAME }}
OBJECT_TTL: ${{ secrets.OBJECT_TTL }}
ENABLE_STORAGE_UPLOAD_API_KEY: ${{ secrets.ENABLE_STORAGE_UPLOAD_API_KEY }}
DOMAIN: ${{ secrets.DOMAIN }}
CERTIFICATE_DOMAIN: ${{ secrets.CERTIFICATE_DOMAIN }}
DISABLE_DOMAIN: ${{ secrets.DISABLE_DOMAIN }}
NETWORK: mainnet
INFURA_API_KEY: ${{ secrets.INFURA_API_KEY }}

# Deploy Verify Service - Development (Sepolia)
deploy-verify-dev:
Expand All @@ -142,6 +123,7 @@ jobs:
DOMAIN: ${{ secrets.DOMAIN }}
CERTIFICATE_DOMAIN: ${{ secrets.CERTIFICATE_DOMAIN }}
DISABLE_DOMAIN: ${{ secrets.DISABLE_DOMAIN }}
INFURA_API_KEY: ${{ secrets.INFURA_API_KEY }}

# Deploy Verify Service - Production (Mainnet)
deploy-verify-prod:
Expand All @@ -161,12 +143,13 @@ jobs:
DOMAIN: ${{ secrets.DOMAIN }}
CERTIFICATE_DOMAIN: ${{ secrets.CERTIFICATE_DOMAIN }}
DISABLE_DOMAIN: ${{ secrets.DISABLE_DOMAIN }}
INFURA_API_KEY: ${{ secrets.INFURA_API_KEY }}

# Deployment summary
deployment-summary:
name: Deployment Summary
runs-on: ubuntu-latest
needs: [determine-deployment, deploy-email, deploy-storage, deploy-verify-dev, deploy-verify-prod]
needs: [determine-deployment, deploy-email, deploy-verify-dev, deploy-verify-prod]
if: always() && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
steps:
- name: Generate deployment summary
Expand All @@ -181,10 +164,6 @@ jobs:
echo "- **Email Service:** ${{ needs.deploy-email.result }}" >> $GITHUB_STEP_SUMMARY
fi

if [ "${{ needs.deploy-storage.result }}" != "skipped" ]; then
echo "- **Storage Service:** ${{ needs.deploy-storage.result }}" >> $GITHUB_STEP_SUMMARY
fi

if [ "${{ needs.deploy-verify-dev.result }}" != "skipped" ]; then
echo "- **Verify Service (Dev - Sepolia):** ${{ needs.deploy-verify-dev.result }}" >> $GITHUB_STEP_SUMMARY
fi
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/destroy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
node-version: '22.x'
cache: 'npm'

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rollback.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
node-version: '22.x'
cache: 'npm'

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
node-version: '22.x'
cache: 'npm'

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lts/hydrogen
22
4 changes: 2 additions & 2 deletions CICD_SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Before setting up the CI/CD pipeline, ensure you have:
- [ ] AWS Account with appropriate permissions
- [ ] GitHub repository with admin access
- [ ] AWS CLI installed and configured (for initial setup)
- [ ] Node.js 18.x installed locally
- [ ] Node.js 22.x installed locally
- [ ] Serverless Framework knowledge

## AWS Setup
Expand Down Expand Up @@ -447,7 +447,7 @@ aws cloudwatch put-metric-alarm \
#### 5. Tests Fail in CI but Pass Locally

**Solution:**
- Check Node.js version matches (18.x)
- Check Node.js version matches (22.x)
- Verify all dependencies are in `package.json`
- Check for environment-specific code

Expand Down
1 change: 1 addition & 0 deletions _stubs_/core-js-fn/object/assign.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = Object.assign;
1 change: 1 addition & 0 deletions _stubs_/core-js-fn/object/entries.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = Object.entries;
1 change: 1 addition & 0 deletions _stubs_/core-js-fn/promise.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = Promise;
1 change: 1 addition & 0 deletions _stubs_/core-js-fn/symbol.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = Symbol;
1 change: 1 addition & 0 deletions _stubs_/core-js-fn/symbol/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = Symbol;
1 change: 1 addition & 0 deletions _stubs_/core-js-fn/symbol/to-string-tag.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = Symbol.toStringTag;
29 changes: 28 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,32 @@ module.exports = {
"\\.subject": "jest-raw-loader",
"\\.m?jsx?$": "jest-esm-transformer"
},
transformIgnorePatterns: ["node_modules/(?!(axios)/)"]
transformIgnorePatterns: [
"/node_modules/(?!(axios|@digitalbazaar|base58-universal|base64url-universal|cborg)/)"
],
moduleNameMapper: {
"@tradetrust-tt/token-registry-v5/contracts":
"<rootDir>/node_modules/@tradetrust-tt/token-registry-v5/dist/contracts/index.js",
"@tradetrust-tt/token-registry/contracts":
"<rootDir>/node_modules/@tradetrust-tt/token-registry/dist/contracts/index.js",
// @digitalbazaar ESM-only packages — point to actual lib/index.js so transformIgnorePatterns can transpile them
"@digitalbazaar/bls12-381-multikey":
"<rootDir>/node_modules/@digitalbazaar/bls12-381-multikey/lib/index.js",
"@digitalbazaar/bbs-signatures":
"<rootDir>/node_modules/@digitalbazaar/bbs-signatures/lib/index.js",
"@digitalbazaar/ecdsa-multikey":
"<rootDir>/node_modules/@digitalbazaar/ecdsa-multikey/lib/index.js",
"@digitalbazaar/data-integrity":
"<rootDir>/node_modules/@digitalbazaar/data-integrity/lib/index.js",
"@digitalbazaar/ecdsa-sd-2023-cryptosuite":
"<rootDir>/node_modules/@digitalbazaar/ecdsa-sd-2023-cryptosuite/lib/index.js",
"@digitalbazaar/bbs-2023-cryptosuite":
"<rootDir>/node_modules/@digitalbazaar/bbs-2023-cryptosuite/lib/index.js",
"@digitalbazaar/di-sd-primitives":
"<rootDir>/node_modules/@digitalbazaar/di-sd-primitives/lib/index.js",
// ESM-only dependencies of @digitalbazaar packages
"base58-universal": "<rootDir>/node_modules/base58-universal/lib/index.js",
"base64url-universal":
"<rootDir>/node_modules/base64url-universal/lib/index.js"
}
};
11 changes: 11 additions & 0 deletions jest.setup.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
require("dotenv").config();

// Polyfill Web Streams API globals for Jest's VM sandbox (undici/jsonld-signatures require these)
const {
ReadableStream,
WritableStream,
TransformStream
} = require("node:stream/web");

if (!global.ReadableStream) global.ReadableStream = ReadableStream;
if (!global.WritableStream) global.WritableStream = WritableStream;
if (!global.TransformStream) global.TransformStream = TransformStream;

jest.setTimeout(15000); // verify endpoint is a bit slow can take up to 10 seconds
Loading
Loading