Skip to content

Commit a86b454

Browse files
committed
Remove zebrunner.sh legacy shell infrastructure
- Removed zebrunner.sh entry point and lib/ shell scripts - Deleted legacy backup/ folder (no longer needed) - Removed patch/ shell scripts and tests/ shell tests - Updated .gitignore to remove backup/ patterns - Replaced CI workflow with Node-based lint/test (ESLint + Jest) - Updated README to reflect backup.ts removal (legacy) - Removed 'Converted from zebrunner.sh' comment from CLI - All TypeScript CLI functionality remains intact
1 parent 8e3930e commit a86b454

47 files changed

Lines changed: 43 additions & 19441 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/code-quality.yml

Lines changed: 40 additions & 146 deletions
Original file line numberDiff line numberDiff line change
@@ -6,169 +6,63 @@ on:
66
pull_request:
77
branches: [ main, master, develop ]
88
schedule:
9-
- cron: '0 0 * * 0' # Weekly on Sunday
9+
- cron: '0 0 * * 0'
1010

1111
jobs:
12-
shellcheck:
13-
name: ShellCheck Analysis
12+
lint:
13+
name: ESLint
1414
runs-on: ubuntu-latest
15-
1615
steps:
1716
- name: Checkout code
1817
uses: actions/checkout@v4
19-
20-
- name: Run ShellCheck
21-
uses: ludeeus/action-shellcheck@master
22-
with:
23-
scandir: '.'
24-
severity: warning
25-
ignore_paths: '.git node_modules'
26-
27-
- name: Upload ShellCheck results
28-
if: always()
29-
uses: actions/upload-artifact@v3
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
3021
with:
31-
name: shellcheck-results
32-
path: shellcheck.log
22+
node-version: 18
23+
cache: npm
24+
25+
- name: Install dependencies
26+
run: npm ci
3327

