This is a web portal displaying CloudStack health checks and other quality metrics.
- Active Health Check Runs: Automatically displays all open PRs with
[HEALTH]in the title - PR Search: Search for any PR by number or GitHub URL
- Smoketest Results: Displays smoketest results from BlueOrangutan bot comments
- β Download logs icon for each hypervisor test
- β Test execution timestamps
- β Expandable failure details with failed test names
- Approvals: Shows approval counts (approved, commented, changes requested)
- Code Coverage: Integration with CodeCov
- Logs Access: Direct links to test logs
- Automated Data Collection: GitHub PR scraper runs periodically via cron job
The portal includes an automated scraper that collects PR data from GitHub:
- Code Coverage: Codecov bot comments with coverage percentages
- LGTM Approvals: All PR reviews (APPROVED, CHANGES_REQUESTED, COMMENTED)
- Smoketest Results: Trillian test results per hypervisor
- State Tracking: Automatically updates when PRs are closed
See scripts/README.md and scripts/QUICKSTART.md for setup instructions.
- Multiple View Modes:
- πΊοΈ Heatmap (default): Visual success rate grid for upgrade paths
- All Upgrade Paths: Accordion view with expandable test details
- Historical Runs: Chronological table of all tests
- Filter Tests: Filter by version (from/to), distro, hypervisor, and status
- Statistics Dashboard: View total tests, pass/fail counts, and latest test date
- Rich Test Details:
- Formatted OS names (e.g., "Ubuntu 22.04" instead of "u22")
- Formatted hypervisor versions (e.g., "vSphere 7.0 U3" instead of "70u3")
- Test data created indicator with checkbox
- Expandable failure information showing failure stage
- Duration and timestamps for each test
- Logs & Artifacts: Direct access to test logs, error logs, and upgrade matrix URLs
- Real-time Data: Displays current running and pending tests
π Security Features:
- SQL injection prevention via parameterized queries
- XSS protection through React auto-escaping
- CORS properly configured
- Environment variables for secrets management
- Read-only database access recommended
See SECURITY.md for detailed security information.
- Node.js (v16 or higher)
- npm or yarn
- MySQL database (local or remote)
- VPN access to database server (if remote)
-
Clone the repository:
git clone https://github.com/shapeblue/QA-Portal.git cd QA-Portal -
Install dependencies:
# Install root dependencies npm install # Install client dependencies cd client npm install cd ..
-
Configure environment variables:
cd server cp .env.example .envEdit
server/.envwith your database credentials:PORT=5001 DB_HOST=your_database_host DB_PORT=3306 DB_NAME=cloudstack_tests DB_USER=your_db_user DB_PASSWORD=your_db_passwordNote: Never commit the
.envfile. It contains sensitive credentials. -
Start the development servers:
# Start both backend and frontend npm run dev # Or start them separately: # Terminal 1 - Backend server npm run server # Terminal 2 - Frontend client npm run client
-
Open your browser and navigate to:
http://localhost:3000
QA-Portal/
βββ client/ # React frontend
β βββ src/
β β βββ components/ # React components
β β βββ services/ # API services
β β βββ types/ # TypeScript types
β β βββ App.tsx # Main app component
β βββ package.json
βββ server/ # Express backend
β βββ src/
β β βββ index.ts # Server entry point
β βββ .env # Environment variables (not committed)
β βββ .env.example # Environment template
β βββ .gitignore # Git ignore rules
β βββ tsconfig.json
βββ scripts/ # Automation scripts
β βββ scrape-github-prs.js # GitHub PR scraper
β βββ scraper-cron.sh # Cron job wrapper
β βββ setup-cron.sh # Cron setup script
β βββ README.md # Scraper documentation
β βββ QUICKSTART.md # Quick start guide
βββ package.json # Root package.json
When you open the dashboard, it automatically loads all active health check PRs from the database. These are PRs labeled with type:healthcheckrun in the pr_health_labels table.
- Enter a PR number (e.g.,
11523) or full GitHub URL in the search box - Click "Search"
- View the PR details including smoketest results and approvals
- Click "Back to Health Check PRs" to return to the main view
- Green badges: Successful tests (>85% pass rate)
- Red badges: Failed tests (<85% pass rate)
- Approvals: Shows approved, commented, and changes requested counts
- Logs: Click the "View Logs" link to access full test logs
cd client
npm testnpm run buildThis will:
- Build the React frontend to
client/build/ - Compile the TypeScript backend to
server/dist/
The project uses ESLint (configured by Create React App):
cd client
npm run lintThe backend provides the following REST API endpoints:
GET /api/health-prs- Get all health check PRs from databaseGET /api/pr/:number- Get a specific PR by number from database
GET /api/upgrade-tests- Get upgrade test results with optional filters- Query params:
fromVersion,toVersion,distro,hypervisor,status
- Query params:
GET /api/upgrade-tests/filters- Get available filter options (versions, distros, hypervisors)GET /api/upgrade-tests/stats- Get upgrade test statistics (total, passed, failed, running)
GET /api/health- Health check endpoint
The application uses the following MySQL tables:
pr_health_labels- PR information and labelspr_trillian_comments- Smoke test results from Trillian botpr_codecov_comments- Code coverage data from Codecovupgrade_test_results- Upgrade test results with the following key fields:upgrade_start_version,upgrade_target_version- Version informationmanagement_server_os- Operating system/distrohypervisor,hypervisor_version- Hypervisor detailsoverall_status- Test status (PASS, FAIL, ERROR, SKIPPED, or NULL for in-progress)timestamp_start,timestamp_end,duration_seconds- Timing informationupgrade_console,error_log,upgrade_matrix_url- Links to logs and resources
| Variable | Description | Default | Required |
|---|---|---|---|
PORT |
Backend server port | 5001 | No |
DB_HOST |
MySQL database host | localhost | Yes |
DB_PORT |
MySQL database port | 3306 | Yes |
DB_NAME |
Database name | cloudstack_tests | Yes |
DB_USER |
Database username | results | Yes |
DB_PASSWORD |
Database password | - | Yes |
GITHUB_TOKEN |
GitHub API token (for scraper) | - | Recommended |
If you cannot connect to the database:
- Verify VPN connection (if database is remote)
- Check database credentials in
.env - Ensure database server is running and accessible
- Verify firewall rules allow connection to database port
If port 5000 or 3000 is already in use, you can change them:
- Backend: Edit
PORTin.env - Frontend: Set
PORT=3001before runningnpm run client
If you encounter CORS issues, ensure the proxy is correctly configured in client/package.json:
"proxy": "http://localhost:5000"- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
ISC