Skip to content

Commit 2b3d594

Browse files
authored
Merge pull request #4 from alpsla/clean_push_candidate
Clean push candidate
2 parents 5031ac6 + 348a9b1 commit 2b3d594

3,163 files changed

Lines changed: 350564 additions & 717 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.

.env.bak

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Supabase Configuration
2+
SUPABASE_URL=https://ftjhmbbcuqjqmmbaymqb.supabase.co
3+
SUPABASE_SERVICE_ROLE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImZ0amhtYmJjdXFqcW1tYmF5bXFiIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImlhdCI6MTczODg1OTczNCwiZXhwIjoyMDU0NDM1NzM0fQ.ldT_p0Xn64S3OM5AR27-Iht27nUkbR9kGDyaJftPt-s
4+
SUPABASE_SERVICE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImZ0amhtYmJjdXFqcW1tYmF5bXFiIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImlhdCI6MTczODg1OTczNCwiZXhwIjoyMDU0NDM1NzM0fQ.ldT_p0Xn64S3OM5AR27-Iht27nUkbR9kGDyaJftPt-s
5+
PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImZ0amhtYmJjdXFqcW1tYmF5bXFiIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Mzg4NTk3MzQsImV4cCI6MjA1NDQzNTczNH0.coUpXWXWCuztUyaGSHx1-qfL1CG5wlVh3I33Rq6NMNI
6+
7+
# Git Provider API Keys
8+
GITHUB_TOKEN=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
9+
GITHUB_CLIENT_SECRET=10194b2531c02ac08bc59fffceb6d41cfb9dfcf7
10+
GITHUB_CLIENT_ID=Iv23liXCJTHgiJ4JxPJS
11+
GITLAB_TOKEN=glpat-csSverTEaXb2mWEytVRL
12+
GITLAB_CLIENT_ID=e836c1ea79e1b1844d5e21b5fa95bcf1957a42d871bbceb01837af4f490c8ca8
13+
GITLAB_CLIENT_SECRET=gloas-7d19fccacd6a68292e29da246ccd4dca9d75f827293e717ecf12a32b096dbb5e
14+
GITLAB_REDIRECT_URI=http://localhost:3000/auth/callback
15+
16+
# Agent API Keys
17+
ANTHROPIC_API_KEY=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
18+
OPENAI_API_KEY=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
19+
DEEPSEEK_API_KEY=sk-d513de3f650e4497b0b67d542b2ad190
20+
GOOGLE_API_KEY=AIzaSyAx5Mj6YtrgnivkxUGqzAi1h_QxTX0HNWQ
21+
OPENROUTER_API_KEY=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
22+
23+
DEPENDENCY_SCAN_SEVERITY=high
24+
25+
# GitHub MCP Configuration
26+
GITHUB_MCP_COMMAND=
27+
GITHUB_MCP_ARGS=
28+
GITHUB_USERNAME=
29+
30+
# DeepWiki Configuration
31+
DEEPWIKI_API_URL=http://localhost:8001
32+
DEEPWIKI_API_KEY=dw-key-e48329b6c05b4a36a18d65af21ac3c2f
33+
DEEPWIKI_API_URL=http://localhost:8001
34+
35+
# Cost Tracking
36+
COST_TRACKING_ENABLED=true
37+
COST_ALERT_THRESHOLD=50
38+
39+
# Logging
40+
LOG_LEVEL=info
41+
LOG_FILE_PATH=logs/app.log
42+
43+
# Environment
44+
NODE_ENV=development
45+
46+
# Grafana Configuration
47+
GRAFANA_URL=https://alpsla.grafana.net
48+
GRAFANA_SUPABASE_ACCESS_TOKEN=glc_eyJvIjoiMTQxOTc1OCIsIm4iOiJzdXBhYmFzZV9pbnRlZ3JhdGlvbi1zdXBfdG9rZW4iLCJrIjoiMjNBS1RxM3hDOTcxZVdvME9VOVQ3MnpwIiwibSI6eyJyIjoidXMifX0=
49+
GRAFANA_ORG_ID=1
50+
51+
# Supabase PostgreSQL Connection (for Grafana)
52+
POSTGRES_HOST=https://ftjhmbbcuqjqmmbaymqb.supabase.co
53+
POSTGRES_PORT=5432
54+
POSTGRES_DB=postgres
55+
POSTGRES_USER=postgres
56+
POSTGRES_PASSWORD=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImZ0amhtYmJjdXFqcW1tYmF5bXFiIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImlhdCI6MTczODg1OTczNCwiZXhwIjoyMDU0NDM1NzM0fQ.ldT_p0Xn64S3OM5AR27-Iht27nUkbR9kGDyaJftPt-s # Use your Supabase service role key here

