Files
aitbc/scripts/utils/check-documentation-requirements.sh
aitbc1 bfe6f94b75
Some checks failed
AITBC CI/CD Pipeline / lint-and-test (3.11) (push) Has been cancelled
AITBC CI/CD Pipeline / lint-and-test (3.12) (push) Has been cancelled
AITBC CI/CD Pipeline / lint-and-test (3.13) (push) Has been cancelled
AITBC CI/CD Pipeline / test-cli (push) Has been cancelled
AITBC CI/CD Pipeline / test-services (push) Has been cancelled
AITBC CI/CD Pipeline / test-production-services (push) Has been cancelled
AITBC CI/CD Pipeline / security-scan (push) Has been cancelled
AITBC CI/CD Pipeline / build (push) Has been cancelled
AITBC CI/CD Pipeline / deploy-staging (push) Has been cancelled
AITBC CI/CD Pipeline / deploy-production (push) Has been cancelled
AITBC CI/CD Pipeline / performance-test (push) Has been cancelled
AITBC CI/CD Pipeline / docs (push) Has been cancelled
AITBC CI/CD Pipeline / release (push) Has been cancelled
AITBC CI/CD Pipeline / notify (push) Has been cancelled
Security Scanning / Bandit Security Scan (apps/coordinator-api/src) (push) Has been cancelled
Security Scanning / Bandit Security Scan (cli/aitbc_cli) (push) Has been cancelled
Security Scanning / Bandit Security Scan (packages/py/aitbc-core/src) (push) Has been cancelled
Security Scanning / Bandit Security Scan (packages/py/aitbc-crypto/src) (push) Has been cancelled
Security Scanning / Bandit Security Scan (packages/py/aitbc-sdk/src) (push) Has been cancelled
Security Scanning / Bandit Security Scan (tests) (push) Has been cancelled
Security Scanning / CodeQL Security Analysis (javascript) (push) Has been cancelled
Security Scanning / CodeQL Security Analysis (python) (push) Has been cancelled
Security Scanning / Dependency Security Scan (push) Has been cancelled
Security Scanning / Container Security Scan (push) Has been cancelled
Security Scanning / OSSF Scorecard (push) Has been cancelled
Security Scanning / Security Summary Report (push) Has been cancelled
AITBC CLI Level 1 Commands Test / test-cli-level1 (3.11) (push) Has been cancelled
AITBC CLI Level 1 Commands Test / test-cli-level1 (3.12) (push) Has been cancelled
AITBC CLI Level 1 Commands Test / test-cli-level1 (3.13) (push) Has been cancelled
AITBC CLI Level 1 Commands Test / test-summary (push) Has been cancelled
chore: remove outdated documentation and reference files
- Remove debugging service documentation (DEBUgging_SERVICES.md)
- Remove development logs policy and quick reference guides
- Remove E2E test creation summary
- Remove gift certificate example file
- Remove GitHub pull summary documentation
2026-03-25 12:56:07 +01:00

153 lines
5.1 KiB
Bash
Executable File