34-
code-complexity:
35-
name: Code Complexity Analysis
28+
- name: Run lint
29+
run: npm run lint
30+
31+
test:
32+
name: Jest Tests
3633
runs-on: ubuntu-latest
37-
34+
needs: lint
3835
steps:
3936
- name: Checkout code
4037
uses: actions/checkout@v4
41-
42-
- name: Analyze code complexity
43-
run: |
44-
echo "# Code Complexity Report" > complexity-report.md
45-
echo "" >> complexity-report.md
46-
47-
for file in zebrunner.sh lib/*.sh; do
48-
if [ -f "$file" ]; then
49-
lines=$(wc -l < "$file")
50-
functions=$(grep -c "^[a-zA-Z_][a-zA-Z0-9_]*\s*()" "$file" || echo 0)
51-
echo "## $file" >> complexity-report.md
52-
echo "- Lines: $lines" >> complexity-report.md
53-
echo "- Functions: $functions" >> complexity-report.md
54-
echo "" >> complexity-report.md
55-
fi
56-
done
57-
58-
cat complexity-report.md
59-
60-
- name: Upload complexity report
61-
uses: actions/upload-artifact@v4
38+
39+
- name: Setup Node.js
40+
uses: actions/setup-node@v4
6241
with:
63-
name: complexity-report
64-
path: complexity-report.md
42+
node-version: 18
43+
cache: npm
44+
45+
- name: Install dependencies
46+
run: npm ci
47+
48+
- name: Run tests with coverage
49+
run: npm test -- --coverage
6550

66-
test-coverage:
67-
name: Test Coverage Analysis
68-
runs-on: ubuntu-latest
69-
70-
steps:
71-
- name: Checkout code
72-
uses: actions/checkout@v4
73-
74-
- name: Make scripts executable
75-
run: |
76-
chmod +x tests/*.sh
77-
chmod +x zebrunner.sh
78-
chmod +x lib/*.sh
79-
80-
- name: Run tests with coverage tracking
81-
run: |
82-
cd tests
83-
bash test_runner.sh
84-
85-
- name: Generate coverage report
86-
run: |
87-
echo "# Test Coverage Report" > coverage-report.md
88-
echo "" >> coverage-report.md
89-
90-
total_functions=0
91-
tested_functions=0
92-
93-
for lib_file in lib/*.sh; do
94-
if [ -f "$lib_file" ]; then
95-
lib_name=$(basename "$lib_file" .sh)
96-
test_file="tests/test_${lib_name}.sh"
97-
98-
functions=$(grep -c "^[a-zA-Z_][a-zA-Z0-9_]*\s*()" "$lib_file" || echo 0)
99-
total_functions=$((total_functions + functions))
100-
101-
if [ -f "$test_file" ]; then
102-
tests=$(grep -c "^test_" "$test_file" || echo 0)
103-
tested_functions=$((tested_functions + tests))
104-
echo "## $lib_name.sh" >> coverage-report.md
105-
echo "- Functions: $functions" >> coverage-report.md
106-
echo "- Tests: $tests" >> coverage-report.md
107-
echo "- Coverage: $(awk "BEGIN {printf \"%.1f\", ($tests/$functions)*100}")%" >> coverage-report.md
108-
else
109-
echo "## $lib_name.sh" >> coverage-report.md
110-
echo "- Functions: $functions" >> coverage-report.md
111-
echo "- Tests: 0" >> coverage-report.md
112-
echo "- Coverage: 0%" >> coverage-report.md
113-
fi
114-
echo "" >> coverage-report.md
115-
fi
116-
done
117-
118-
overall_coverage=$(awk "BEGIN {printf \"%.1f\", ($tested_functions/$total_functions)*100}")
119-
echo "## Overall Coverage" >> coverage-report.md
120-
echo "- Total Functions: $total_functions" >> coverage-report.md
121-
echo "- Tested Functions: $tested_functions" >> coverage-report.md
122-
echo "- **Coverage: ${overall_coverage}%**" >> coverage-report.md
123-
124-
cat coverage-report.md
125-
12651
- name: Upload coverage report
127-
uses: actions/upload-artifact@v3
52+
uses: actions/upload-artifact@v4
12853
with:
12954
name: coverage-report
130-
path: coverage-report.md
131-
55+
path: coverage
56+
13257
- name: Coverage summary
58+
if: always()
13359
run: |
13460
echo "## Test Coverage" >> $GITHUB_STEP_SUMMARY
135-
cat coverage-report.md >> $GITHUB_STEP_SUMMARY
136-
137-
dependency-check:
138-
name: Dependency Security Check
139-
runs-on: ubuntu-latest
140-
141-
steps:
142-
- name: Checkout code
143-
uses: actions/checkout@v4
144-
145-
- name: Check for vulnerable dependencies
146-
run: |
147-
echo "Checking Docker image versions..."
148-
if [ -f docker-compose.yml ]; then
149-
grep "image:" docker-compose.yml | while read -r line; do
150-
echo "$line"
151-
done
152-
fi
153-
154-
echo "Checking for outdated packages..."
155-
# Add specific checks as needed
156-
157-
quality-gate:
158-
name: Quality Gate
159-
runs-on: ubuntu-latest
160-
needs: [shellcheck, code-complexity, test-coverage, dependency-check]
161-
162-
steps:
163-
- name: Quality gate check
164-
run: |
165-
echo "# Quality Gate Results" >> $GITHUB_STEP_SUMMARY
166-
echo "" >> $GITHUB_STEP_SUMMARY
167-
echo "✅ All quality checks passed!" >> $GITHUB_STEP_SUMMARY
168-
echo "" >> $GITHUB_STEP_SUMMARY
169-
echo "| Check | Status |" >> $GITHUB_STEP_SUMMARY
170-
echo "|-------|--------|" >> $GITHUB_STEP_SUMMARY
171-
echo "| ShellCheck | ✅ Passed |" >> $GITHUB_STEP_SUMMARY
172-
echo "| Code Complexity | ✅ Passed |" >> $GITHUB_STEP_SUMMARY
173-
echo "| Test Coverage | ✅ Passed |" >> $GITHUB_STEP_SUMMARY
174-
echo "| Dependency Check | ✅ Passed |" >> $GITHUB_STEP_SUMMARY
61+
if [ -f coverage/lcov.info ]; then
62+
lines=$(grep -m1 'LF:' coverage/lcov.info | cut -d: -f2)
63+
covered=$(grep -m1 'LH:' coverage/lcov.info | cut -d: -f2)
64+
percent=$(awk "BEGIN { if ($lines>0) printf \"%.1f\", ($covered/$lines)*100; else print 0 }")
65+
echo "- Lines covered: ${covered}/${lines} (${percent}%)" >> $GITHUB_STEP_SUMMARY
66+
else
67+
echo "- Coverage report not generated" >> $GITHUB_STEP_SUMMARY
68+
fi

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
*.bak
33
nginx/conf.d/default.conf
44
.disabled
5-
backup/settings.env
6-
backup/*tar.gz
75
NOTICE.txt
86
setup.txt
9-
node_modules
7+
node_modules

README_TYPESCRIPT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ TypeScript/Node.js offers similar performance to Bash for I/O-bound operations:
446446
## Future Enhancements
447447

448448
- [ ] Add setup module with interactive prompts
449-
- [ ] Implement backup/restore modules
449+
- [ ] Implement backup/restore modules (legacy removed - use native Docker volumes/external tools)
450450
- [ ] Add upgrade module with patch management
451451
- [ ] Create REST API for programmatic access
452452
- [ ] Add web UI for visual management

backup/.gitkeep

Lines changed: 0 additions & 1 deletion
This file was deleted.

backup/settings.env.original

Lines changed: 0 additions & 29 deletions
This file was deleted.

backup/setup.txt

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)