.github/workflows/ci.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ jobs:
1717
uses: actions/setup-node@v3
1818
with:
1919
node-version: '18.x'
20-
cache: 'npm'
20+
# Disable npm caching to avoid ENOWORKSPACES error
21+
# cache: 'npm'
2122

2223
- name: Install dependencies
23-
run: npm ci
24+
run: npm ci --no-workspaces
2425

2526
- name: Create .env file
2627
run: |
@@ -47,10 +48,10 @@ jobs:
4748
EOF
4849
4950
- name: Lint
50-
run: npm run lint
51+
run: npm run lint --no-workspaces
5152

5253
- name: Build
53-
run: npm run build
54+
run: npm run build --no-workspaces
5455

5556
- name: Test
56-
run: npm run test
57+
run: npm run test --no-workspaces

README.md

Lines changed: 24 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,45 @@
11
# CodeQual
22

3-
CodeQual is an intelligent code review system that analyzes pull requests, educates developers based on identified issues, and tracks individual and team growth over time.
3+
A comprehensive code quality analysis system powered by AI.
44

5-
## Overview
5+
## Directory Structure
66

7-
CodeQual uses a flexible, adaptive multi-agent architecture to provide:
7+
- `/scripts`: Core scripts for repository analysis and testing
8+
- `/reports`: Generated analysis reports (timestamped)
9+
- `/docs`: Documentation and guides
10+
- `/archive`: Archived files from previous versions
811

9-
- Code quality analysis
10-
- Security vulnerability detection
11-
- Performance optimization suggestions
12-
- Educational content tailored to developers
13-
- Skill tracking and professional growth insights
12+
## Getting Started
1413

15-
## Features
16-
17-
- **Two-Tier Analysis**: Choose between quick (1-3 minutes) or comprehensive (5-10 minutes) analysis
18-
- **Multi-Agent Architecture**: Uses several AI models to provide the best analysis for each context
19-
- **Repository Analysis Caching**: Stores deep repository analysis for efficient reuse
20-
- **Skills Tracking**: Monitors developer growth across various skill categories
21-
- **Visualization**: Grafana dashboards for insight visualization
22-
23-
## Installation
24-
25-
1. Clone the repository
26-
```bash
27-
git clone https://github.com/your-username/codequal.git
28-
cd codequal
29-
```
30-
31-
2. Install dependencies
14+
1. Run a quick test to verify the integration is working:
3215
```bash
33-
npm install
16+
./scripts/quick_test.sh
3417
```
3518

36-
3. Set up environment variables
19+
2. Analyze a repository:
3720
```bash
38-
cp .env.sample .env
39-
# Edit .env with your Supabase and API credentials
21+
./scripts/analyze_repository.sh <repository_url> [model_name]
4022
```
41-
42-
4. Set up the database
23+
24+
3. View the latest report:
4325
```bash
44-
./scripts/make-scripts-executable.sh
45-
./scripts/migrate-database.sh
26+
open ./reports/latest/comprehensive_analysis.md
4627
```
4728

48-
## Environment Variables
49-
50-
CodeQual requires the following environment variables:
29+
## Documentation
5130

52-
| Variable | Description | Required |
53-
|----------|-------------|----------|
54-
| SUPABASE_URL | URL for your Supabase project | Yes |
55-
| SUPABASE_SERVICE_ROLE_KEY | Service role key for Supabase | Yes |
56-
| PUBLIC_SUPABASE_ANON_KEY | Anonymous key for Supabase | No |
57-
| GITHUB_TOKEN | GitHub API token | No* |
58-
| OPENAI_API_KEY | OpenAI API key for GPT models | No* |
59-
| ANTHROPIC_API_KEY | Anthropic API key for Claude models | No* |
60-
| DEEPSEEK_API_KEY | DeepSeek API key | No* |
61-
| GEMINI_API_KEY | Google Gemini API key | No* |
31+
For detailed documentation, see:
6232

