mirror of
https://github.com/luxfi/bridge.git
synced 2026-09-24 00:26:46 +00:00
phase2-r2: scrub bridge3 / @luxbridge/app / lux-bridge references
Sweep through configs, docs, and ignore files after the structural
collapse in the previous commit. Updates fall into three buckets:
1) Restore the Dockerfile for app/bridge/
- app/bridge/Dockerfile: new file, Vite SPA → ghcr.io/hanzoai/spa,
same shape as the pre-collapse legacy Dockerfile, build context
is repo root so @luxfi/bridge (workspace:*) resolves.
- cmd/bridge/Dockerfile: switch UI-build stage to the workspace
build context so the new app/bridge (which depends on the
sibling pkg/bridge package) actually installs.
- Makefile build-ui target: drop the per-app build context for
the same reason — context must be repo root.
2) Update workspace docs to the new layout
- README.md: rename @luxbridge/app row → @luxbridge/lux-tenant,
port 3000 → 3001 (the slim tenant's vite config uses 3001).
- docs/LLM.md: drop the bridge3 row, rename app/bridge row to
@luxbridge/lux-tenant, update dev port.
- docs/{BRIDGE-STATUS,LOCAL-SETUP,CI-CD-DOCKER-IMAGES}.md:
`docker build … ./app/bridge` → `… -f app/bridge/Dockerfile .`
so docs reflect the workspace-rooted build context.
- .github/workflows/publish.yml: drop @luxbridge/app and
@luxbridge/app-v3 from the private-packages comment.
3) Delete AI-slop status reports + test harness
- CI_STATUS_REPORT.md, DEPLOYMENT_STATUS.md, WORKFLOW_AUDIT.md,
WORKFLOWS_SUMMARY.md — stale and referenced bridge3.
- test-bridge-ui.js — top-level Puppeteer/Playwright probe of the
deleted legacy UI; not a workspace test.
- .dockerignore: drop the test-bridge-ui.js entry now that the
file no longer exists.
Out of scope (untouched): pkg/bridge/src/{Bridge,config,types,mount}
and pkg/bridge/src/app/ — Phase 3 R2 is working there. The
`@luxbridge/app` mentions in those files are historical comments
explaining the prior workspace cycle, not live references.
This commit is contained in:
@@ -26,7 +26,6 @@ docs
|
|||||||
|
|
||||||
# Test files
|
# Test files
|
||||||
test
|
test
|
||||||
test-bridge-ui.js
|
|
||||||
.storybook
|
.storybook
|
||||||
|
|
||||||
# Docker and infrastructure (avoid recursive context)
|
# Docker and infrastructure (avoid recursive context)
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
# (anything with `"publishConfig.access": "public"` and not `"private": true`).
|
# (anything with `"publishConfig.access": "public"` and not `"private": true`).
|
||||||
#
|
#
|
||||||
# Public: @luxfi/bridge, @luxfi/core, @luxfi/threshold, @luxfi/utila
|
# Public: @luxfi/bridge, @luxfi/core, @luxfi/threshold, @luxfi/utila
|
||||||
# Private (workspace-only, never published): @luxbridge/app, @luxbridge/app-v3,
|
# Private (workspace-only, never published): @luxbridge/lux-tenant,
|
||||||
# @luxbridge/explorer, @luxbridge/server,
|
# @luxbridge/explorer, @luxbridge/server,
|
||||||
# @luxbridge/settings, @luxbridge/ui-automation
|
# @luxbridge/settings, @luxbridge/ui-automation
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -1,81 +0,0 @@
|
|||||||
# CI/CD Status Report - MPC Native Integration
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
All CI/CD workflows have been fixed and are now passing successfully after the MPC native integration migration.
|
|
||||||
|
|
||||||
## Changes Made
|
|
||||||
|
|
||||||
### 1. MPC Architecture Migration
|
|
||||||
- Migrated from Docker-based MPC service to native Go integration
|
|
||||||
- Removed obsolete `app/mpc-service` directory
|
|
||||||
- Integrated with external MPC tools (`lux-mpc`, `lux-mpc-cli`)
|
|
||||||
- Updated all infrastructure services
|
|
||||||
|
|
||||||
### 2. CI/CD Fixes Applied
|
|
||||||
|
|
||||||
#### Updated Workflows
|
|
||||||
- **Bridge Server CI**: Updated pnpm to 9.15.0, removed non-existent test script
|
|
||||||
- **Integration Tests**: Updated pnpm version, uses mock MPC tools for CI
|
|
||||||
- **MPC E2E Tests**: Already passing with mock MPC implementation
|
|
||||||
- **Server**: Updated pnpm version for deployment
|
|
||||||
- **Build and Push Images**: No changes needed, already compatible
|
|
||||||
|
|
||||||
#### Deprecated Workflows
|
|
||||||
- **mpc-nodes.yml**: Marked as deprecated (mpc-nodes directory removed)
|
|
||||||
- **mpc-tests.yml**: Marked as deprecated (mpc-service directory removed)
|
|
||||||
|
|
||||||
### 3. Infrastructure Components Verified
|
|
||||||
|
|
||||||
#### ✅ MPC (Multi-Party Computation)
|
|
||||||
- Native Go integration working
|
|
||||||
- 3-node setup (2-of-3 threshold)
|
|
||||||
- Mock tools for CI environment
|
|
||||||
|
|
||||||
#### ✅ KMS (Key Management Service)
|
|
||||||
- HashiCorp Vault integration configured
|
|
||||||
- Secure key storage for MPC operations
|
|
||||||
- Available on port 8200
|
|
||||||
|
|
||||||
#### ✅ Lux ID (Identity Management)
|
|
||||||
- Casdoor-based authentication system
|
|
||||||
- PostgreSQL backend on port 5434
|
|
||||||
- UI available on port 8000
|
|
||||||
|
|
||||||
#### ✅ Bridge Components
|
|
||||||
- Server API tested and building
|
|
||||||
- UI components building successfully
|
|
||||||
- Database migrations working
|
|
||||||
|
|
||||||
### 4. Package Fixes
|
|
||||||
- Resolved workspace name conflict (renamed bridge3 to @luxbridge/app-v3)
|
|
||||||
- Added packageManager field to root package.json
|
|
||||||
- Fixed pnpm version consistency
|
|
||||||
|
|
||||||
## Current Status
|
|
||||||
|
|
||||||
### Passing Workflows ✅
|
|
||||||
1. MPC E2E Tests
|
|
||||||
2. Bridge Server CI
|
|
||||||
3. Integration Tests
|
|
||||||
4. Build and Push Images
|
|
||||||
5. Server Deployment
|
|
||||||
|
|
||||||
### Infrastructure Services
|
|
||||||
- NATS (Messaging): Port 4222
|
|
||||||
- Consul (Service Discovery): Port 8500
|
|
||||||
- Vault (KMS): Port 8200
|
|
||||||
- Casdoor (Lux ID): Port 8000
|
|
||||||
- PostgreSQL: Ports 5432, 5433, 5434
|
|
||||||
|
|
||||||
### Security Notes
|
|
||||||
- 87 vulnerabilities reported by Dependabot (to be addressed separately)
|
|
||||||
- Snyk security scans set to continue-on-error
|
|
||||||
|
|
||||||
## Next Steps
|
|
||||||
1. Monitor CI runs on main branch after PR merge
|
|
||||||
2. Address security vulnerabilities
|
|
||||||
3. Add comprehensive integration tests for new MPC architecture
|
|
||||||
4. Document MPC tool installation for developers
|
|
||||||
|
|
||||||
## Verification
|
|
||||||
Run `gh workflow list --repo luxfi/bridge` to see all workflows are active and ready.
|
|
||||||
@@ -1,135 +0,0 @@
|
|||||||
# MPC Native Integration Deployment Status
|
|
||||||
|
|
||||||
## 📋 Summary
|
|
||||||
|
|
||||||
The MPC native integration has been successfully implemented and is ready for deployment. Due to network connectivity issues, the changes haven't been pushed yet.
|
|
||||||
|
|
||||||
## 🔄 Pending Changes
|
|
||||||
|
|
||||||
### Commits Ready to Push
|
|
||||||
1. `6ba129f` - **refactor: migrate MPC from Docker service to native Go integration**
|
|
||||||
- Removed app/mpc-service directory
|
|
||||||
- Added infrastructure services configuration
|
|
||||||
- Implemented native Go MPC tools integration
|
|
||||||
- Added comprehensive documentation
|
|
||||||
|
|
||||||
2. `ec521c6` - **ci: update workflows for new MPC architecture with E2E tests**
|
|
||||||
- Updated integration-tests.yml for new architecture
|
|
||||||
- Created mpc-e2e-tests.yml workflow
|
|
||||||
- Ensures proper testing of MPC network
|
|
||||||
|
|
||||||
### Tag Created
|
|
||||||
- `v1.0.0` - Major release with native MPC integration
|
|
||||||
|
|
||||||
## 🚀 Deployment Steps
|
|
||||||
|
|
||||||
When network connectivity is restored:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# 1. Push changes and create release
|
|
||||||
./push-and-release.sh
|
|
||||||
|
|
||||||
# 2. Or manually:
|
|
||||||
git push origin main
|
|
||||||
git push origin v1.0.0
|
|
||||||
gh release create v1.0.0 --title "v1.0.0: Native MPC Integration" --generate-notes
|
|
||||||
```
|
|
||||||
|
|
||||||
## ✅ Completed Tasks
|
|
||||||
|
|
||||||
- [x] Migrated MPC from Docker to native Go integration
|
|
||||||
- [x] Added infrastructure services (Lux ID, KMS, NATS, Consul)
|
|
||||||
- [x] Created E2E tests for new architecture
|
|
||||||
- [x] Updated CI/CD workflows
|
|
||||||
- [x] Created comprehensive documentation
|
|
||||||
- [x] Tagged version v1.0.0
|
|
||||||
|
|
||||||
## 🧪 Testing
|
|
||||||
|
|
||||||
### Local Testing
|
|
||||||
```bash
|
|
||||||
# Install MPC tools
|
|
||||||
make install-mpc
|
|
||||||
|
|
||||||
# Start infrastructure
|
|
||||||
make up
|
|
||||||
|
|
||||||
# Start MPC nodes
|
|
||||||
make start-mpc-nodes
|
|
||||||
|
|
||||||
# Run E2E tests
|
|
||||||
./test/test-mpc-e2e-simple.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
### CI/CD Testing
|
|
||||||
- New workflow: `.github/workflows/mpc-e2e-tests.yml`
|
|
||||||
- Updated workflow: `.github/workflows/integration-tests.yml`
|
|
||||||
|
|
||||||
## 📦 Key Changes
|
|
||||||
|
|
||||||
### Removed
|
|
||||||
- `/app/mpc-service/` - Entire Docker-based MPC service
|
|
||||||
|
|
||||||
### Added
|
|
||||||
- `/config/mpc/` - MPC configuration files
|
|
||||||
- `/scripts/install-mpc-tools.sh` - MPC tool installation
|
|
||||||
- `/scripts/start-mpc-network.sh` - Start MPC network
|
|
||||||
- `/scripts/stop-mpc-network.sh` - Stop MPC network
|
|
||||||
- `/docs/MPC-GO-INTEGRATION.md` - Integration guide
|
|
||||||
|
|
||||||
### Modified
|
|
||||||
- `Makefile` - Added MPC commands
|
|
||||||
- `README.md` - Updated with new architecture
|
|
||||||
- `.github/workflows/` - Updated CI/CD pipelines
|
|
||||||
- `compose.yml` - Added infrastructure services
|
|
||||||
|
|
||||||
## 🔧 Infrastructure Services
|
|
||||||
|
|
||||||
| Service | Port | Purpose |
|
|
||||||
|---------|------|---------|
|
|
||||||
| Lux ID (Casdoor) | 8000 | Unified authentication |
|
|
||||||
| KMS (Vault) | 8200 | Key management |
|
|
||||||
| NATS | 4223 | Message broker |
|
|
||||||
| Consul | 8501 | Service discovery |
|
|
||||||
| PostgreSQL | 5433 | Bridge database |
|
|
||||||
| Lux ID DB | 5434 | Auth database |
|
|
||||||
|
|
||||||
## 📈 Performance Improvements
|
|
||||||
|
|
||||||
- **No Docker overhead** - Native Go binaries
|
|
||||||
- **Direct integration** - Uses github.com/luxfi/mpc package
|
|
||||||
- **Better resource usage** - Reduced memory footprint
|
|
||||||
- **Faster startup** - No container initialization
|
|
||||||
|
|
||||||
## 🔍 Status Checks
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Check CI/CD status
|
|
||||||
./check-ci-status.sh
|
|
||||||
|
|
||||||
# Check MPC nodes
|
|
||||||
lux-mpc-cli status --url http://localhost:6000
|
|
||||||
|
|
||||||
# View logs
|
|
||||||
tail -f logs/node0.log
|
|
||||||
```
|
|
||||||
|
|
||||||
## 📝 Notes
|
|
||||||
|
|
||||||
- All changes are committed locally
|
|
||||||
- Network issues preventing push to GitHub
|
|
||||||
- CI/CD workflows updated and ready
|
|
||||||
- Documentation complete
|
|
||||||
- Release notes prepared
|
|
||||||
|
|
||||||
## 🆘 Troubleshooting
|
|
||||||
|
|
||||||
If push continues to fail:
|
|
||||||
1. Check SSH connection: `ssh -T [email protected]`
|
|
||||||
2. Try HTTPS: `git remote set-url origin https://github.com/luxfi/bridge.git`
|
|
||||||
3. Use patch files: `0001-*.patch` and `0002-*.patch` created
|
|
||||||
4. Contact repository admin for direct assistance
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
*Last updated: $(date)*
|
|
||||||
@@ -49,7 +49,7 @@ build-ui:
|
|||||||
docker buildx build --platform linux/amd64,linux/arm64 \
|
docker buildx build --platform linux/amd64,linux/arm64 \
|
||||||
-t ghcr.io/luxfi/bridge-ui:latest \
|
-t ghcr.io/luxfi/bridge-ui:latest \
|
||||||
-f app/bridge/Dockerfile \
|
-f app/bridge/Dockerfile \
|
||||||
app/bridge/
|
.
|
||||||
|
|
||||||
# Push images to ghcr.io/luxfi
|
# Push images to ghcr.io/luxfi
|
||||||
push: build
|
push: build
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ packages are internal workspace deps and are never published.
|
|||||||
| `@luxfi/core` | public (npm) | Shared types (Asset, Network, Contract, ...). |
|
| `@luxfi/core` | public (npm) | Shared types (Asset, Network, Contract, ...). |
|
||||||
| `@luxfi/threshold` | public (npm) | T-Chain MPC threshold-signature SDK. |
|
| `@luxfi/threshold` | public (npm) | T-Chain MPC threshold-signature SDK. |
|
||||||
| `@luxfi/utila` | public (npm) | Utila protobuf client. |
|
| `@luxfi/utila` | public (npm) | Utila protobuf client. |
|
||||||
| `@luxbridge/app` | private (workspace) | The bridge React UI (Vite SPA). |
|
| `@luxbridge/lux-tenant` | private (workspace) | Slim Vite SPA for bridge.lux.network — consumes `@luxfi/bridge`. |
|
||||||
| `@luxbridge/settings` | private (workspace) | Network + asset registry. |
|
| `@luxbridge/settings` | private (workspace) | Network + asset registry. |
|
||||||
| `@luxbridge/explorer` | private (workspace) | On-chain explorer UI. |
|
| `@luxbridge/explorer` | private (workspace) | On-chain explorer UI. |
|
||||||
| `@luxbridge/server` | private (workspace) | Bridge API daemon. |
|
| `@luxbridge/server` | private (workspace) | Bridge API daemon. |
|
||||||
@@ -105,7 +105,7 @@ cd app/bridge && pnpm dev
|
|||||||
|
|
||||||
### 5. Access Services
|
### 5. Access Services
|
||||||
|
|
||||||
- Bridge UI: http://localhost:3000
|
- Bridge UI: http://localhost:3001
|
||||||
- Bridge API: http://localhost:5000
|
- Bridge API: http://localhost:5000
|
||||||
- Lux ID Admin: http://localhost:8000
|
- Lux ID Admin: http://localhost:8000
|
||||||
- Consul UI: http://localhost:8501
|
- Consul UI: http://localhost:8501
|
||||||
|
|||||||
@@ -1,188 +0,0 @@
|
|||||||
# GitHub Workflows Summary
|
|
||||||
|
|
||||||
## What Each Workflow Does
|
|
||||||
|
|
||||||
### 🔨 Build Workflows
|
|
||||||
|
|
||||||
#### **build-and-push.yml**
|
|
||||||
- **Triggers**: Push to main, PRs, manual
|
|
||||||
- **What it builds**:
|
|
||||||
- Bridge server Docker image (multi-platform: amd64, arm64)
|
|
||||||
- Bridge UI Docker image (multi-platform: amd64, arm64)
|
|
||||||
- **What it tests**: Nothing
|
|
||||||
- **Output**: Docker images pushed to ghcr.io/luxfi/bridge-server and ghcr.io/luxfi/bridge-ui
|
|
||||||
|
|
||||||
#### **server.yml** (Deployment)
|
|
||||||
- **Triggers**: Push to main (server changes only)
|
|
||||||
- **What it does**:
|
|
||||||
- Builds server Docker image
|
|
||||||
- Pushes to GitHub Container Registry
|
|
||||||
- Deploys to Kubernetes cluster
|
|
||||||
- **What it tests**: Nothing
|
|
||||||
- **Output**: Live deployment
|
|
||||||
|
|
||||||
### 🧪 Test Workflows
|
|
||||||
|
|
||||||
#### **bridge-server.yml**
|
|
||||||
- **Triggers**: Push/PR to main/develop (server changes)
|
|
||||||
- **What it tests**:
|
|
||||||
- TypeScript type checking
|
|
||||||
- ESLint code quality
|
|
||||||
- Builds server successfully
|
|
||||||
- **Missing**: Unit tests, integration tests
|
|
||||||
|
|
||||||
#### **integration-tests.yml**
|
|
||||||
- **Triggers**: Push/PR to main/develop, daily at 2 AM UTC
|
|
||||||
- **What it tests**:
|
|
||||||
- PostgreSQL database connectivity
|
|
||||||
- NATS messaging system
|
|
||||||
- Consul service discovery
|
|
||||||
- Basic API endpoints
|
|
||||||
- Mock MPC operations
|
|
||||||
- **Services**: PostgreSQL, NATS, Consul
|
|
||||||
- **Missing**: Vault (KMS), Casdoor (ID), real MPC
|
|
||||||
|
|
||||||
#### **mpc-e2e-tests.yml**
|
|
||||||
- **Triggers**: Push/PR (MPC-related changes), manual
|
|
||||||
- **What it tests**:
|
|
||||||
- MPC node startup (mocked)
|
|
||||||
- NATS connectivity
|
|
||||||
- Consul registration
|
|
||||||
- Basic MPC operations (mocked)
|
|
||||||
- **Services**: NATS, Consul
|
|
||||||
- **Missing**: Real MPC binaries, Vault, Casdoor
|
|
||||||
|
|
||||||
#### **full-integration-tests.yml** (NEW)
|
|
||||||
- **Triggers**: Push/PR to main/develop, daily at 3 AM UTC, manual
|
|
||||||
- **What it tests**:
|
|
||||||
- ✅ ALL services together (PostgreSQL, NATS, Consul, Vault, Redis, Casdoor)
|
|
||||||
- ✅ Complete authentication flow
|
|
||||||
- ✅ KMS key management
|
|
||||||
- ✅ MPC network operations
|
|
||||||
- ✅ Full bridge API
|
|
||||||
- ✅ Service discovery
|
|
||||||
- ✅ Performance benchmarks
|
|
||||||
- ✅ Security audits
|
|
||||||
- **Special**: Most comprehensive test suite
|
|
||||||
|
|
||||||
### 📊 Current Test Coverage
|
|
||||||
|
|
||||||
| Component | Unit Tests | Integration Tests | E2E Tests |
|
|
||||||
|-----------|------------|-------------------|-----------|
|
|
||||||
| Bridge Server | ❌ | ⚠️ Partial | ⚠️ Partial |
|
|
||||||
| Bridge UI | ❌ | ❌ | ❌ |
|
|
||||||
| MPC Network | ❌ | ⚠️ Mocked | ⚠️ Mocked |
|
|
||||||
| Casdoor (ID) | ❌ | ✅ (full-integration) | ✅ (full-integration) |
|
|
||||||
| Vault (KMS) | ❌ | ✅ (full-integration) | ✅ (full-integration) |
|
|
||||||
| Database | ❌ | ✅ | ✅ |
|
|
||||||
| Message Queue | ❌ | ✅ | ✅ |
|
|
||||||
| Service Discovery | ❌ | ✅ | ✅ |
|
|
||||||
|
|
||||||
### 🔄 Workflow Dependencies
|
|
||||||
|
|
||||||
```mermaid
|
|
||||||
graph LR
|
|
||||||
A[Code Push] --> B[bridge-server.yml]
|
|
||||||
A --> C[integration-tests.yml]
|
|
||||||
A --> D[mpc-e2e-tests.yml]
|
|
||||||
A --> E[build-and-push.yml]
|
|
||||||
|
|
||||||
B --> F[Type Check & Lint]
|
|
||||||
C --> G[Integration Tests]
|
|
||||||
D --> H[MPC Tests]
|
|
||||||
E --> I[Docker Images]
|
|
||||||
|
|
||||||
I --> J[server.yml]
|
|
||||||
J --> K[Deploy to K8s]
|
|
||||||
|
|
||||||
A --> L[full-integration-tests.yml]
|
|
||||||
L --> M[Complete System Test]
|
|
||||||
```
|
|
||||||
|
|
||||||
### 🚀 Workflow Execution Order
|
|
||||||
|
|
||||||
1. **On Code Push**:
|
|
||||||
- bridge-server.yml (if server changed)
|
|
||||||
- integration-tests.yml
|
|
||||||
- mpc-e2e-tests.yml (if MPC changed)
|
|
||||||
- build-and-push.yml
|
|
||||||
- full-integration-tests.yml
|
|
||||||
|
|
||||||
2. **On Successful Build**:
|
|
||||||
- server.yml (deploys to production)
|
|
||||||
|
|
||||||
3. **Daily**:
|
|
||||||
- integration-tests.yml (2 AM UTC)
|
|
||||||
- full-integration-tests.yml (3 AM UTC)
|
|
||||||
|
|
||||||
### ✅ What's Working
|
|
||||||
|
|
||||||
1. **Build Process**: All components build successfully
|
|
||||||
2. **Basic Integration**: Services connect and communicate
|
|
||||||
3. **Deployment**: Automated deployment to Kubernetes
|
|
||||||
4. **Service Mesh**: NATS, Consul working correctly
|
|
||||||
5. **Database**: PostgreSQL migrations and queries work
|
|
||||||
|
|
||||||
### ❌ What's Missing
|
|
||||||
|
|
||||||
1. **Real MPC Testing**: All MPC tests use mocks
|
|
||||||
2. **Unit Tests**: No component has unit tests
|
|
||||||
3. **UI Testing**: No frontend tests
|
|
||||||
4. **Performance Tests**: No load/stress testing
|
|
||||||
5. **Security Scans**: Limited security testing
|
|
||||||
|
|
||||||
### 🎯 Recommended Workflow Improvements
|
|
||||||
|
|
||||||
1. **Add Unit Test Workflow**
|
|
||||||
```yaml
|
|
||||||
name: Unit Tests
|
|
||||||
on: [push, pull_request]
|
|
||||||
jobs:
|
|
||||||
test-server:
|
|
||||||
- Run Jest tests for server
|
|
||||||
test-ui:
|
|
||||||
- Run React tests for UI
|
|
||||||
```
|
|
||||||
|
|
||||||
2. **Add Security Workflow**
|
|
||||||
```yaml
|
|
||||||
name: Security Audit
|
|
||||||
on: [push, schedule]
|
|
||||||
jobs:
|
|
||||||
dependency-scan:
|
|
||||||
- Run npm audit
|
|
||||||
- Run Snyk scan
|
|
||||||
container-scan:
|
|
||||||
- Scan Docker images
|
|
||||||
```
|
|
||||||
|
|
||||||
3. **Add Performance Workflow**
|
|
||||||
```yaml
|
|
||||||
name: Performance Tests
|
|
||||||
on: [schedule, workflow_dispatch]
|
|
||||||
jobs:
|
|
||||||
load-test:
|
|
||||||
- Run k6 or JMeter tests
|
|
||||||
- Compare against baselines
|
|
||||||
```
|
|
||||||
|
|
||||||
### 📋 Quick Reference
|
|
||||||
|
|
||||||
- **Need to test a server change?** → bridge-server.yml runs automatically
|
|
||||||
- **Need to test integration?** → integration-tests.yml or trigger full-integration-tests.yml
|
|
||||||
- **Need to test MPC?** → mpc-e2e-tests.yml (but it's mocked)
|
|
||||||
- **Need to deploy?** → Push to main, server.yml handles it
|
|
||||||
- **Need full system test?** → Run full-integration-tests.yml manually
|
|
||||||
|
|
||||||
### 🔧 Manual Workflow Triggers
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Run full integration tests
|
|
||||||
gh workflow run "Full Integration Tests" --repo luxfi/bridge
|
|
||||||
|
|
||||||
# Run MPC E2E tests
|
|
||||||
gh workflow run "MPC E2E Tests" --repo luxfi/bridge
|
|
||||||
|
|
||||||
# Check workflow status
|
|
||||||
gh run list --repo luxfi/bridge --limit 5
|
|
||||||
```
|
|
||||||
@@ -1,192 +0,0 @@
|
|||||||
# GitHub Workflows Audit Report
|
|
||||||
|
|
||||||
## Overview
|
|
||||||
This document provides a comprehensive audit of all GitHub Actions workflows in the Bridge project, detailing what each workflow does and identifying gaps in integration testing.
|
|
||||||
|
|
||||||
## Current Workflows
|
|
||||||
|
|
||||||
### 1. **bridge-server.yml** - Bridge Server CI
|
|
||||||
**Purpose**: Build and test the bridge server component
|
|
||||||
**What it does**:
|
|
||||||
- ✅ Type checking
|
|
||||||
- ✅ Linting
|
|
||||||
- ✅ Building server
|
|
||||||
- ✅ Docker image creation
|
|
||||||
- ❌ No unit tests (skipped)
|
|
||||||
- ❌ No integration tests
|
|
||||||
|
|
||||||
**Components tested**: Bridge server only
|
|
||||||
**Integration coverage**: None
|
|
||||||
|
|
||||||
### 2. **integration-tests.yml** - E2E Integration Tests
|
|
||||||
**Purpose**: Test integration between components
|
|
||||||
**What it does**:
|
|
||||||
- ✅ Sets up PostgreSQL, NATS, Consul
|
|
||||||
- ✅ Runs database migrations
|
|
||||||
- ✅ Starts bridge server
|
|
||||||
- ✅ Tests basic API endpoints
|
|
||||||
- ✅ Tests service connectivity
|
|
||||||
- ⚠️ Uses mock MPC tools (not real)
|
|
||||||
- ❌ No Vault (KMS) integration
|
|
||||||
- ❌ No Casdoor (ID) integration
|
|
||||||
|
|
||||||
**Components tested**: Bridge, PostgreSQL, NATS, Consul, Mock MPC
|
|
||||||
**Integration coverage**: Partial (missing ID and KMS)
|
|
||||||
|
|
||||||
### 3. **mpc-e2e-tests.yml** - MPC End-to-End Tests
|
|
||||||
**Purpose**: Test MPC network setup and operations
|
|
||||||
**What it does**:
|
|
||||||
- ✅ Sets up NATS and Consul
|
|
||||||
- ✅ Creates MPC configuration
|
|
||||||
- ✅ Starts 3 MPC nodes
|
|
||||||
- ✅ Tests node connectivity
|
|
||||||
- ⚠️ Uses mock MPC binaries
|
|
||||||
- ❌ No real signature generation
|
|
||||||
- ❌ No KMS integration
|
|
||||||
- ❌ No ID integration
|
|
||||||
|
|
||||||
**Components tested**: Mock MPC, NATS, Consul
|
|
||||||
**Integration coverage**: Limited (mock only)
|
|
||||||
|
|
||||||
### 4. **build-and-push.yml** - Build and Push Images
|
|
||||||
**Purpose**: Build Docker images and push to registry
|
|
||||||
**What it does**:
|
|
||||||
- ✅ Builds bridge-server image
|
|
||||||
- ✅ Builds bridge-ui image
|
|
||||||
- ✅ Multi-platform support (amd64, arm64)
|
|
||||||
- ✅ Pushes to GitHub Container Registry
|
|
||||||
- ❌ No testing before build
|
|
||||||
|
|
||||||
**Components tested**: None (build only)
|
|
||||||
**Integration coverage**: None
|
|
||||||
|
|
||||||
### 5. **server.yml** - Server Deployment
|
|
||||||
**Purpose**: Deploy bridge server to Kubernetes
|
|
||||||
**What it does**:
|
|
||||||
- ✅ Builds Docker image
|
|
||||||
- ✅ Pushes to registry
|
|
||||||
- ✅ Deploys to Kubernetes
|
|
||||||
- ❌ No pre-deployment tests
|
|
||||||
- ❌ No post-deployment verification
|
|
||||||
|
|
||||||
**Components tested**: None (deployment only)
|
|
||||||
**Integration coverage**: None
|
|
||||||
|
|
||||||
### 6. **mpc-nodes.yml** [DEPRECATED]
|
|
||||||
**Purpose**: Previously built MPC node images
|
|
||||||
**Status**: Deprecated - directory removed
|
|
||||||
|
|
||||||
### 7. **mpc-tests.yml** [DEPRECATED]
|
|
||||||
**Purpose**: Previously tested MPC service
|
|
||||||
**Status**: Deprecated - directory removed
|
|
||||||
|
|
||||||
## Missing Integration Testing
|
|
||||||
|
|
||||||
### 1. **Identity Service (Casdoor/Lux ID)**
|
|
||||||
- Not tested in any workflow
|
|
||||||
- No authentication flow testing
|
|
||||||
- No OAuth/OIDC integration tests
|
|
||||||
- No user management tests
|
|
||||||
|
|
||||||
### 2. **Key Management Service (Vault)**
|
|
||||||
- Not included in any workflow
|
|
||||||
- No key storage/retrieval tests
|
|
||||||
- No encryption/decryption tests
|
|
||||||
- No MPC key management tests
|
|
||||||
|
|
||||||
### 3. **Full System Integration**
|
|
||||||
No workflow tests the complete flow:
|
|
||||||
```
|
|
||||||
User Auth (Casdoor) → Key Retrieval (Vault) → MPC Signing → Bridge Operation
|
|
||||||
```
|
|
||||||
|
|
||||||
### 4. **Cross-Chain Operations**
|
|
||||||
- No actual blockchain interaction tests
|
|
||||||
- No token minting/burning tests
|
|
||||||
- No cross-chain transfer simulations
|
|
||||||
|
|
||||||
### 5. **Real MPC Operations**
|
|
||||||
- All workflows use mock MPC tools
|
|
||||||
- No real threshold signature tests
|
|
||||||
- No distributed key generation tests
|
|
||||||
|
|
||||||
### 6. **Performance Testing**
|
|
||||||
- No load testing
|
|
||||||
- No stress testing
|
|
||||||
- No performance benchmarks
|
|
||||||
|
|
||||||
## New Workflow Added
|
|
||||||
|
|
||||||
### **full-integration-tests.yml** - Comprehensive Integration Testing
|
|
||||||
**Purpose**: Test all components working together
|
|
||||||
**What it does**:
|
|
||||||
- ✅ Sets up ALL services (PostgreSQL, NATS, Consul, Vault, Redis, Casdoor)
|
|
||||||
- ✅ Initializes Vault with test keys
|
|
||||||
- ✅ Starts Casdoor for authentication
|
|
||||||
- ✅ Configures MPC network with KMS integration
|
|
||||||
- ✅ Tests ID → KMS → MPC → Bridge flow
|
|
||||||
- ✅ Tests all component health checks
|
|
||||||
- ✅ Runs existing test scripts
|
|
||||||
- ✅ Includes performance and security audit jobs
|
|
||||||
|
|
||||||
**Components tested**: All components
|
|
||||||
**Integration coverage**: Full system integration
|
|
||||||
|
|
||||||
## Recommendations
|
|
||||||
|
|
||||||
### 1. **Enable Real MPC Testing**
|
|
||||||
- Provide access to MPC repository
|
|
||||||
- Build real MPC binaries in CI
|
|
||||||
- Test actual threshold signatures
|
|
||||||
|
|
||||||
### 2. **Add Component-Specific Tests**
|
|
||||||
- Create vault-integration-tests.yml
|
|
||||||
- Create casdoor-integration-tests.yml
|
|
||||||
- Create mpc-real-tests.yml
|
|
||||||
|
|
||||||
### 3. **Implement Mock Blockchain Testing**
|
|
||||||
- Use Hardhat/Ganache for local chains
|
|
||||||
- Test actual bridge operations
|
|
||||||
- Verify token transfers
|
|
||||||
|
|
||||||
### 4. **Add Monitoring Tests**
|
|
||||||
- Prometheus metrics validation
|
|
||||||
- Grafana dashboard checks
|
|
||||||
- Alert testing
|
|
||||||
|
|
||||||
### 5. **Security Testing**
|
|
||||||
- OWASP dependency checks
|
|
||||||
- Container scanning
|
|
||||||
- Penetration testing simulations
|
|
||||||
|
|
||||||
### 6. **Performance Baselines**
|
|
||||||
- Establish performance benchmarks
|
|
||||||
- Track regression over time
|
|
||||||
- Load test critical paths
|
|
||||||
|
|
||||||
## Workflow Execution Matrix
|
|
||||||
|
|
||||||
| Workflow | Build | Test | Integration | Deploy | Security |
|
|
||||||
|----------|-------|------|-------------|---------|----------|
|
|
||||||
| bridge-server.yml | ✅ | ⚠️ | ❌ | ❌ | ❌ |
|
|
||||||
| integration-tests.yml | ❌ | ✅ | ⚠️ | ❌ | ✅ |
|
|
||||||
| mpc-e2e-tests.yml | ❌ | ✅ | ⚠️ | ❌ | ❌ |
|
|
||||||
| build-and-push.yml | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
||||||
| server.yml | ✅ | ❌ | ❌ | ✅ | ❌ |
|
|
||||||
| full-integration-tests.yml | ✅ | ✅ | ✅ | ❌ | ✅ |
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
Current workflows provide basic CI/CD but lack comprehensive integration testing. The new `full-integration-tests.yml` workflow addresses these gaps by:
|
|
||||||
|
|
||||||
1. Testing all components together (ID, KMS, MPC, Bridge)
|
|
||||||
2. Validating service interactions
|
|
||||||
3. Running end-to-end scenarios
|
|
||||||
4. Including performance and security testing
|
|
||||||
|
|
||||||
To achieve full coverage, the project needs:
|
|
||||||
- Real MPC binary access
|
|
||||||
- Mock blockchain environments
|
|
||||||
- More comprehensive test scripts
|
|
||||||
- Performance baselines
|
|
||||||
- Security scanning integration
|
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
# syntax=docker/dockerfile:1.7
|
||||||
|
#
|
||||||
|
# bridge.lux.network — Vite SPA served by ghcr.io/hanzoai/spa.
|
||||||
|
# Build context: repo root (pnpm workspace so @luxfi/bridge resolves
|
||||||
|
# to the sibling pkg/bridge package).
|
||||||
|
|
||||||
|
FROM node:22-alpine AS build
|
||||||
|
RUN apk add --no-cache libc6-compat python3 make g++ git
|
||||||
|
RUN corepack enable
|
||||||
|
WORKDIR /app
|
||||||
|
COPY . .
|
||||||
|
RUN pnpm install --frozen-lockfile || pnpm install
|
||||||
|
RUN pnpm -C app/bridge build
|
||||||
|
|
||||||
|
FROM ghcr.io/hanzoai/spa
|
||||||
|
COPY --from=build /app/app/bridge/dist /public
|
||||||
@@ -8,14 +8,16 @@
|
|||||||
# docker build -f cmd/bridge/Dockerfile -t ghcr.io/luxfi/bridge:dev .
|
# docker build -f cmd/bridge/Dockerfile -t ghcr.io/luxfi/bridge:dev .
|
||||||
|
|
||||||
# ── 1. UI build ───────────────────────────────────────────────────────────
|
# ── 1. UI build ───────────────────────────────────────────────────────────
|
||||||
|
# Build context: repo root (pnpm workspace). app/bridge depends on
|
||||||
|
# @luxfi/bridge via `workspace:*`, so the whole monorepo must be in scope
|
||||||
|
# for pnpm to resolve the sibling package.
|
||||||
FROM node:20-alpine AS ui-build
|
FROM node:20-alpine AS ui-build
|
||||||
WORKDIR /ui
|
WORKDIR /repo
|
||||||
RUN corepack enable && corepack prepare pnpm@9.0.0 --activate
|
RUN corepack enable && corepack prepare pnpm@9.15.0 --activate
|
||||||
COPY app/bridge/package.json app/bridge/pnpm-lock.yaml* ./
|
COPY . .
|
||||||
RUN pnpm install --frozen-lockfile || pnpm install
|
RUN pnpm install --frozen-lockfile || pnpm install
|
||||||
COPY app/bridge/ ./
|
RUN pnpm -C app/bridge build && \
|
||||||
RUN pnpm build && \
|
cp -r app/bridge/dist /ui-out
|
||||||
if [ -d dist ]; then mv dist out; fi
|
|
||||||
|
|
||||||
# ── 2. Go build ───────────────────────────────────────────────────────────
|
# ── 2. Go build ───────────────────────────────────────────────────────────
|
||||||
FROM golang:1.26.3-alpine AS go-build
|
FROM golang:1.26.3-alpine AS go-build
|
||||||
@@ -26,7 +28,7 @@ RUN go mod download
|
|||||||
COPY cmd/ cmd/
|
COPY cmd/ cmd/
|
||||||
# Replace placeholder static/ with the real UI build.
|
# Replace placeholder static/ with the real UI build.
|
||||||
RUN rm -rf cmd/bridge/static && mkdir -p cmd/bridge/static
|
RUN rm -rf cmd/bridge/static && mkdir -p cmd/bridge/static
|
||||||
COPY --from=ui-build /ui/out/ cmd/bridge/static/
|
COPY --from=ui-build /ui-out/ cmd/bridge/static/
|
||||||
ARG VERSION=dev
|
ARG VERSION=dev
|
||||||
RUN CGO_ENABLED=0 go build -trimpath \
|
RUN CGO_ENABLED=0 go build -trimpath \
|
||||||
-ldflags "-s -w -X main.version=${VERSION}" \
|
-ldflags "-s -w -X main.version=${VERSION}" \
|
||||||
|
|||||||
@@ -36,10 +36,11 @@ pnpm dev
|
|||||||
The compose files are configured to use `ghcr.io/luxfi` images, but they need to be built and pushed first:
|
The compose files are configured to use `ghcr.io/luxfi` images, but they need to be built and pushed first:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Build images
|
# Build images (UI build context is repo root — pnpm workspace
|
||||||
|
# resolves @luxfi/bridge to the sibling pkg/bridge package).
|
||||||
docker build -t ghcr.io/luxfi/bridge-mpc:latest ./mpc-service
|
docker build -t ghcr.io/luxfi/bridge-mpc:latest ./mpc-service
|
||||||
docker build -t ghcr.io/luxfi/bridge-server:latest ./app/server
|
docker build -t ghcr.io/luxfi/bridge-server:latest ./app/server
|
||||||
docker build -t ghcr.io/luxfi/bridge-ui:latest ./app/bridge
|
docker build -t ghcr.io/luxfi/bridge-ui:latest -f app/bridge/Dockerfile .
|
||||||
|
|
||||||
# Push to registry (requires login)
|
# Push to registry (requires login)
|
||||||
docker push ghcr.io/luxfi/bridge-mpc:latest
|
docker push ghcr.io/luxfi/bridge-mpc:latest
|
||||||
|
|||||||
@@ -96,8 +96,8 @@ docker build -f app/mpc-service/Dockerfile .
|
|||||||
# Bridge Server
|
# Bridge Server
|
||||||
docker build -f app/server/Dockerfile app/server/
|
docker build -f app/server/Dockerfile app/server/
|
||||||
|
|
||||||
# Bridge UI
|
# Bridge UI (build context is repo root — pnpm workspace)
|
||||||
docker build -f app/bridge/Dockerfile app/bridge/
|
docker build -f app/bridge/Dockerfile .
|
||||||
```
|
```
|
||||||
|
|
||||||
## Security
|
## Security
|
||||||
|
|||||||
+2
-3
@@ -20,8 +20,7 @@ Zoo, Liquidity, any white-label) import `@luxfi/bridge` and nothing else.
|
|||||||
| `pkg/utila/` | `@luxfi/utila` | public utila client | yes |
|
| `pkg/utila/` | `@luxfi/utila` | public utila client | yes |
|
||||||
| `pkg/settings/` | `@luxbridge/settings` | private workspace | no |
|
| `pkg/settings/` | `@luxbridge/settings` | private workspace | no |
|
||||||
| `pkg/ui/` | `@luxbridge/ui-automation` | private workspace | no |
|
| `pkg/ui/` | `@luxbridge/ui-automation` | private workspace | no |
|
||||||
| `app/bridge/` | `@luxbridge/app` | private workspace | no |
|
| `app/bridge/` | `@luxbridge/lux-tenant` | private workspace | no |
|
||||||
| `app/bridge3/` | `@luxbridge/app-v3` | private workspace | no |
|
|
||||||
| `app/explorer/` | `@luxbridge/explorer` | private workspace | no |
|
| `app/explorer/` | `@luxbridge/explorer` | private workspace | no |
|
||||||
| `app/server/` | `@luxbridge/server` | private workspace | no |
|
| `app/server/` | `@luxbridge/server` | private workspace | no |
|
||||||
|
|
||||||
@@ -143,7 +142,7 @@ make up
|
|||||||
make start-mpc-nodes
|
make start-mpc-nodes
|
||||||
|
|
||||||
# Start services
|
# Start services
|
||||||
cd app/bridge && pnpm dev # UI on :3000
|
cd app/bridge && pnpm dev # UI on :3001
|
||||||
cd app/server && pnpm dev # API on :5000
|
cd app/server && pnpm dev # API on :5000
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
+3
-2
@@ -55,10 +55,11 @@ echo $GITHUB_TOKEN | docker login ghcr.io -u USERNAME --password-stdin
|
|||||||
|
|
||||||
2. **Build and Push Images**:
|
2. **Build and Push Images**:
|
||||||
```bash
|
```bash
|
||||||
# Build images locally first
|
# Build images locally first (UI build context is repo root — pnpm
|
||||||
|
# workspace resolves @luxfi/bridge to the sibling pkg/bridge package).
|
||||||
docker build -t ghcr.io/luxfi/bridge-mpc:latest ./mpc-service
|
docker build -t ghcr.io/luxfi/bridge-mpc:latest ./mpc-service
|
||||||
docker build -t ghcr.io/luxfi/bridge-server:latest ./app/server
|
docker build -t ghcr.io/luxfi/bridge-server:latest ./app/server
|
||||||
docker build -t ghcr.io/luxfi/bridge-ui:latest ./app/bridge
|
docker build -t ghcr.io/luxfi/bridge-ui:latest -f app/bridge/Dockerfile .
|
||||||
|
|
||||||
# Push to registry
|
# Push to registry
|
||||||
docker push ghcr.io/luxfi/bridge-mpc:latest
|
docker push ghcr.io/luxfi/bridge-mpc:latest
|
||||||
|
|||||||
@@ -1,270 +0,0 @@
|
|||||||
const { chromium } = require('playwright');
|
|
||||||
const fs = require('fs');
|
|
||||||
const path = require('path');
|
|
||||||
|
|
||||||
const SCREENSHOT_DIR = '/tmp/bridge-ui-screenshots';
|
|
||||||
|
|
||||||
async function ensureScreenshotDir() {
|
|
||||||
if (!fs.existsSync(SCREENSHOT_DIR)) {
|
|
||||||
fs.mkdirSync(SCREENSHOT_DIR, { recursive: true });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function runTests() {
|
|
||||||
const browser = await chromium.launch({
|
|
||||||
headless: true,
|
|
||||||
args: ['--disable-blink-features=AutomationControlled'],
|
|
||||||
});
|
|
||||||
|
|
||||||
const context = await browser.newContext({
|
|
||||||
viewport: { width: 1280, height: 720 },
|
|
||||||
ignoreHTTPSErrors: true,
|
|
||||||
});
|
|
||||||
|
|
||||||
const page = await context.newPage();
|
|
||||||
|
|
||||||
// Capture console logs
|
|
||||||
const consoleLogs = [];
|
|
||||||
page.on('console', (msg) => {
|
|
||||||
consoleLogs.push({
|
|
||||||
type: msg.type(),
|
|
||||||
text: msg.text(),
|
|
||||||
location: msg.location(),
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
// Capture console errors
|
|
||||||
const pageErrors = [];
|
|
||||||
page.on('pageerror', (error) => {
|
|
||||||
pageErrors.push({
|
|
||||||
message: error.message,
|
|
||||||
stack: error.stack,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
await ensureScreenshotDir();
|
|
||||||
|
|
||||||
console.log('🌐 Starting UI inspection of https://bridge.lux.network');
|
|
||||||
console.log('📸 Screenshots will be saved to:', SCREENSHOT_DIR);
|
|
||||||
console.log('');
|
|
||||||
|
|
||||||
try {
|
|
||||||
// Navigate to the page
|
|
||||||
console.log('⏳ Loading https://bridge.lux.network...');
|
|
||||||
const response = await page.goto('https://bridge.lux.network', {
|
|
||||||
waitUntil: 'networkidle',
|
|
||||||
timeout: 30000,
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log(`✅ Page loaded with status: ${response.status()}`);
|
|
||||||
console.log('');
|
|
||||||
|
|
||||||
// Wait for React/Next.js to fully hydrate
|
|
||||||
console.log('⏳ Waiting for application to hydrate...');
|
|
||||||
|
|
||||||
// Wait for more substantial content to load
|
|
||||||
try {
|
|
||||||
// Try to wait for the main bridge form or any interactive content
|
|
||||||
await Promise.race([
|
|
||||||
page.waitForSelector('input, button[type="submit"], [role="button"]', { timeout: 15000 }),
|
|
||||||
page.waitForTimeout(12000),
|
|
||||||
]);
|
|
||||||
console.log(' ✓ Interactive elements found or timeout');
|
|
||||||
} catch (e) {
|
|
||||||
console.log(' (Continuing despite wait timeout)');
|
|
||||||
}
|
|
||||||
|
|
||||||
await page.waitForTimeout(2000);
|
|
||||||
|
|
||||||
// Screenshot 1: Full page
|
|
||||||
console.log('📷 Taking screenshot of full page...');
|
|
||||||
await page.screenshot({
|
|
||||||
path: path.join(SCREENSHOT_DIR, '01-full-page.png'),
|
|
||||||
fullPage: true,
|
|
||||||
});
|
|
||||||
console.log('✅ Saved: 01-full-page.png');
|
|
||||||
|
|
||||||
// Check for blank white page
|
|
||||||
const bodyColor = await page.evaluate(() => {
|
|
||||||
const style = window.getComputedStyle(document.body);
|
|
||||||
return style.backgroundColor;
|
|
||||||
});
|
|
||||||
console.log(`📊 Body background color: ${bodyColor}`);
|
|
||||||
|
|
||||||
// Get page title
|
|
||||||
const title = await page.title();
|
|
||||||
console.log(`📄 Page title: "${title}"`);
|
|
||||||
|
|
||||||
// Check for main content
|
|
||||||
const mainContent = await page.locator('main, [role="main"], .main').first().isVisible().catch(() => false);
|
|
||||||
console.log(`🎯 Main content visible: ${mainContent}`);
|
|
||||||
|
|
||||||
// Check header
|
|
||||||
console.log('');
|
|
||||||
console.log('🔍 Checking header elements...');
|
|
||||||
const header = await page.locator('header').first();
|
|
||||||
const headerVisible = await header.isVisible().catch(() => false);
|
|
||||||
console.log(` Header visible: ${headerVisible}`);
|
|
||||||
|
|
||||||
// Look for Lux logo
|
|
||||||
const logo = await page.locator('img[alt*="Lux"], img[alt*="Logo"], a:has-text("Lux")').first();
|
|
||||||
const logoVisible = await logo.isVisible().catch(() => false);
|
|
||||||
console.log(` Lux logo/branding visible: ${logoVisible}`);
|
|
||||||
|
|
||||||
// Look for Connect button
|
|
||||||
const connectBtn = await page.locator('button:has-text("Connect"), button:has-text("Wallet")').first();
|
|
||||||
const connectVisible = await connectBtn.isVisible().catch(() => false);
|
|
||||||
console.log(` Connect/Wallet button visible: ${connectVisible}`);
|
|
||||||
|
|
||||||
// Check theme
|
|
||||||
console.log('');
|
|
||||||
console.log('🎨 Checking theme/colors...');
|
|
||||||
const htmlClass = await page.evaluate(() => document.documentElement.className);
|
|
||||||
const htmlAttr = await page.evaluate(() => document.documentElement.getAttribute('data-theme') || document.documentElement.getAttribute('class'));
|
|
||||||
console.log(` HTML class/theme: "${htmlAttr}"`);
|
|
||||||
|
|
||||||
// Check for dark mode indicators
|
|
||||||
const isDarkMode = await page.evaluate(() => {
|
|
||||||
const style = window.getComputedStyle(document.documentElement);
|
|
||||||
const bgColor = style.backgroundColor;
|
|
||||||
const textColor = style.color;
|
|
||||||
return bgColor.includes('rgb(0,') || bgColor.includes('rgb(20,') || bgColor.includes('rgb(30,');
|
|
||||||
});
|
|
||||||
console.log(` Dark mode detected: ${isDarkMode}`);
|
|
||||||
|
|
||||||
// Check main content
|
|
||||||
console.log('');
|
|
||||||
console.log('🏗️ Checking page structure...');
|
|
||||||
|
|
||||||
// Look for bridge/swap form
|
|
||||||
const swapForm = await page.locator('form, [class*="swap"], [class*="bridge"]').first();
|
|
||||||
const formVisible = await swapForm.isVisible().catch(() => false);
|
|
||||||
console.log(` Swap/Bridge form visible: ${formVisible}`);
|
|
||||||
|
|
||||||
// Look for footer
|
|
||||||
const footer = await page.locator('footer').first();
|
|
||||||
const footerVisible = await footer.isVisible().catch(() => false);
|
|
||||||
console.log(` Footer visible: ${footerVisible}`);
|
|
||||||
|
|
||||||
// Check for navigation items
|
|
||||||
const navItems = await page.locator('nav a, [role="navigation"] a').count();
|
|
||||||
console.log(` Navigation items found: ${navItems}`);
|
|
||||||
|
|
||||||
// Check for campaigns/transactions navigation
|
|
||||||
const campaignsNav = await page.locator('a:has-text("Campaign"), a:has-text("Campaigns")').isVisible().catch(() => false);
|
|
||||||
const transactionsNav = await page.locator('a:has-text("Transaction"), a:has-text("Transactions")').isVisible().catch(() => false);
|
|
||||||
console.log(` Campaigns link visible: ${campaignsNav}`);
|
|
||||||
console.log(` Transactions link visible: ${transactionsNav}`);
|
|
||||||
|
|
||||||
// Check console errors
|
|
||||||
console.log('');
|
|
||||||
console.log('🔧 Console diagnostics...');
|
|
||||||
console.log(` Total console messages: ${consoleLogs.length}`);
|
|
||||||
|
|
||||||
const errorLogs = consoleLogs.filter(log => log.type === 'error');
|
|
||||||
const warningLogs = consoleLogs.filter(log => log.type === 'warning');
|
|
||||||
|
|
||||||
console.log(` Errors: ${errorLogs.length}`);
|
|
||||||
console.log(` Warnings: ${warningLogs.length}`);
|
|
||||||
|
|
||||||
if (errorLogs.length > 0) {
|
|
||||||
console.log(' 🚨 Errors found:');
|
|
||||||
errorLogs.forEach(err => {
|
|
||||||
console.log(` - ${err.text}`);
|
|
||||||
if (err.text.toLowerCase().includes('firebase')) {
|
|
||||||
console.log(' ⚠️ FIREBASE ERROR DETECTED');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pageErrors.length > 0) {
|
|
||||||
console.log(' Page errors:');
|
|
||||||
pageErrors.forEach(err => {
|
|
||||||
console.log(` - ${err.message}`);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Try to navigate to other routes
|
|
||||||
console.log('');
|
|
||||||
console.log('🔗 Checking navigation...');
|
|
||||||
|
|
||||||
const navLinks = await page.locator('nav a, [role="navigation"] a').all();
|
|
||||||
console.log(` Found ${navLinks.length} navigation links`);
|
|
||||||
|
|
||||||
if (navLinks.length > 0) {
|
|
||||||
for (let i = 0; i < Math.min(2, navLinks.length); i++) {
|
|
||||||
try {
|
|
||||||
const href = await navLinks[i].getAttribute('href');
|
|
||||||
const text = await navLinks[i].textContent();
|
|
||||||
if (href && !href.startsWith('http')) {
|
|
||||||
console.log(` Attempting to navigate to: ${text.trim()} (${href})`);
|
|
||||||
// Don't actually navigate, just check the link exists
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
// Skip
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get all visible text content for debugging
|
|
||||||
const visibleText = await page.textContent('body');
|
|
||||||
const visibleLines = visibleText
|
|
||||||
.split('\n')
|
|
||||||
.filter(line => line.trim().length > 0)
|
|
||||||
.slice(0, 20);
|
|
||||||
|
|
||||||
console.log('');
|
|
||||||
console.log('📝 First visible text elements:');
|
|
||||||
visibleLines.forEach((line, idx) => {
|
|
||||||
console.log(` ${idx + 1}. ${line.trim().substring(0, 80)}`);
|
|
||||||
});
|
|
||||||
|
|
||||||
// Get page size info
|
|
||||||
const dimensions = await page.evaluate(() => ({
|
|
||||||
documentWidth: document.documentElement.scrollWidth,
|
|
||||||
documentHeight: document.documentElement.scrollHeight,
|
|
||||||
viewportWidth: window.innerWidth,
|
|
||||||
viewportHeight: window.innerHeight,
|
|
||||||
}));
|
|
||||||
|
|
||||||
console.log('');
|
|
||||||
console.log('📐 Page dimensions:');
|
|
||||||
console.log(` Viewport: ${dimensions.viewportWidth}x${dimensions.viewportHeight}`);
|
|
||||||
console.log(` Document: ${dimensions.documentWidth}x${dimensions.documentHeight}`);
|
|
||||||
|
|
||||||
// Final assessment
|
|
||||||
console.log('');
|
|
||||||
console.log('✨ Summary:');
|
|
||||||
const issues = [];
|
|
||||||
if (!headerVisible) issues.push('Header not visible');
|
|
||||||
if (!logoVisible) issues.push('Logo/branding not found');
|
|
||||||
if (!connectVisible) issues.push('Connect button not found');
|
|
||||||
if (!mainContent) issues.push('Main content area not found');
|
|
||||||
if (errorLogs.length > 0) issues.push(`${errorLogs.length} console errors`);
|
|
||||||
if (pageErrors.length > 0) issues.push(`${pageErrors.length} page errors`);
|
|
||||||
|
|
||||||
if (issues.length === 0) {
|
|
||||||
console.log(' ✅ Page appears to be loading correctly!');
|
|
||||||
console.log(' ✅ No critical issues detected');
|
|
||||||
} else {
|
|
||||||
console.log(' ⚠️ Issues detected:');
|
|
||||||
issues.forEach(issue => console.log(` - ${issue}`));
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (error) {
|
|
||||||
console.error('❌ Error during inspection:', error.message);
|
|
||||||
console.error(error.stack);
|
|
||||||
process.exit(1);
|
|
||||||
} finally {
|
|
||||||
await browser.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log('');
|
|
||||||
console.log(`📸 All screenshots saved to: ${SCREENSHOT_DIR}`);
|
|
||||||
console.log('You can view them with: open ' + SCREENSHOT_DIR);
|
|
||||||
}
|
|
||||||
|
|
||||||
runTests().catch(error => {
|
|
||||||
console.error('Fatal error:', error);
|
|
||||||
process.exit(1);
|
|
||||||
});
|
|
||||||
Reference in New Issue
Block a user