-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile.qa.just
More file actions
173 lines (132 loc) · 4.07 KB
/
justfile.qa.just
File metadata and controls
173 lines (132 loc) · 4.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# Quality Assurance Commands
# This file contains all QA-related commands
# Quality assurance
qa:
echo "🔍 Running quality assurance checks..."
just lint
just test
just security-scan
echo "✅ QA checks passed!"
# Security scanning
security-scan:
echo "🔒 Running security scans..."
# Python security scan
@echo "Scanning Python packages..." && \
uv run safety check
# Node.js security scan
@echo "Scanning Node.js packages..." && \
cd packages/liaison && bun run test:security
# Secret detection
@echo "Scanning for secrets..." && \
bunx git-secrets --scan
echo "✅ Security scans completed!"
# Documentation
docs:
echo "📚 Generating documentation..."
# Generate Python documentation
@echo "Generating Python docs..." && \
cd packages/opencode_config && \
uv run sphinx-build -b html docs/ docs/_build/
# Generate Node.js documentation
@echo "Generating Node.js docs..." && \
cd packages/liaison && \
bun run docs
echo "✅ Documentation generated!"
# Performance monitoring
perf:
echo "📊 Running performance analysis..."
# Python performance analysis
@echo "Analyzing Python performance..." && \
uv run python -m cProfile -o profile.stats -m opencode_config.cli
# Node.js performance analysis
@echo "Analyzing Node.js performance..." && \
cd packages/liaison && \
bun run test:performance
echo "✅ Performance analysis completed!"
# Health check
health:
echo "🏥 Running health checks..."
# Check Python environment
@echo "Checking Python environment..." && \
uv run python --version && \
uv --version
# Check Node.js environment
@echo "Checking Node.js environment..." && \
node --version && \
bun --version
# Check project dependencies
@echo "Checking dependencies..." && \
uv run python -c "import sys; sys.path.insert(0, 'packages'); import opencode_config; print('✅ Python imports OK')" && \
cd packages/liaison && \
(bun run type-check || echo "⚠️ TypeScript check failed but continuing...")
echo "✅ Health checks completed!"
# CI/CD simulation - Mirrors GitHub Actions workflow
ci:
echo "🔄 Simulating CI/CD pipeline..."
# Fail fast on any error
set -e
# Setup environment
just setup
# Quality checks
just lint
just type-check
# Run all tests
just test
# Security scans
just security-scan
# Build packages
just build
echo "✅ CI/CD simulation completed successfully!"
# Comprehensive pre-push validation - Run before git push
pre-push:
echo "🚨 Running pre-push validation (mirrors GitHub Actions)..."
echo ""
# Fail on first error
set -e
echo "📦 Installing dependencies..."
cd packages/liaison && bun install --frozen-lockfile
cd ../../
echo ""
echo "🔒 Security audit..."
cd packages/liaison && bun run test:security
cd ../../
echo ""
echo "🔍 Type checking..."
cd packages/liaison && bun run type-check
cd ../../
echo ""
echo "🔍 Linting..."
cd packages/liaison && bun run lint
cd ../../
echo ""
echo "🏗️ Building..."
cd packages/liaison && bun run build
cd ../../
echo ""
echo "🧪 Running tests..."
cd packages/liaison && bun run test
cd ../../
echo ""
echo "✅ All pre-push checks passed!"
echo "Ready to push to GitHub 🚀"
# Type checking
type-check:
echo "🔍 Running type checks..."
cd packages/liaison && bun run type-check
echo "✅ Type checking passed!"
# Git helpers
git-status:
@echo "📋 Git Status:"
@git status --porcelain
git-sync:
@echo "🔄 Syncing with remote..."
@git pull origin main
@git add .
@git status --porcelain
# Ask for commit message if there are changes
@if [ -n "$(git status --porcelain)" ]; then \
echo "Enter commit message:" && \
read -r message && \
git commit -m "$message"; \
fi
@git push origin main