63-
\* At least one model API key is required for functionality.
64-
65-
For local development, create a `.env` file in the project root with these variables. For production, set them in your deployment environment.
66-
67-
## Usage
68-
69-
```bash
70-
# Start the CLI
71-
npm run cli
72-
73-
# Run analysis on a PR
74-
codequal analyze-pr --repo owner/repo --pr 123 --mode quick
75-
```
33+
- [Repository Analysis Guide](./docs/guides/repository_analysis.md)
7634

7735
## Architecture
7836

79-
The project uses a TypeScript monorepo structure with the following packages:
80-
81-
- `agents`: AI agent integrations and orchestration
82-
- `cli`: Command-line interface
83-
- `core`: Core types and utilities
84-
- `database`: Database models and Supabase integration
85-
- `testing`: Testing utilities and test repositories
86-
- `ui`: User interface components
87-
88-
## Contributing
89-
90-
1. Fork the repository
91-
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
92-
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
93-
4. Push to the branch (`git push origin feature/amazing-feature`)
94-
5. Open a Pull Request
37+
CodeQual uses a multi-agent approach with fallback capabilities to analyze repositories across multiple dimensions:
9538

96-
## License
39+
- Architecture
40+
- Code Quality
41+
- Security
42+
- Dependencies
43+
- Performance
9744

98-
This project is licensed under the MIT License - see the LICENSE file for details.
45+
Each analysis produces a score from 1-10, which are combined to create an overall repository score.

apps/api/package.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,12 @@
1111
"keywords": [],
1212
"author": "",
1313
"license": "ISC",
14-
"description": ""
14+
"description": "",
15+
"dependencies": {
16+
"axios": "^1.9.0",
17+
"dotenv": "^16.5.0"
18+
},
19+
"devDependencies": {
20+
"@types/dotenv": "^6.1.1"
21+
}
1522
}

apps/api/src/pages/api/pr-review.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { NextApiRequest, NextApiResponse } from 'next';
2-
import { PRReviewService } from '@pr-reviewer/core/services/pr-review-service';
3-
import { DEFAULT_AGENTS } from '@pr-reviewer/core/config/agent-registry';
2+
import { PRReviewService } from '@codequal/core/services/pr-review-service';
3+
import { DEFAULT_AGENTS } from '@codequal/core/config/agent-registry';
44

55
/**
66
* API endpoint for PR review
@@ -44,8 +44,9 @@ export default async function handler(
4444
suggestions: result.combinedResult.suggestions.length,
4545
educational: result.combinedResult.educational?.length || 0
4646
});
47-
} catch (error: any) {
47+
} catch (error: unknown) {
4848
console.error('Error handling PR review request:', error);
49-
return res.status(500).json({ error: error.message });
49+
const errorMessage = error instanceof Error ? error.message : String(error);
50+
return res.status(500).json({ error: errorMessage });
5051
}
5152
}

apps/api/tsconfig.tsbuildinfo

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

apps/web/package.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,12 @@
1111
"keywords": [],
1212
"author": "",
1313
"license": "ISC",
14-
"description": ""
14+
"description": "",
15+
"dependencies": {
16+
"axios": "^1.9.0",
17+
"dotenv": "^16.5.0"
18+
},
19+
"devDependencies": {
20+
"@types/dotenv": "^6.1.1"
21+
}
1522
}

apps/web/src/components/pr-review/pr-review-form.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export function PRReviewForm() {
2525
}
2626

2727
// GitHub or GitLab PR URL validation
28-
const validUrl = /https:\/\/(github|gitlab)\.com\/[^\/]+\/[^\/]+(\/pull\/\d+|\/\-\/merge_requests\/\d+)/;
28+
const validUrl = /https:\/\/(github|gitlab)\.com\/[^/]+\/[^/]+(\/pull\/\d+|\/merge_requests\/\d+)/;
2929
if (!validUrl.test(prUrl)) {
3030
setError('Invalid PR URL. Must be a GitHub or GitLab PR URL.');
3131
return;
@@ -65,8 +65,9 @@ export function PRReviewForm() {
6565

6666
// Redirect to results page
6767
router.push(`/results/${result.prReviewId}`);
68-
} catch (error: any) {
69-
setError(error.message);
68+
} catch (error: unknown) {
69+
const errorMessage = error instanceof Error ? error.message : String(error);
70+
setError(errorMessage);
7071
} finally {
7172
setIsSubmitting(false);
7273
}

0 commit comments

Comments
 (0)