Skip to content

Commit e6a5d98

Browse files
authored
Merge pull request #937 from LIT-Protocol/feature/jss-29-feature-add-naga-uptime-bot
Feature/jss 29 feature add naga uptime bot
2 parents bce36d9 + c8b32a4 commit e6a5d98

File tree

9 files changed

+1377
-3
lines changed

9 files changed

+1377
-3
lines changed

.changeset/rude-radios-grab.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@lit-protocol/e2e': patch
3+
---
4+
5+
Add standalone Naga health checks (EOA + single PKP) covering handshake, pkpSign, signSessionKey, executeJs, and encrypt/decrypt, with status logging via @lit-protocol/lit-status-sdk (no breaking changes).
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
name: Naga Health Checks
2+
3+
on:
4+
push:
5+
branches:
6+
- feature/jss-29-feature-add-naga-uptime-bot
7+
schedule:
8+
- cron: '*/5 * * * *'
9+
workflow_dispatch:
10+
inputs:
11+
naga_branch:
12+
description: 'Branch to run health checks from (optional)'
13+
required: true
14+
default: 'naga'
15+
network:
16+
description: 'Specific network to test (leave empty for all)'
17+
required: false
18+
type: choice
19+
options:
20+
- naga-dev
21+
- naga-test
22+
23+
env:
24+
LIT_STATUS_WRITE_KEY: ${{ secrets.LIT_STATUS_WRITE_KEY }}
25+
LIT_STATUS_BACKEND_URL: ${{ vars.LIT_STATUS_BACKEND_URL }}
26+
27+
jobs:
28+
naga-health-check:
29+
runs-on: ubuntu-latest
30+
environment: Health Check
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
network: [naga-dev, naga-test]
35+
env:
36+
NETWORK: ${{ matrix.network }}
37+
LIVE_MASTER_ACCOUNT: ${{ matrix.network == 'naga-dev' && secrets.LIVE_MASTER_ACCOUNT_NAGA_DEV || secrets.LIVE_MASTER_ACCOUNT_NAGA_TEST }}
38+
LIT_YELLOWSTONE_PRIVATE_RPC_URL: ${{ vars.LIT_YELLOWSTONE_PRIVATE_RPC_URL }}
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v4
42+
with:
43+
ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.naga_branch || github.ref }}
44+
fetch-depth: 1
45+
46+
- name: Install rust
47+
uses: actions-rs/toolchain@v1
48+
with:
49+
toolchain: stable
50+
override: true
51+
components: rust-std
52+
53+
- name: Install wasm-pack
54+
uses: jetli/[email protected]
55+
with:
56+
version: latest
57+
58+
- name: Setup Node.js
59+
uses: actions/setup-node@v4
60+
with:
61+
node-version: '22.18.0'
62+
registry-url: 'https://registry.npmjs.org'
63+
64+
- name: Enable corepack and setup pnpm
65+
run: |
66+
corepack enable
67+
corepack prepare [email protected] --activate
68+
69+
- name: Install dependencies
70+
run: pnpm install --frozen-lockfile
71+
72+
- name: Build project
73+
run: pnpm build
74+
75+
- name: Verify required environment variables
76+
run: |
77+
echo "Checking environment variables for ${{ matrix.network }}..."
78+
if [ -z "${LIVE_MASTER_ACCOUNT}" ]; then
79+
echo "❌ LIVE_MASTER_ACCOUNT is not set for ${{ matrix.network }}"
80+
exit 1
81+
fi
82+
if [ -z "${LIT_STATUS_WRITE_KEY}" ]; then
83+
echo "❌ LIT_STATUS_WRITE_KEY is not set"
84+
exit 1
85+
fi
86+
if [ -z "${LIT_STATUS_BACKEND_URL}" ]; then
87+
echo "❌ LIT_STATUS_BACKEND_URL is not set"
88+
exit 1
89+
fi
90+
echo "✅ All required environment variables are set"
91+
92+
- name: Run health check for ${{ matrix.network }}
93+
if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.network == '' || github.event.inputs.network == matrix.network }}
94+
run: pnpm run ci:health
95+
timeout-minutes: 10
96+
env:
97+
NETWORK: ${{ matrix.network }}
98+
LIVE_MASTER_ACCOUNT: ${{ matrix.network == 'naga-dev' && secrets.LIVE_MASTER_ACCOUNT_NAGA_DEV || secrets.LIVE_MASTER_ACCOUNT_NAGA_TEST }}
99+
LIT_STATUS_WRITE_KEY: ${{ secrets.LIT_STATUS_WRITE_KEY }}
100+
LIT_STATUS_BACKEND_URL: ${{ vars.LIT_STATUS_BACKEND_URL }}
101+
LIT_YELLOWSTONE_PRIVATE_RPC_URL: ${{ vars.LIT_YELLOWSTONE_PRIVATE_RPC_URL }}
102+
LOG_LEVEL: info
103+
104+
- name: Health check summary
105+
if: always()
106+
run: |
107+
if [[ "${{ job.status }}" == "success" ]]; then
108+
echo "✅ Health check passed for ${{ matrix.network }}"
109+
echo "Time: $(date -u +'%Y-%m-%d %H:%M:%S UTC')"
110+
else
111+
echo "❌ Health check failed for ${{ matrix.network }}"
112+
echo "Time: $(date -u +'%Y-%m-%d %H:%M:%S UTC')"
113+
echo "Please check the logs above for details"
114+
fi

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
uses: actions/checkout@v4
4646
with:
4747
fetch-depth: 0
48-
ref: ${{ github.event.workflow_run.head_sha }}
48+
ref: ${{ github.event.workflow_run.head_branch }}
4949

