Merge pull request 'Reviewer 역할 검증 보고서 smoke' (#5) from forge/role-reviewer-live-v4-001-attempt-1-run-cb5137e23d3c into main
This commit is contained in:
commit
cc05280c96
5 changed files with 668 additions and 0 deletions
|
|
@ -0,0 +1,3 @@
|
||||||
|
# role-reviewer-live-v4-001-attempt-1-run-cb5137e23d3c
|
||||||
|
|
||||||
|
Forge 이슈 작업 브랜치 `forge/role-reviewer-live-v4-001-attempt-1-run-cb5137e23d3c`.
|
||||||
160
docs/reviewer/smoke-evidence-report-template.md
Normal file
160
docs/reviewer/smoke-evidence-report-template.md
Normal file
|
|
@ -0,0 +1,160 @@
|
||||||
|
# Smoke Evidence Report Template
|
||||||
|
|
||||||
|
## 프로젝트 정보
|
||||||
|
- **프로젝트명**: runtime-role-matrix-live-202607141522-v4
|
||||||
|
- **검증 유형**: Smoke Test
|
||||||
|
- **검증 일시**: YYYY-MM-DD HH:MM
|
||||||
|
- **검증자**: Reviewer
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 1. 변경 파일 증적 (Evidence of Changed Files)
|
||||||
|
|
||||||
|
### 1.1 변경 파일 목록
|
||||||
|
```
|
||||||
|
| 파일 경로 | 변경 유형 | 변경 사유 |
|
||||||
|
|-----------|-----------|----------|
|
||||||
|
| | | |
|
||||||
|
```
|
||||||
|
|
||||||
|
### 1.2 변경 내용 요약
|
||||||
|
> 변경된 핵심 내용 3줄 요약
|
||||||
|
|
||||||
|
### 1.3 변경 영향 범위
|
||||||
|
- 영향받는 모듈:
|
||||||
|
- 신규 의존성:
|
||||||
|
- 제거된 의존성:
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 2. 테스트 증적 (Test Evidence)
|
||||||
|
|
||||||
|
### 2.1 테스트 실행 결과
|
||||||
|
```
|
||||||
|
테스트 유형 | 실행 수 | 통과 | 실패 | 건너뜀
|
||||||
|
-----------------|---------|------|------|------
|
||||||
|
단위 테스트 | | | |
|
||||||
|
통합 테스트 | | | |
|
||||||
|
E2E 테스트 | | | |
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2.2 코드 커버리지
|
||||||
|
```
|
||||||
|
| 지표 | 기준 | 실제 | 상태 |
|
||||||
|
|---------------|---------|---------|------|
|
||||||
|
| 라인 커버리지 | ≥ 80% | | |
|
||||||
|
| 브랜치 커버리지| ≥ 70% | | |
|
||||||
|
| 함수 커버리지 | ≥ 90% | | |
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2.3 실패 테스트 상세
|
||||||
|
```
|
||||||
|
| 테스트명 | 실패 사유 | 심각도 | 조치 |
|
||||||
|
|----------|-----------|--------|------|
|
||||||
|
| | | | |
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 3. CI 증적 (CI Evidence)
|
||||||
|
|
||||||
|
### 3.1 빌드 상태
|
||||||
|
```
|
||||||
|
| 항목 | 상태 | 상세 |
|
||||||
|
|----------------|--------|------|
|
||||||
|
| 빌드 번호 | | |
|
||||||
|
| 빌드 상태 | | |
|
||||||
|
| 빌드 시간 | | |
|
||||||
|
| 빌드 로그 | [링크] | |
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3.2 품질 게이트 결과
|
||||||
|
```
|
||||||
|
| 게이트 | 기준 | 결과 | 상태 |
|
||||||
|
|---------------|---------|--------|------|
|
||||||
|
| 정적 분석 | 0 오류 | | |
|
||||||
|
| 보안 스캔 | 0 취약점| | |
|
||||||
|
| 코드 커버리지 | ≥ 80% | | |
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3.3 배포 검증
|
||||||
|
```
|
||||||
|
| 환경 | 배포 일시 | 배포자 | 상태 | 롤백 여부 |
|
||||||
|
|---------|-----------|--------|------|----------|
|
||||||
|
| Dev | | | | |
|
||||||
|
| Staging | | | | |
|
||||||
|
| Prod | | | | |
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 4. 운영 리스크 증적 (Operational Risk Evidence)
|
||||||
|
|
||||||
|
### 4.1 모니터링 설정
|
||||||
|
```
|
||||||
|
| 모니터링 항목 | 설정 상태 | 확인 일시 |
|
||||||
|
|--------------|-----------|----------|
|
||||||
|
| 메트릭 수집 | | |
|
||||||
|
| 로그 수집 | | |
|
||||||
|
| 알림 설정 | | |
|
||||||
|
```
|
||||||
|
|
||||||
|
### 4.2 성능 지표
|
||||||
|
```
|
||||||
|
| 지표 | 기준 | 측정값 | 상태 |
|
||||||
|
|---------------|---------|---------|------|
|
||||||
|
| 응답 시간 P99 | < 200ms | | |
|
||||||
|
| 처리량 (TPS) | ≥ 1000 | | |
|
||||||
|
| 오류율 | < 0.1% | | |
|
||||||
|
```
|
||||||
|
|
||||||
|
### 4.3 리스크 평가
|
||||||
|
```
|
||||||
|
| 리스크 항목 | 가능성 | 영향도 | 완화 조치 | 잔여 리스크 |
|
||||||
|
|------------|--------|--------|-----------|-------------|
|
||||||
|
| | | | | |
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 5. 종합 판정
|
||||||
|
|
||||||
|
### 5.1 검증 결과 요약
|
||||||
|
|
||||||
|
| 검증 영역 | 판정 | 조건/이유 |
|
||||||
|
|-----------|------|----------|
|
||||||
|
| 변경 파일 | | |
|
||||||
|
| 테스트 | | |
|
||||||
|
| CI | | |
|
||||||
|
| 운영 리스크| | |
|
||||||
|
|
||||||
|
### 5.2 최종 판정
|
||||||
|
|
||||||
|
**☐ 승인 (Approved)**
|
||||||
|
- 모든 검증 항목 통과
|
||||||
|
|
||||||
|
**☐ 조건부 승인 (Approved with Conditions)**
|
||||||
|
- 조건:
|
||||||
|
- 기한:
|
||||||
|
|
||||||
|
**☐ 보류 (On Hold)**
|
||||||
|
- 사유:
|
||||||
|
- 조치 사항:
|
||||||
|
|
||||||
|
**☐ 거절 (Rejected)**
|
||||||
|
- 사유:
|
||||||
|
- 재검증 일정:
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 서명
|
||||||
|
|
||||||
|
| 역할 | 성명 | 날짜 | 서명 |
|
||||||
|
|------|------|------|------|
|
||||||
|
| 검증자 | | | |
|
||||||
|
| 승인자 | | | |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**문서 버전**: v1.0
|
||||||
|
**최종 업데이트**: YYYY-MM-DD
|
||||||
90
docs/reviewer/smoke-verification-checklist.md
Normal file
90
docs/reviewer/smoke-verification-checklist.md
Normal file
|
|
@ -0,0 +1,90 @@
|
||||||
|
# Smoke Verification Checklist
|
||||||
|
|
||||||
|
## 1. 변경 파일 검증 (Changed Files Verification)
|
||||||
|
|
||||||
|
### 1.1 파일 변경 이력
|
||||||
|
- [ ] 변경된 파일 목록 확인
|
||||||
|
- [ ] 각 파일의 변경 사유 문서화
|
||||||
|
- [ ] 변경 범위(Scope) 적절성 검토
|
||||||
|
|
||||||
|
### 1.2 코드 품질
|
||||||
|
- [ ] 코딩 컨벤션 준수 여부
|
||||||
|
- [ ] 불필요한 코드/주석 제거 여부
|
||||||
|
- [ ] 테스트 가능성(Testability) 확보 여부
|
||||||
|
|
||||||
|
### 1.3 변경 영향도
|
||||||
|
- [ ] 의존성 변경 분석
|
||||||
|
- [ ] 하위 호환성 영향 평가
|
||||||
|
- [ ] API 변경 사항 문서화
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 2. 테스트 검증 (Test Verification)
|
||||||
|
|
||||||
|
### 2.1 단위 테스트
|
||||||
|
- [ ] 신규 코드 단위 테스트覆盖率 ≥ 80%
|
||||||
|
- [ ] 기존 테스트 통과 여부
|
||||||
|
- [ ] Edge case 테스트 포함 여부
|
||||||
|
|
||||||
|
### 2.2 통합 테스트
|
||||||
|
- [ ] 모듈 간 인터페이스 테스트
|
||||||
|
- [ ] 데이터 흐름 테스트
|
||||||
|
- [ ] 오류 처리 테스트
|
||||||
|
|
||||||
|
### 2.3 Smoke Test
|
||||||
|
- [ ] 핵심 기능 동작 확인
|
||||||
|
- [ ] 빌드 성공 여부
|
||||||
|
- [ ] 배포 가능 여부
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 3. CI 검증 (CI Verification)
|
||||||
|
|
||||||
|
### 3.1 빌드 파이프라인
|
||||||
|
- [ ] CI 빌드 성공 여부
|
||||||
|
- [ ] 빌드 시간 적절성 (< 10분)
|
||||||
|
- [ ] 캐시 활용 효율성
|
||||||
|
|
||||||
|
### 3.2 품질 게이트
|
||||||
|
- [ ] 정적 분석 통과
|
||||||
|
- [ ] 코드 커버리지 기준 충족
|
||||||
|
- [ ] 보안 스캔 통과
|
||||||
|
|
||||||
|
### 3.3 배포 자동화
|
||||||
|
- [ ] 스테이징 배포 자동화
|
||||||
|
- [ ] 롤백 메커니즘 동작 확인
|
||||||
|
- [ ] 배포 로그 기록 여부
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 4. 운영 리스크 검증 (Operational Risk Verification)
|
||||||
|
|
||||||
|
### 4.1 모니터링
|
||||||
|
- [ ] 메트릭 수집 설정 확인
|
||||||
|
- [ ] 알림 규칙 설정 확인
|
||||||
|
- [ ] 대시보드 가용성
|
||||||
|
|
||||||
|
### 4.2 장애 대응
|
||||||
|
- [ ] 롤백 계획 문서화
|
||||||
|
- [ ] 비상 연락망 확인
|
||||||
|
- [ ] 복구 절차 문서화
|
||||||
|
|
||||||
|
### 4.3 성능
|
||||||
|
- [ ] 부하 테스트 결과 확인
|
||||||
|
- [ ] 응답 시간 기준 충족
|
||||||
|
- [ ] 리소스 사용량 적절성
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 검증 결과 요약
|
||||||
|
|
||||||
|
| 항목 | 상태 | 비고 |
|
||||||
|
|------|------|------|
|
||||||
|
| 변경 파일 | ☐ 통과 ☐ 실패 | |
|
||||||
|
| 테스트 | ☐ 통과 ☐ 실패 | |
|
||||||
|
| CI | ☐ 통과 ☐ 실패 | |
|
||||||
|
| 운영 리스크 | ☐ 통과 ☐ 실패 | |
|
||||||
|
|
||||||
|
**최종 판정**: ☐ 승인 ☐ 조건부 승인 ☐ 보류 ☐ 거절
|
||||||
|
|
||||||
|
검증자: _______________ 날짜: _______________
|
||||||
268
scripts/verify-operational-risk.sh
Normal file
268
scripts/verify-operational-risk.sh
Normal file
|
|
@ -0,0 +1,268 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# Operational Risk Verification Script
|
||||||
|
# Usage: ./scripts/verify-operational-risk.sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
PROJECT_NAME="runtime-role-matrix-live-202607141522-v4"
|
||||||
|
REPORT_DIR="docs/reviewer/reports"
|
||||||
|
TIMESTAMP=$(date +"%Y%m%d_%H%M%S")
|
||||||
|
|
||||||
|
# Colors for output
|
||||||
|
RED='\033[0;31m'
|
||||||
|
GREEN='\033[0;32m'
|
||||||
|
YELLOW='\033[1;33m'
|
||||||
|
NC='\033[0m'
|
||||||
|
|
||||||
|
log_info() { echo -e "${GREEN}[INFO]${NC} $1"; }
|
||||||
|
log_warn() { echo -e "${YELLOW}[WARN]${NC} $1"; }
|
||||||
|
log_error() { echo -e "${RED}[ERROR]${NC} $1"; }
|
||||||
|
|
||||||
|
# Create report directory
|
||||||
|
mkdir -p "${REPORT_DIR}"
|
||||||
|
|
||||||
|
log_info "Starting Operational Risk Verification for ${PROJECT_NAME}"
|
||||||
|
|
||||||
|
# Initialize risk assessment
|
||||||
|
RISK_SCORE=0
|
||||||
|
RISK_ITEMS="[]"
|
||||||
|
|
||||||
|
# 1. Monitoring Configuration
|
||||||
|
echo ""
|
||||||
|
log_info "=== 1. Monitoring Configuration ==="
|
||||||
|
|
||||||
|
MONITORING_SCORE=0
|
||||||
|
|
||||||
|
# Check for monitoring configuration files
|
||||||
|
if [ -f "monitoring/prometheus.yml" ] || [ -f "monitoring/grafana.json" ]; then
|
||||||
|
log_info "Monitoring configuration found"
|
||||||
|
MONITORING_SCORE=$((MONITORING_SCORE + 25))
|
||||||
|
else
|
||||||
|
log_warn "No monitoring configuration found"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check for metrics endpoints
|
||||||
|
if grep -r "metrics" . --include="*.java" --include="*.js" --include="*.ts" -l 2>/dev/null | head -1 > /dev/null; then
|
||||||
|
log_info "Metrics endpoints detected"
|
||||||
|
MONITORING_SCORE=$((MONITORING_SCORE + 25))
|
||||||
|
else
|
||||||
|
log_warn "No metrics endpoints detected"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check for health endpoints
|
||||||
|
if grep -r "health" . --include="*.java" --include="*.js" --include="*.ts" -l 2>/dev/null | head -1 > /dev/null; then
|
||||||
|
log_info "Health endpoints detected"
|
||||||
|
MONITORING_SCORE=$((MONITORING_SCORE + 25))
|
||||||
|
else
|
||||||
|
log_warn "No health endpoints detected"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check for logging configuration
|
||||||
|
if [ -f "logging/logback.xml" ] || [ -f "logging/log4j2.xml" ] || [ -f "logging/config.js" ]; then
|
||||||
|
log_info "Logging configuration found"
|
||||||
|
MONITORING_SCORE=$((MONITORING_SCORE + 25))
|
||||||
|
else
|
||||||
|
log_warn "No logging configuration found"
|
||||||
|
fi
|
||||||
|
|
||||||
|
log_info "Monitoring Score: ${MONITORING_SCORE}/100"
|
||||||
|
RISK_SCORE=$((RISK_SCORE + (100 - MONITORING_SCORE)))
|
||||||
|
|
||||||
|
# 2. Alert Configuration
|
||||||
|
echo ""
|
||||||
|
log_info "=== 2. Alert Configuration ==="
|
||||||
|
|
||||||
|
ALERT_SCORE=0
|
||||||
|
|
||||||
|
if [ -f "monitoring/alerts.yml" ] || [ -f "monitoring/alerts.json" ]; then
|
||||||
|
log_info "Alert configuration found"
|
||||||
|
ALERT_SCORE=$((ALERT_SCORE + 50))
|
||||||
|
else
|
||||||
|
log_warn "No alert configuration found"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f "monitoring/notifications.config" ]; then
|
||||||
|
log_info "Notification configuration found"
|
||||||
|
ALERT_SCORE=$((ALERT_SCORE + 50))
|
||||||
|
else
|
||||||
|
log_warn "No notification configuration found"
|
||||||
|
fi
|
||||||
|
|
||||||
|
log_info "Alert Score: ${ALERT_SCORE}/100"
|
||||||
|
RISK_SCORE=$((RISK_SCORE + (100 - ALERT_SCORE)))
|
||||||
|
|
||||||
|
# 3. Rollback Capability
|
||||||
|
echo ""
|
||||||
|
log_info "=== 3. Rollback Capability ==="
|
||||||
|
|
||||||
|
ROLLBACK_SCORE=0
|
||||||
|
|
||||||
|
if [ -f "scripts/rollback.sh" ] || [ -f "scripts/rollback.py" ]; then
|
||||||
|
log_info "Rollback script found"
|
||||||
|
ROLLBACK_SCORE=$((ROLLBACK_SCORE + 50))
|
||||||
|
else
|
||||||
|
log_warn "No rollback script found"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f "docker-compose.yml" ] || [ -f "kubernetes/" ]; then
|
||||||
|
log_info "Container orchestration detected"
|
||||||
|
ROLLBACK_SCORE=$((ROLLBACK_SCORE + 50))
|
||||||
|
else
|
||||||
|
log_warn "No container orchestration detected"
|
||||||
|
fi
|
||||||
|
|
||||||
|
log_info "Rollback Score: ${ROLLBACK_SCORE}/100"
|
||||||
|
RISK_SCORE=$((RISK_SCORE + (100 - ROLLBACK_SCORE)))
|
||||||
|
|
||||||
|
# 4. Documentation
|
||||||
|
echo ""
|
||||||
|
log_info "=== 4. Documentation ==="
|
||||||
|
|
||||||
|
DOC_SCORE=0
|
||||||
|
|
||||||
|
if [ -f "docs/OPERATIONAL.md" ] || [ -f "docs/runbook.md" ]; then
|
||||||
|
log_info "Operational documentation found"
|
||||||
|
DOC_SCORE=$((DOC_SCORE + 50))
|
||||||
|
else
|
||||||
|
log_warn "No operational documentation found"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f "README.md" ]; then
|
||||||
|
log_info "README found"
|
||||||
|
DOC_SCORE=$((DOC_SCORE + 50))
|
||||||
|
else
|
||||||
|
log_warn "No README found"
|
||||||
|
fi
|
||||||
|
|
||||||
|
log_info "Documentation Score: ${DOC_SCORE}/100"
|
||||||
|
RISK_SCORE=$((RISK_SCORE + (100 - DOC_SCORE)))
|
||||||
|
|
||||||
|
# 5. Security
|
||||||
|
echo ""
|
||||||
|
log_info "=== 5. Security Configuration ==="
|
||||||
|
|
||||||
|
SECURITY_SCORE=0
|
||||||
|
|
||||||
|
if [ -f ".env.example" ]; then
|
||||||
|
log_info "Environment template found"
|
||||||
|
SECURITY_SCORE=$((SECURITY_SCORE + 20))
|
||||||
|
else
|
||||||
|
log_warn "No environment template found"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f "security/sast-config.yml" ] || [ -f ".sast.yml" ]; then
|
||||||
|
log_info "SAST configuration found"
|
||||||
|
SECURITY_SCORE=$((SECURITY_SCORE + 20))
|
||||||
|
else
|
||||||
|
log_warn "No SAST configuration found"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f "security/dependency-check.gradle" ] || [ -f ".snyk" ]; then
|
||||||
|
log_info "Dependency scanning configured"
|
||||||
|
SECURITY_SCORE=$((SECURITY_SCORE + 20))
|
||||||
|
else
|
||||||
|
log_warn "No dependency scanning configured"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f "SECRETS.md" ] || grep -r "secrets" . --include="*.md" -l 2>/dev/null | head -1 > /dev/null; then
|
||||||
|
log_info "Secrets management documented"
|
||||||
|
SECURITY_SCORE=$((SECURITY_SCORE + 20))
|
||||||
|
else
|
||||||
|
log_warn "No secrets management documentation"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f ".dockerignore" ] || [ -f ".gitignore" ]; then
|
||||||
|
log_info "Security ignore files present"
|
||||||
|
SECURITY_SCORE=$((SECURITY_SCORE + 20))
|
||||||
|
else
|
||||||
|
log_warn "No security ignore files"
|
||||||
|
fi
|
||||||
|
|
||||||
|
log_info "Security Score: ${SECURITY_SCORE}/100"
|
||||||
|
RISK_SCORE=$((RISK_SCORE + (100 - SECURITY_SCORE)))
|
||||||
|
|
||||||
|
# Calculate overall risk level
|
||||||
|
AVG_SCORE=$(( (MONITORING_SCORE + ALERT_SCORE + ROLLBACK_SCORE + DOC_SCORE + SECURITY_SCORE) / 5 ))
|
||||||
|
|
||||||
|
if [ ${AVG_SCORE} -ge 80 ]; then
|
||||||
|
RISK_LEVEL="LOW"
|
||||||
|
elif [ ${AVG_SCORE} -ge 60 ]; then
|
||||||
|
RISK_LEVEL="MEDIUM"
|
||||||
|
elif [ ${AVG_SCORE} -ge 40 ]; then
|
||||||
|
RISK_LEVEL="HIGH"
|
||||||
|
else
|
||||||
|
RISK_LEVEL="CRITICAL"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Generate report
|
||||||
|
echo ""
|
||||||
|
log_info "=== Generating Risk Assessment Report ==="
|
||||||
|
|
||||||
|
cat > "${REPORT_DIR}/operational_risk_${TIMESTAMP}.json" << EOF
|
||||||
|
{
|
||||||
|
"project": "${PROJECT_NAME}",
|
||||||
|
"timestamp": "${TIMESTAMP}",
|
||||||
|
"verification_type": "operational_risk",
|
||||||
|
"assessment": {
|
||||||
|
"monitoring": {
|
||||||
|
"score": ${MONITORING_SCORE},
|
||||||
|
"max_score": 100,
|
||||||
|
"status": $([ ${MONITORING_SCORE} -ge 75 ] && echo ""passed"" || echo ""needs_improvement"")
|
||||||
|
},
|
||||||
|
"alerts": {
|
||||||
|
"score": ${ALERT_SCORE},
|
||||||
|
"max_score": 100,
|
||||||
|
"status": $([ ${ALERT_SCORE} -ge 75 ] && echo ""passed"" || echo ""needs_improvement"")
|
||||||
|
},
|
||||||
|
"rollback": {
|
||||||
|
"score": ${ROLLBACK_SCORE},
|
||||||
|
"max_score": 100,
|
||||||
|
"status": $([ ${ROLLBACK_SCORE} -ge 75 ] && echo ""passed"" || echo ""needs_improvement"")
|
||||||
|
},
|
||||||
|
"documentation": {
|
||||||
|
"score": ${DOC_SCORE},
|
||||||
|
"max_score": 100,
|
||||||
|
"status": $([ ${DOC_SCORE} -ge 75 ] && echo ""passed"" || echo ""needs_improvement"")
|
||||||
|
},
|
||||||
|
"security": {
|
||||||
|
"score": ${SECURITY_SCORE},
|
||||||
|
"max_score": 100,
|
||||||
|
"status": $([ ${SECURITY_SCORE} -ge 75 ] && echo ""passed"" || echo ""needs_improvement"")
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"overall_score": ${AVG_SCORE},
|
||||||
|
"risk_level": "${RISK_LEVEL}",
|
||||||
|
"recommendations": [
|
||||||
|
$([ ${MONITORING_SCORE} -lt 75 ] && echo '"Implement comprehensive monitoring and metrics collection"' || echo ''),
|
||||||
|
$([ ${ALERT_SCORE} -lt 75 ] && echo '"Configure alerting rules and notification channels"' || echo ''),
|
||||||
|
$([ ${ROLLBACK_SCORE} -lt 75 ] && echo '"Develop and test rollback procedures"' || echo ''),
|
||||||
|
$([ ${DOC_SCORE} -lt 75 ] && echo '"Create operational documentation and runbooks"' || echo ''),
|
||||||
|
$([ ${SECURITY_SCORE} -lt 75 ] && echo '"Enhance security configuration and scanning"' || echo '')
|
||||||
|
]
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
log_info "Risk assessment report: ${REPORT_DIR}/operational_risk_${TIMESTAMP}.json"
|
||||||
|
|
||||||
|
# Final summary
|
||||||
|
echo ""
|
||||||
|
echo "========================================"
|
||||||
|
log_info "Operational Risk Assessment Summary"
|
||||||
|
echo "========================================"
|
||||||
|
echo "Monitoring: ${MONITORING_SCORE}/100"
|
||||||
|
echo "Alerts: ${ALERT_SCORE}/100"
|
||||||
|
echo "Rollback: ${ROLLBACK_SCORE}/100"
|
||||||
|
echo "Documentation: ${DOC_SCORE}/100"
|
||||||
|
echo "Security: ${SECURITY_SCORE}/100"
|
||||||
|
echo "----------------------------------------"
|
||||||
|
echo "Overall Score: ${AVG_SCORE}/100"
|
||||||
|
echo "Risk Level: ${RISK_LEVEL}"
|
||||||
|
echo "========================================"
|
||||||
|
|
||||||
|
if [ "${RISK_LEVEL}" = "LOW" ] || [ "${RISK_LEVEL}" = "MEDIUM" ]; then
|
||||||
|
log_info "Risk assessment: ACCEPTABLE"
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
log_warn "Risk assessment: NEEDS ATTENTION"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
147
scripts/verify-smoke.sh
Normal file
147
scripts/verify-smoke.sh
Normal file
|
|
@ -0,0 +1,147 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# Smoke Verification Script
|
||||||
|
# Usage: ./scripts/verify-smoke.sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
PROJECT_NAME="runtime-role-matrix-live-202607141522-v4"
|
||||||
|
REPORT_DIR="docs/reviewer/reports"
|
||||||
|
TIMESTAMP=$(date +"%Y%m%d_%H%M%S")
|
||||||
|
|
||||||
|
# Colors for output
|
||||||
|
RED='\033[0;31m'
|
||||||
|
GREEN='\033[0;32m'
|
||||||
|
YELLOW='\033[1;33m'
|
||||||
|
NC='\033[0m'
|
||||||
|
|
||||||
|
log_info() { echo -e "${GREEN}[INFO]${NC} $1"; }
|
||||||
|
log_warn() { echo -e "${YELLOW}[WARN]${NC} $1"; }
|
||||||
|
log_error() { echo -e "${RED}[ERROR]${NC} $1"; }
|
||||||
|
|
||||||
|
# Create report directory
|
||||||
|
mkdir -p "${REPORT_DIR}"
|
||||||
|
|
||||||
|
log_info "Starting Smoke Verification for ${PROJECT_NAME}"
|
||||||
|
|
||||||
|
# 1. Verify Changed Files
|
||||||
|
echo ""
|
||||||
|
log_info "=== 1. Changed Files Verification ==="
|
||||||
|
|
||||||
|
if [ -d ".git" ]; then
|
||||||
|
CHANGED_FILES=$(git diff --name-only HEAD~1 2>/dev/null || echo "")
|
||||||
|
if [ -n "${CHANGED_FILES}" ]; then
|
||||||
|
echo "Changed files:"
|
||||||
|
echo "${CHANGED_FILES}" | while read -r file; do
|
||||||
|
echo " - ${file}"
|
||||||
|
done
|
||||||
|
echo "CHANGED_FILES=${CHANGED_FILES}" > "${REPORT_DIR}/changed_files_${TIMESTAMP}.txt"
|
||||||
|
else
|
||||||
|
log_warn "No changed files found"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
log_warn "Not a git repository, skipping changed files check"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 2. Run Tests
|
||||||
|
echo ""
|
||||||
|
log_info "=== 2. Test Verification ==="
|
||||||
|
|
||||||
|
if [ -f "pom.xml" ]; then
|
||||||
|
log_info "Running Maven tests..."
|
||||||
|
mvn test -q 2>&1 | tee "${REPORT_DIR}/test_results_${TIMESTAMP}.txt"
|
||||||
|
TEST_RESULT=$?
|
||||||
|
if [ ${TEST_RESULT} -eq 0 ]; then
|
||||||
|
log_info "All tests passed"
|
||||||
|
else
|
||||||
|
log_error "Some tests failed"
|
||||||
|
fi
|
||||||
|
elif [ -f "package.json" ]; then
|
||||||
|
log_info "Running npm tests..."
|
||||||
|
npm test 2>&1 | tee "${REPORT_DIR}/test_results_${TIMESTAMP}.txt"
|
||||||
|
TEST_RESULT=$?
|
||||||
|
else
|
||||||
|
log_warn "No test framework detected"
|
||||||
|
TEST_RESULT=0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 3. CI Verification
|
||||||
|
echo ""
|
||||||
|
log_info "=== 3. CI Verification ==="
|
||||||
|
|
||||||
|
if [ -f ".github/workflows/ci.yml" ] || [ -f ".gitlab-ci.yml" ] || [ -f "Jenkinsfile" ]; then
|
||||||
|
log_info "CI configuration found"
|
||||||
|
echo "CI_CONFIG=found" > "${REPORT_DIR}/ci_status_${TIMESTAMP}.txt"
|
||||||
|
else
|
||||||
|
log_warn "No CI configuration found"
|
||||||
|
echo "CI_CONFIG=not_found" > "${REPORT_DIR}/ci_status_${TIMESTAMP}.txt"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 4. Build Verification
|
||||||
|
echo ""
|
||||||
|
log_info "=== 4. Build Verification ==="
|
||||||
|
|
||||||
|
if [ -f "pom.xml" ]; then
|
||||||
|
log_info "Building with Maven..."
|
||||||
|
mvn clean package -DskipTests -q 2>&1 | tee "${REPORT_DIR}/build_results_${TIMESTAMP}.txt"
|
||||||
|
BUILD_RESULT=$?
|
||||||
|
if [ ${BUILD_RESULT} -eq 0 ]; then
|
||||||
|
log_info "Build successful"
|
||||||
|
else
|
||||||
|
log_error "Build failed"
|
||||||
|
fi
|
||||||
|
elif [ -f "package.json" ]; then
|
||||||
|
log_info "Building with npm..."
|
||||||
|
npm run build 2>&1 | tee "${REPORT_DIR}/build_results_${TIMESTAMP}.txt"
|
||||||
|
BUILD_RESULT=$?
|
||||||
|
else
|
||||||
|
log_warn "No build configuration detected"
|
||||||
|
BUILD_RESULT=0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 5. Generate Summary Report
|
||||||
|
echo ""
|
||||||
|
log_info "=== 5. Generating Summary Report ==="
|
||||||
|
|
||||||
|
cat > "${REPORT_DIR}/smoke_summary_${TIMESTAMP}.json" << EOF
|
||||||
|
{
|
||||||
|
"project": "${PROJECT_NAME}",
|
||||||
|
"timestamp": "${TIMESTAMP}",
|
||||||
|
"verification_type": "smoke",
|
||||||
|
"results": {
|
||||||
|
"changed_files": {
|
||||||
|
"status": "verified",
|
||||||
|
"count": $(echo "${CHANGED_FILES}" | grep -c "^" || echo 0)
|
||||||
|
},
|
||||||
|
"tests": {
|
||||||
|
"status": $([ ${TEST_RESULT} -eq 0 ] && echo "passed" || echo "failed"),
|
||||||
|
"exit_code": ${TEST_RESULT}
|
||||||
|
},
|
||||||
|
"ci": {
|
||||||
|
"status": "verified"
|
||||||
|
},
|
||||||
|
"build": {
|
||||||
|
"status": $([ ${BUILD_RESULT} -eq 0 ] && echo "success" || echo "failed"),
|
||||||
|
"exit_code": ${BUILD_RESULT}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"overall_status": $([ ${TEST_RESULT} -eq 0 ] && [ ${BUILD_RESULT} -eq 0 ] && echo "passed" || echo "failed"),
|
||||||
|
"report_files": {
|
||||||
|
"changed_files": "${REPORT_DIR}/changed_files_${TIMESTAMP}.txt",
|
||||||
|
"test_results": "${REPORT_DIR}/test_results_${TIMESTAMP}.txt",
|
||||||
|
"ci_status": "${REPORT_DIR}/ci_status_${TIMESTAMP}.txt",
|
||||||
|
"build_results": "${REPORT_DIR}/build_results_${TIMESTAMP}.txt"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
log_info "Summary report: ${REPORT_DIR}/smoke_summary_${TIMESTAMP}.json"
|
||||||
|
|
||||||
|
# Final status
|
||||||
|
echo ""
|
||||||
|
if [ ${TEST_RESULT} -eq 0 ] && [ ${BUILD_RESULT} -eq 0 ]; then
|
||||||
|
log_info "=== SMOKE VERIFICATION PASSED ==="
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
log_error "=== SMOKE VERIFICATION FAILED ==="
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
Loading…
Add table
Add a link
Reference in a new issue