#!/bin/bash
# File: /home/oib/windsurf/aitbc/scripts/check-documentation-requirements.sh
set -e
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
echo "🔍 Checking Documentation for Requirement Consistency"
echo "=================================================="
ISSUES_FOUND=false
# Function to check Python version in documentation
check_python_docs() {
echo -e "\n📋 Checking Python version documentation..."
# Find all markdown files
find docs/ -name "*.md" -type f | while read -r file; do
# Check for incorrect Python versions
if grep -q "python.*3\.[0-9][0-9]" "$file"; then
echo -e "${YELLOW}⚠️ $file: Contains Python version references${NC}"
grep -n "python.*3\.[0-9][0-9]" "$file" | head -3
fi
# Check for correct Python 3.13.5 requirement
if grep -q "3\.13\.5" "$file"; then
echo -e "${GREEN}$file: Contains Python 3.13.5 requirement${NC}"
fi
done
}
# Function to check system requirements documentation
check_system_docs() {
echo -e "\n📋 Checking system requirements documentation..."
# Check main deployment guide
if [ -f "docs/10_plan/aitbc.md" ]; then
echo "Checking aitbc.md..."
# Check Python version
if grep -q "3\.13\.5.*minimum.*requirement" docs/10_plan/aitbc.md; then
echo -e "${GREEN}✅ Python 3.13.5 minimum requirement documented${NC}"
else
echo -e "${RED}❌ Python 3.13.5 minimum requirement missing or incorrect${NC}"
ISSUES_FOUND=true
fi
# Check system requirements
if grep -q "8GB.*RAM.*minimum" docs/10_plan/aitbc.md; then
echo -e "${GREEN}✅ Memory requirement documented${NC}"
else
echo -e "${RED}❌ Memory requirement missing or incorrect${NC}"
ISSUES_FOUND=true
fi
# Check storage requirement
if grep -q "50GB.*available.*space" docs/10_plan/aitbc.md; then
echo -e "${GREEN}✅ Storage requirement documented${NC}"
else
echo -e "${RED}❌ Storage requirement missing or incorrect${NC}"
ISSUES_FOUND=true
fi
else
echo -e "${RED}❌ Main deployment guide (aitbc.md) not found${NC}"
ISSUES_FOUND=true
fi
}
# Function to check service files for Python version checks
check_service_files() {
echo -e "\n📋 Checking service files for Python version validation..."
if [ -d "systemd" ]; then
find systemd/ -name "*.service" -type f | while read -r file; do
if grep -q "python.*version" "$file"; then
echo -e "${GREEN}$file: Contains Python version check${NC}"
else
echo -e "${YELLOW}⚠️ $file: Missing Python version check${NC}"
fi
done
fi
}
# Function to check requirements files
check_requirements_files() {
echo -e "\n📋 Checking requirements files..."
# Check Python requirements
if [ -f "apps/coordinator-api/requirements.txt" ]; then
echo "Checking coordinator-api requirements.txt..."
# Check for Python version specification
if grep -q "python_requires" apps/coordinator-api/requirements.txt; then
echo -e "${GREEN}✅ Python version requirement specified${NC}"
else
echo -e "${YELLOW}⚠️ Python version requirement not specified in requirements.txt${NC}"
fi
fi
# Check pyproject.toml
if [ -f "pyproject.toml" ]; then
echo "Checking pyproject.toml..."
if grep -q "requires-python.*3\.13" pyproject.toml; then
echo -e "${GREEN}✅ Python 3.13+ requirement in pyproject.toml${NC}"
else
echo -e "${YELLOW}⚠️ Python 3.13+ requirement missing in pyproject.toml${NC}"
fi
fi
}
# Function to check for hardcoded versions in code
check_hardcoded_versions() {
echo -e "\n📋 Checking for hardcoded versions in code..."
# Find Python files with version checks
find apps/ -name "*.py" -type f -exec grep -l "sys.version_info" {} \; | while read -r file; do
echo -e "${GREEN}$file: Contains version check${NC}"
# Check if version is correct
if grep -q "3.*13.*5" "$file"; then
echo -e "${GREEN} ✅ Correct version requirement (3.13.5)${NC}"
else
echo -e "${YELLOW} ⚠️ May have incorrect version requirement${NC}"
fi
done
}
# Run all checks
check_python_docs
check_system_docs
check_service_files
check_requirements_files
check_hardcoded_versions
# Summary
echo -e "\n📊 Documentation Check Summary"
echo "============================="
if [ "$ISSUES_FOUND" = true ]; then
echo -e "${RED}❌ Issues found in documentation requirements${NC}"
echo -e "${RED}Please fix the above issues before deployment${NC}"
exit 1
else
echo -e "${GREEN}✅ Documentation requirements are consistent${NC}"
echo -e "${GREEN}Ready for deployment!${NC}"
exit 0
fi