5050
- name: Setup PNPM
5151
uses: pnpm/action-setup@v4
@@ -91,7 +91,7 @@ jobs:
9191
id: changesets
9292
uses: changesets/action@v1
9393
with:
94-
branch: naga
94+
branch: ${{ github.event.workflow_run.head_branch || 'naga' }}
9595
version: pnpm changeset version
9696
publish: pnpm changeset publish --access public
9797
commit: 'chore(release): version packages'

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,17 @@
1313
"format:check": "npx nx format:check --all",
1414
"test:e2e": "npx jest --clearCache --config ./jest.e2e.config.ts && LOG_LEVEL=${LOG_LEVEL:-silent} dotenvx run --env-file=.env -- jest --runInBand --detectOpenHandles --forceExit --config ./jest.e2e.config.ts --testTimeout=50000000 -t",
1515
"test:custom": "npx jest --clearCache --config ./jest.e2e.config.ts && LOG_LEVEL=${LOG_LEVEL:-silent} dotenvx run --env-file=.env -- jest --runInBand --detectOpenHandles --forceExit --config ./jest.e2e.config.ts --testTimeout=50000000",
16-
"test:e2e:ci": "npx jest --clearCache --config ./jest.e2e.config.ts && LOG_LEVEL=${LOG_LEVEL:-silent} npx jest --runInBand --detectOpenHandles --forceExit --config ./jest.e2e.config.ts --testTimeout=50000000 --runTestsByPath"
16+
"test:e2e:ci": "npx jest --clearCache --config ./jest.e2e.config.ts && LOG_LEVEL=${LOG_LEVEL:-silent} npx jest --runInBand --detectOpenHandles --forceExit --config ./jest.e2e.config.ts --testTimeout=50000000 --runTestsByPath",
17+
"test:health": "LOG_LEVEL=${LOG_LEVEL:-silent} dotenvx run --env-file=.env -- tsx packages/e2e/src/health/index.ts",
18+
"ci:health": "LOG_LEVEL=${LOG_LEVEL:-silent} tsx packages/e2e/src/health/index.ts"
1719
},
1820
"private": true,
1921
"dependencies": {
2022
"@babel/core": "^7.28.4",
2123
"@babel/preset-env": "^7.28.3",
2224
"@babel/preset-typescript": "^7.27.1",
2325
"@dotenvx/dotenvx": "^1.6.4",
26+
"@lit-protocol/lit-status-sdk": "^0.1.8",
2427
"@lit-protocol/nacl": "7.1.1",
2528
"@lit-protocol/uint8arrays": "7.1.1",
2629
"@metamask/eth-sig-util": "5.0.2",

0 commit comments

Comments
 (0)