pipecraft 0.0.0-releaseit
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.local.json +35 -0
- package/.github/actions/calculate-version/action.yml +106 -0
- package/.github/actions/create-pr/action.yml +122 -0
- package/.github/actions/create-release/action.yml +74 -0
- package/.github/actions/create-tag/action.yml +94 -0
- package/.github/actions/detect-changes/action.yml +62 -0
- package/.github/actions/manage-branch/action.yml +113 -0
- package/.github/actions/promote-branch/action.yml +352 -0
- package/.github/example/workflows/job.analyze.code.yml +26 -0
- package/.github/example/workflows/job.analyze.docker.yml +32 -0
- package/.github/example/workflows/job.app.api.deploy.yml +127 -0
- package/.github/example/workflows/job.app.api.test.yml +102 -0
- package/.github/example/workflows/job.app.docs.deploy.yml +40 -0
- package/.github/example/workflows/job.app.docs.test.yml +50 -0
- package/.github/example/workflows/job.app.web.deploy.yml +96 -0
- package/.github/example/workflows/job.app.web.test.yml +49 -0
- package/.github/example/workflows/job.changes.yml +82 -0
- package/.github/example/workflows/job.create-pr.yml +96 -0
- package/.github/example/workflows/job.env-check.yml +43 -0
- package/.github/example/workflows/job.fast-forward.yml +103 -0
- package/.github/example/workflows/job.lint.yml +64 -0
- package/.github/example/workflows/job.pr-name.yml +70 -0
- package/.github/example/workflows/job.pr-squash-name.yml +27 -0
- package/.github/example/workflows/job.tag.yml +38 -0
- package/.github/example/workflows/job.version.yml +99 -0
- package/.github/example/workflows/lib.plugin-base.publish.yml +59 -0
- package/.github/example/workflows/pipe.yml +178 -0
- package/.github/example/workflows/scripts/fastforward.sh +51 -0
- package/.github/example/workflows/scripts/pipe-cleaner.sh +70 -0
- package/.github/scripts/fastforward.sh +51 -0
- package/.github/scripts/pipe-cleaner.sh +70 -0
- package/.github/workflows/pipeline.yml +220 -0
- package/.github/workflows/pr-title-check.yml +70 -0
- package/.github/workflows/publish.yml +39 -0
- package/.pipecraftrc.json +78 -0
- package/.release-it.cjs +71 -0
- package/PIPELINE_TESTING_PLAN.md +499 -0
- package/README.md +1101 -0
- package/TRUNK_FLOW_PLAN.md +401 -0
- package/assets/logo_banner.png +0 -0
- package/assets/logo_banner.webp +0 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +364 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/generators/init.tpl.d.ts +3 -0
- package/dist/generators/init.tpl.d.ts.map +1 -0
- package/dist/generators/init.tpl.js +117 -0
- package/dist/generators/init.tpl.js.map +1 -0
- package/dist/generators/workflows.tpl.d.ts +7 -0
- package/dist/generators/workflows.tpl.d.ts.map +1 -0
- package/dist/generators/workflows.tpl.js +73 -0
- package/dist/generators/workflows.tpl.js.map +1 -0
- package/dist/templates/actions/calculate-version.yml.tpl.d.ts +3 -0
- package/dist/templates/actions/calculate-version.yml.tpl.d.ts.map +1 -0
- package/dist/templates/actions/calculate-version.yml.tpl.js +122 -0
- package/dist/templates/actions/calculate-version.yml.tpl.js.map +1 -0
- package/dist/templates/actions/create-pr.yml.tpl.d.ts +3 -0
- package/dist/templates/actions/create-pr.yml.tpl.d.ts.map +1 -0
- package/dist/templates/actions/create-pr.yml.tpl.js +145 -0
- package/dist/templates/actions/create-pr.yml.tpl.js.map +1 -0
- package/dist/templates/actions/create-tag.yml.tpl.d.ts +3 -0
- package/dist/templates/actions/create-tag.yml.tpl.d.ts.map +1 -0
- package/dist/templates/actions/create-tag.yml.tpl.js +111 -0
- package/dist/templates/actions/create-tag.yml.tpl.js.map +1 -0
- package/dist/templates/actions/detect-changes.yml.tpl.d.ts +3 -0
- package/dist/templates/actions/detect-changes.yml.tpl.d.ts.map +1 -0
- package/dist/templates/actions/detect-changes.yml.tpl.js +79 -0
- package/dist/templates/actions/detect-changes.yml.tpl.js.map +1 -0
- package/dist/templates/actions/manage-branch.yml.tpl.d.ts +3 -0
- package/dist/templates/actions/manage-branch.yml.tpl.d.ts.map +1 -0
- package/dist/templates/actions/manage-branch.yml.tpl.js +130 -0
- package/dist/templates/actions/manage-branch.yml.tpl.js.map +1 -0
- package/dist/templates/actions/promote-branch.yml.tpl.d.ts +3 -0
- package/dist/templates/actions/promote-branch.yml.tpl.d.ts.map +1 -0
- package/dist/templates/actions/promote-branch.yml.tpl.js +362 -0
- package/dist/templates/actions/promote-branch.yml.tpl.js.map +1 -0
- package/dist/templates/workflows/pipeline-path-based.yml.tpl.d.ts +16 -0
- package/dist/templates/workflows/pipeline-path-based.yml.tpl.d.ts.map +1 -0
- package/dist/templates/workflows/pipeline-path-based.yml.tpl.js +652 -0
- package/dist/templates/workflows/pipeline-path-based.yml.tpl.js.map +1 -0
- package/dist/types/index.d.ts +63 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/ast-path-operations.d.ts +287 -0
- package/dist/utils/ast-path-operations.d.ts.map +1 -0
- package/dist/utils/ast-path-operations.js +419 -0
- package/dist/utils/ast-path-operations.js.map +1 -0
- package/dist/utils/config.d.ts +3 -0
- package/dist/utils/config.d.ts.map +1 -0
- package/dist/utils/config.js +49 -0
- package/dist/utils/config.js.map +1 -0
- package/dist/utils/github-setup.d.ts +74 -0
- package/dist/utils/github-setup.d.ts.map +1 -0
- package/dist/utils/github-setup.js +418 -0
- package/dist/utils/github-setup.js.map +1 -0
- package/dist/utils/idempotency.d.ts +47 -0
- package/dist/utils/idempotency.d.ts.map +1 -0
- package/dist/utils/idempotency.js +176 -0
- package/dist/utils/idempotency.js.map +1 -0
- package/dist/utils/preflight.d.ts +55 -0
- package/dist/utils/preflight.d.ts.map +1 -0
- package/dist/utils/preflight.js +261 -0
- package/dist/utils/preflight.js.map +1 -0
- package/dist/utils/versioning.d.ts +41 -0
- package/dist/utils/versioning.d.ts.map +1 -0
- package/dist/utils/versioning.js +219 -0
- package/dist/utils/versioning.js.map +1 -0
- package/docs/USER_JOURNEY_ERRORS.md +352 -0
- package/eslint.config.js +77 -0
- package/examples/basic-config.json +41 -0
- package/examples/monorepo-config.json +49 -0
- package/examples/usage.md +289 -0
- package/package.json +58 -0
- package/scripts/debug-workflows.sh +339 -0
- package/scripts/parse-pipeline.js +29 -0
- package/scripts/test-job-order.cjs +140 -0
- package/scripts/validate-pipeline.cjs +379 -0
- package/scripts/verify-job-order.sh +30 -0
- package/src/cli/index.ts +414 -0
- package/src/generators/init.tpl.ts +126 -0
- package/src/generators/workflows.tpl.ts +80 -0
- package/src/templates/actions/calculate-version.yml.tpl.ts +124 -0
- package/src/templates/actions/create-pr.yml.tpl.ts +147 -0
- package/src/templates/actions/create-tag.yml.tpl.ts +112 -0
- package/src/templates/actions/detect-changes.yml.tpl.ts +87 -0
- package/src/templates/actions/manage-branch.yml.tpl.ts +132 -0
- package/src/templates/actions/promote-branch.yml.tpl.ts +364 -0
- package/src/templates/workflows/pipeline-path-based.yml.tpl.ts +706 -0
- package/src/types/index.ts +64 -0
- package/src/utils/README-ast-path-operations.md +390 -0
- package/src/utils/ast-path-operations.ts +581 -0
- package/src/utils/config.ts +64 -0
- package/src/utils/github-setup.ts +558 -0
- package/src/utils/idempotency.ts +215 -0
- package/src/utils/preflight.ts +306 -0
- package/src/utils/versioning.ts +244 -0
- package/tests/README.md +229 -0
- package/tests/TEST_STRUCTURE.md +256 -0
- package/tests/act/run-act-tests.sh +345 -0
- package/tests/debugging/debug-utils.ts +538 -0
- package/tests/debugging/debug-workflow.test.ts +339 -0
- package/tests/debugging/debug-workflows.sh +339 -0
- package/tests/debugging/iterative-debug.ts +652 -0
- package/tests/debugging/run-debug-tests.sh +431 -0
- package/tests/fixtures/basic-config.json +51 -0
- package/tests/fixtures/invalid-config.json +9 -0
- package/tests/fixtures/pipeline-generated.yml +235 -0
- package/tests/fixtures/pipeline-preserve-comments.yml +245 -0
- package/tests/fixtures/pipeline-user-modified.yml +245 -0
- package/tests/fixtures/test-config.json +58 -0
- package/tests/github-live/README.md +250 -0
- package/tests/github-local/JOB_WORKFLOW_TESTS.md +296 -0
- package/tests/github-local/README.md +240 -0
- package/tests/github-local/run-all-tests.sh +422 -0
- package/tests/github-local/test-job-workflows.sh +631 -0
- package/tests/github-local/test-pipeline-workflow.sh +440 -0
- package/tests/integration/generators.test.ts +578 -0
- package/tests/integration/path-based-template.test.ts +510 -0
- package/tests/integration/simple-path-based.test.ts +415 -0
- package/tests/setup.ts +56 -0
- package/tests/unit/ast-path-operations-extended.test.ts +302 -0
- package/tests/unit/cli.test.ts +541 -0
- package/tests/unit/config-extended.test.ts +412 -0
- package/tests/unit/config.test.ts +152 -0
- package/tests/unit/github-setup.test.ts +189 -0
- package/tests/unit/idempotency-isolated.test.ts +297 -0
- package/tests/unit/job-order.test.ts +157 -0
- package/tests/unit/pipeline-path-based.test.ts +511 -0
- package/tests/unit/validate-pipeline.test.ts +384 -0
- package/tests/unit/versioning-extended.test.ts +279 -0
- package/tests/unit/versioning.test.ts +241 -0
- package/tsconfig.debug.json +17 -0
- package/tsconfig.json +28 -0
- package/vitest.config.ts +51 -0
|
@@ -0,0 +1,431 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Comprehensive GitHub Actions Debugging Test Runner
|
|
4
|
+
# This script runs all debugging tests and provides a summary
|
|
5
|
+
|
|
6
|
+
set -euo pipefail
|
|
7
|
+
|
|
8
|
+
# Colors for output
|
|
9
|
+
RED='\033[0;31m'
|
|
10
|
+
GREEN='\033[0;32m'
|
|
11
|
+
YELLOW='\033[1;33m'
|
|
12
|
+
BLUE='\033[0;34m'
|
|
13
|
+
PURPLE='\033[0;35m'
|
|
14
|
+
CYAN='\033[0;36m'
|
|
15
|
+
NC='\033[0m' # No Color
|
|
16
|
+
|
|
17
|
+
# Configuration
|
|
18
|
+
TEST_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
19
|
+
PROJECT_ROOT="$(cd "$TEST_DIR/.." && pwd)"
|
|
20
|
+
OUTPUT_DIR="$TEST_DIR/debug-output"
|
|
21
|
+
VERBOSE=false
|
|
22
|
+
RUN_UNIT_TESTS=true
|
|
23
|
+
RUN_INTEGRATION_TESTS=false
|
|
24
|
+
RUN_SHELL_TESTS=true
|
|
25
|
+
|
|
26
|
+
# Function to print colored output
|
|
27
|
+
print_status() {
|
|
28
|
+
local status=$1
|
|
29
|
+
local message=$2
|
|
30
|
+
|
|
31
|
+
case $status in
|
|
32
|
+
"SUCCESS") echo -e "${GREEN}✓${NC} $message" ;;
|
|
33
|
+
"FAILURE") echo -e "${RED}✗${NC} $message" ;;
|
|
34
|
+
"SKIP") echo -e "${YELLOW}⊘${NC} $message" ;;
|
|
35
|
+
"INFO") echo -e "${BLUE}ℹ${NC} $message" ;;
|
|
36
|
+
"WARNING") echo -e "${YELLOW}⚠${NC} $message" ;;
|
|
37
|
+
*) echo -e "${CYAN}?${NC} $message" ;;
|
|
38
|
+
esac
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
# Function to show usage
|
|
42
|
+
show_usage() {
|
|
43
|
+
cat << EOF
|
|
44
|
+
Usage: $0 [OPTIONS]
|
|
45
|
+
|
|
46
|
+
GitHub Actions Debugging Test Runner
|
|
47
|
+
|
|
48
|
+
OPTIONS:
|
|
49
|
+
-u, --unit Run unit tests only
|
|
50
|
+
-i, --integration Run integration tests only
|
|
51
|
+
-s, --shell Run shell script tests only
|
|
52
|
+
-a, --all Run all tests (default)
|
|
53
|
+
-v, --verbose Verbose output
|
|
54
|
+
-o, --output DIR Output directory for test results
|
|
55
|
+
-h, --help Show this help message
|
|
56
|
+
|
|
57
|
+
EXAMPLES:
|
|
58
|
+
$0 --unit --verbose
|
|
59
|
+
$0 --integration --output ./test-results
|
|
60
|
+
$0 --all --verbose
|
|
61
|
+
|
|
62
|
+
EOF
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
# Function to check prerequisites
|
|
66
|
+
check_prerequisites() {
|
|
67
|
+
print_status "INFO" "Checking prerequisites..."
|
|
68
|
+
|
|
69
|
+
local missing_deps=()
|
|
70
|
+
|
|
71
|
+
# Check for required commands
|
|
72
|
+
if ! command -v node &> /dev/null; then
|
|
73
|
+
missing_deps+=("node")
|
|
74
|
+
fi
|
|
75
|
+
|
|
76
|
+
if ! command -v pnpm &> /dev/null; then
|
|
77
|
+
missing_deps+=("pnpm")
|
|
78
|
+
fi
|
|
79
|
+
|
|
80
|
+
if ! command -v jq &> /dev/null; then
|
|
81
|
+
missing_deps+=("jq")
|
|
82
|
+
fi
|
|
83
|
+
|
|
84
|
+
if ! command -v curl &> /dev/null; then
|
|
85
|
+
missing_deps+=("curl")
|
|
86
|
+
fi
|
|
87
|
+
|
|
88
|
+
if [ ${#missing_deps[@]} -gt 0 ]; then
|
|
89
|
+
print_status "FAILURE" "Missing dependencies: ${missing_deps[*]}"
|
|
90
|
+
echo -e "${YELLOW}Please install missing dependencies:${NC}"
|
|
91
|
+
for dep in "${missing_deps[@]}"; do
|
|
92
|
+
case $dep in
|
|
93
|
+
"node") echo " - Node.js: https://nodejs.org/" ;;
|
|
94
|
+
"pnpm") echo " - pnpm: npm install -g pnpm" ;;
|
|
95
|
+
"jq") echo " - jq: brew install jq (macOS) or apt-get install jq (Ubuntu)" ;;
|
|
96
|
+
"curl") echo " - curl: Usually pre-installed" ;;
|
|
97
|
+
esac
|
|
98
|
+
done
|
|
99
|
+
exit 1
|
|
100
|
+
fi
|
|
101
|
+
|
|
102
|
+
print_status "SUCCESS" "All prerequisites satisfied"
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
# Function to run unit tests
|
|
106
|
+
run_unit_tests() {
|
|
107
|
+
if [ "$RUN_UNIT_TESTS" = false ]; then
|
|
108
|
+
print_status "SKIP" "Unit tests skipped"
|
|
109
|
+
return 0
|
|
110
|
+
fi
|
|
111
|
+
|
|
112
|
+
print_status "INFO" "Running unit tests..."
|
|
113
|
+
|
|
114
|
+
cd "$PROJECT_ROOT"
|
|
115
|
+
|
|
116
|
+
if [ "$VERBOSE" = true ]; then
|
|
117
|
+
pnpm test --run --reporter=verbose
|
|
118
|
+
else
|
|
119
|
+
pnpm test --run
|
|
120
|
+
fi
|
|
121
|
+
|
|
122
|
+
if [ $? -eq 0 ]; then
|
|
123
|
+
print_status "SUCCESS" "Unit tests passed"
|
|
124
|
+
else
|
|
125
|
+
print_status "FAILURE" "Unit tests failed"
|
|
126
|
+
return 1
|
|
127
|
+
fi
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
# Function to run integration tests
|
|
131
|
+
run_integration_tests() {
|
|
132
|
+
if [ "$RUN_INTEGRATION_TESTS" = false ]; then
|
|
133
|
+
print_status "SKIP" "Integration tests skipped"
|
|
134
|
+
return 0
|
|
135
|
+
fi
|
|
136
|
+
|
|
137
|
+
print_status "INFO" "Running integration tests..."
|
|
138
|
+
|
|
139
|
+
# Check if GitHub token is available
|
|
140
|
+
if [ -z "${GITHUB_TOKEN:-}" ]; then
|
|
141
|
+
print_status "WARNING" "GITHUB_TOKEN not set, skipping integration tests"
|
|
142
|
+
print_status "INFO" "Set GITHUB_TOKEN environment variable to run integration tests"
|
|
143
|
+
return 0
|
|
144
|
+
fi
|
|
145
|
+
|
|
146
|
+
# Run integration tests
|
|
147
|
+
cd "$PROJECT_ROOT"
|
|
148
|
+
|
|
149
|
+
if [ "$VERBOSE" = true ]; then
|
|
150
|
+
pnpm test --run --reporter=verbose tests/integration/
|
|
151
|
+
else
|
|
152
|
+
pnpm test --run tests/integration/
|
|
153
|
+
fi
|
|
154
|
+
|
|
155
|
+
if [ $? -eq 0 ]; then
|
|
156
|
+
print_status "SUCCESS" "Integration tests passed"
|
|
157
|
+
else
|
|
158
|
+
print_status "FAILURE" "Integration tests failed"
|
|
159
|
+
return 1
|
|
160
|
+
fi
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
# Function to run shell script tests
|
|
164
|
+
run_shell_tests() {
|
|
165
|
+
if [ "$RUN_SHELL_TESTS" = false ]; then
|
|
166
|
+
print_status "SKIP" "Shell script tests skipped"
|
|
167
|
+
return 0
|
|
168
|
+
fi
|
|
169
|
+
|
|
170
|
+
print_status "INFO" "Running shell script tests..."
|
|
171
|
+
|
|
172
|
+
# Test the debug script with help
|
|
173
|
+
if [ -f "$TEST_DIR/debug-workflows.sh" ]; then
|
|
174
|
+
print_status "INFO" "Testing debug-workflows.sh help"
|
|
175
|
+
if "$TEST_DIR/debug-workflows.sh" --help > /dev/null 2>&1; then
|
|
176
|
+
print_status "SUCCESS" "debug-workflows.sh help works"
|
|
177
|
+
else
|
|
178
|
+
print_status "FAILURE" "debug-workflows.sh help failed"
|
|
179
|
+
return 1
|
|
180
|
+
fi
|
|
181
|
+
else
|
|
182
|
+
print_status "FAILURE" "debug-workflows.sh not found"
|
|
183
|
+
return 1
|
|
184
|
+
fi
|
|
185
|
+
|
|
186
|
+
# Test script syntax
|
|
187
|
+
print_status "INFO" "Checking shell script syntax"
|
|
188
|
+
if bash -n "$TEST_DIR/debug-workflows.sh"; then
|
|
189
|
+
print_status "SUCCESS" "Shell script syntax is valid"
|
|
190
|
+
else
|
|
191
|
+
print_status "FAILURE" "Shell script syntax errors found"
|
|
192
|
+
return 1
|
|
193
|
+
fi
|
|
194
|
+
|
|
195
|
+
print_status "SUCCESS" "Shell script tests passed"
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
# Function to run debugging workflow tests
|
|
199
|
+
run_debugging_tests() {
|
|
200
|
+
print_status "INFO" "Running debugging workflow tests..."
|
|
201
|
+
|
|
202
|
+
# Test TypeScript compilation
|
|
203
|
+
print_status "INFO" "Testing TypeScript compilation"
|
|
204
|
+
cd "$PROJECT_ROOT"
|
|
205
|
+
|
|
206
|
+
if pnpm build > /dev/null 2>&1; then
|
|
207
|
+
print_status "SUCCESS" "TypeScript compilation successful"
|
|
208
|
+
else
|
|
209
|
+
print_status "FAILURE" "TypeScript compilation failed"
|
|
210
|
+
return 1
|
|
211
|
+
fi
|
|
212
|
+
|
|
213
|
+
# Test debug utilities
|
|
214
|
+
print_status "INFO" "Testing debug utilities"
|
|
215
|
+
if pnpm test --run tests/debug-workflow.test.ts > /dev/null 2>&1; then
|
|
216
|
+
print_status "SUCCESS" "Debug utilities tests passed"
|
|
217
|
+
else
|
|
218
|
+
print_status "FAILURE" "Debug utilities tests failed"
|
|
219
|
+
return 1
|
|
220
|
+
fi
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
# Function to generate test report
|
|
224
|
+
generate_test_report() {
|
|
225
|
+
local report_file="$OUTPUT_DIR/test-report.md"
|
|
226
|
+
|
|
227
|
+
print_status "INFO" "Generating test report..."
|
|
228
|
+
|
|
229
|
+
mkdir -p "$OUTPUT_DIR"
|
|
230
|
+
|
|
231
|
+
cat > "$report_file" << EOF
|
|
232
|
+
# GitHub Actions Debugging Test Report
|
|
233
|
+
|
|
234
|
+
Generated: $(date)
|
|
235
|
+
Project: Pipecraft
|
|
236
|
+
Test Directory: $TEST_DIR
|
|
237
|
+
|
|
238
|
+
## Test Configuration
|
|
239
|
+
|
|
240
|
+
- Unit Tests: $RUN_UNIT_TESTS
|
|
241
|
+
- Integration Tests: $RUN_INTEGRATION_TESTS
|
|
242
|
+
- Shell Tests: $RUN_SHELL_TESTS
|
|
243
|
+
- Verbose Output: $VERBOSE
|
|
244
|
+
|
|
245
|
+
## Test Results
|
|
246
|
+
|
|
247
|
+
### Prerequisites
|
|
248
|
+
- Node.js: $(node --version 2>/dev/null || echo "Not installed")
|
|
249
|
+
- pnpm: $(pnpm --version 2>/dev/null || echo "Not installed")
|
|
250
|
+
- jq: $(jq --version 2>/dev/null || echo "Not installed")
|
|
251
|
+
- curl: $(curl --version 2>/dev/null | head -n1 || echo "Not installed")
|
|
252
|
+
|
|
253
|
+
### Test Files
|
|
254
|
+
|
|
255
|
+
EOF
|
|
256
|
+
|
|
257
|
+
# List test files
|
|
258
|
+
find "$TEST_DIR" -name "*.test.ts" -o -name "*.test.js" -o -name "*.sh" | while read -r file; do
|
|
259
|
+
echo "- \`$file\`" >> "$report_file"
|
|
260
|
+
done
|
|
261
|
+
|
|
262
|
+
cat >> "$report_file" << EOF
|
|
263
|
+
|
|
264
|
+
## Usage Examples
|
|
265
|
+
|
|
266
|
+
### Basic Debugging
|
|
267
|
+
\`\`\`bash
|
|
268
|
+
# Run debug script with help
|
|
269
|
+
./tests/debug-workflows.sh --help
|
|
270
|
+
|
|
271
|
+
# Debug a specific workflow
|
|
272
|
+
GITHUB_TOKEN=your_token ./tests/debug-workflows.sh -w "My Custom Pipeline" -b main
|
|
273
|
+
\`\`\`
|
|
274
|
+
|
|
275
|
+
### TypeScript Debugging
|
|
276
|
+
\`\`\`typescript
|
|
277
|
+
import { WorkflowDebugOrchestrator } from './tests/debug-utils';
|
|
278
|
+
|
|
279
|
+
const debugger = new WorkflowDebugOrchestrator(token, owner, repo);
|
|
280
|
+
const report = await debugger.debugWorkflow('workflow-name');
|
|
281
|
+
\`\`\`
|
|
282
|
+
|
|
283
|
+
### Iterative Debugging
|
|
284
|
+
\`\`\`typescript
|
|
285
|
+
import { IterativeDebugger } from './tests/iterative-debug';
|
|
286
|
+
|
|
287
|
+
const debugger = new IterativeDebugger(token, owner, repo, 'workflow-name');
|
|
288
|
+
await debugger.runDebugIteration();
|
|
289
|
+
\`\`\`
|
|
290
|
+
|
|
291
|
+
---
|
|
292
|
+
*Report generated by Pipecraft Debug Test Runner*
|
|
293
|
+
EOF
|
|
294
|
+
|
|
295
|
+
print_status "SUCCESS" "Test report generated: $report_file"
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
# Function to show summary
|
|
299
|
+
show_summary() {
|
|
300
|
+
echo ""
|
|
301
|
+
echo -e "${BLUE}GitHub Actions Debugging Test Summary${NC}"
|
|
302
|
+
echo -e "${CYAN}=====================================${NC}"
|
|
303
|
+
echo ""
|
|
304
|
+
echo -e "${GREEN}✓${NC} Prerequisites checked"
|
|
305
|
+
echo -e "${GREEN}✓${NC} Test files validated"
|
|
306
|
+
echo -e "${GREEN}✓${NC} Debugging utilities tested"
|
|
307
|
+
echo ""
|
|
308
|
+
echo -e "${CYAN}Available debugging tools:${NC}"
|
|
309
|
+
echo " - Shell script: ./tests/debug-workflows.sh"
|
|
310
|
+
echo " - TypeScript utilities: ./tests/debug-utils.ts"
|
|
311
|
+
echo " - Iterative debugger: ./tests/iterative-debug.ts"
|
|
312
|
+
echo " - Test suite: ./tests/debug-workflow.test.ts"
|
|
313
|
+
echo ""
|
|
314
|
+
echo -e "${CYAN}Usage:${NC}"
|
|
315
|
+
echo " ./tests/run-debug-tests.sh --help"
|
|
316
|
+
echo " ./tests/debug-workflows.sh --help"
|
|
317
|
+
echo ""
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
# Parse command line arguments
|
|
321
|
+
while [[ $# -gt 0 ]]; do
|
|
322
|
+
case $1 in
|
|
323
|
+
-u|--unit)
|
|
324
|
+
RUN_UNIT_TESTS=true
|
|
325
|
+
RUN_INTEGRATION_TESTS=false
|
|
326
|
+
RUN_SHELL_TESTS=false
|
|
327
|
+
shift
|
|
328
|
+
;;
|
|
329
|
+
-i|--integration)
|
|
330
|
+
RUN_UNIT_TESTS=false
|
|
331
|
+
RUN_INTEGRATION_TESTS=true
|
|
332
|
+
RUN_SHELL_TESTS=false
|
|
333
|
+
shift
|
|
334
|
+
;;
|
|
335
|
+
-s|--shell)
|
|
336
|
+
RUN_UNIT_TESTS=false
|
|
337
|
+
RUN_INTEGRATION_TESTS=false
|
|
338
|
+
RUN_SHELL_TESTS=true
|
|
339
|
+
shift
|
|
340
|
+
;;
|
|
341
|
+
-a|--all)
|
|
342
|
+
RUN_UNIT_TESTS=true
|
|
343
|
+
RUN_INTEGRATION_TESTS=true
|
|
344
|
+
RUN_SHELL_TESTS=true
|
|
345
|
+
shift
|
|
346
|
+
;;
|
|
347
|
+
-v|--verbose)
|
|
348
|
+
VERBOSE=true
|
|
349
|
+
shift
|
|
350
|
+
;;
|
|
351
|
+
-o|--output)
|
|
352
|
+
OUTPUT_DIR="$2"
|
|
353
|
+
shift 2
|
|
354
|
+
;;
|
|
355
|
+
-h|--help)
|
|
356
|
+
show_usage
|
|
357
|
+
exit 0
|
|
358
|
+
;;
|
|
359
|
+
*)
|
|
360
|
+
echo -e "${RED}Unknown option: $1${NC}" >&2
|
|
361
|
+
show_usage
|
|
362
|
+
exit 1
|
|
363
|
+
;;
|
|
364
|
+
esac
|
|
365
|
+
done
|
|
366
|
+
|
|
367
|
+
# Main execution
|
|
368
|
+
main() {
|
|
369
|
+
echo -e "${BLUE}GitHub Actions Debugging Test Runner${NC}"
|
|
370
|
+
echo -e "${CYAN}====================================${NC}"
|
|
371
|
+
echo ""
|
|
372
|
+
|
|
373
|
+
# Check prerequisites
|
|
374
|
+
check_prerequisites
|
|
375
|
+
|
|
376
|
+
# Run tests
|
|
377
|
+
local test_results=()
|
|
378
|
+
|
|
379
|
+
if [ "$RUN_UNIT_TESTS" = true ]; then
|
|
380
|
+
if run_unit_tests; then
|
|
381
|
+
test_results+=("Unit Tests: PASS")
|
|
382
|
+
else
|
|
383
|
+
test_results+=("Unit Tests: FAIL")
|
|
384
|
+
fi
|
|
385
|
+
fi
|
|
386
|
+
|
|
387
|
+
if [ "$RUN_INTEGRATION_TESTS" = true ]; then
|
|
388
|
+
if run_integration_tests; then
|
|
389
|
+
test_results+=("Integration Tests: PASS")
|
|
390
|
+
else
|
|
391
|
+
test_results+=("Integration Tests: FAIL")
|
|
392
|
+
fi
|
|
393
|
+
fi
|
|
394
|
+
|
|
395
|
+
if [ "$RUN_SHELL_TESTS" = true ]; then
|
|
396
|
+
if run_shell_tests; then
|
|
397
|
+
test_results+=("Shell Tests: PASS")
|
|
398
|
+
else
|
|
399
|
+
test_results+=("Shell Tests: FAIL")
|
|
400
|
+
fi
|
|
401
|
+
fi
|
|
402
|
+
|
|
403
|
+
# Run debugging tests
|
|
404
|
+
if run_debugging_tests; then
|
|
405
|
+
test_results+=("Debugging Tests: PASS")
|
|
406
|
+
else
|
|
407
|
+
test_results+=("Debugging Tests: FAIL")
|
|
408
|
+
fi
|
|
409
|
+
|
|
410
|
+
# Generate report
|
|
411
|
+
generate_test_report
|
|
412
|
+
|
|
413
|
+
# Show summary
|
|
414
|
+
show_summary
|
|
415
|
+
|
|
416
|
+
# Show test results
|
|
417
|
+
echo -e "${CYAN}Test Results:${NC}"
|
|
418
|
+
for result in "${test_results[@]}"; do
|
|
419
|
+
if [[ $result == *"PASS" ]]; then
|
|
420
|
+
print_status "SUCCESS" "$result"
|
|
421
|
+
else
|
|
422
|
+
print_status "FAILURE" "$result"
|
|
423
|
+
fi
|
|
424
|
+
done
|
|
425
|
+
|
|
426
|
+
echo ""
|
|
427
|
+
print_status "INFO" "Test run complete. Check $OUTPUT_DIR for detailed results."
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
# Run main function
|
|
431
|
+
main "$@"
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"ciProvider": "github",
|
|
3
|
+
"mergeStrategy": "fast-forward",
|
|
4
|
+
"requireConventionalCommits": true,
|
|
5
|
+
"initialBranch": "develop",
|
|
6
|
+
"finalBranch": "main",
|
|
7
|
+
"branchFlow": ["develop", "staging", "main"],
|
|
8
|
+
"semver": {
|
|
9
|
+
"bumpRules": {
|
|
10
|
+
"feat": "minor",
|
|
11
|
+
"fix": "patch",
|
|
12
|
+
"breaking": "major"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"actions": {
|
|
16
|
+
"onDevelopMerge": ["runTests", "fastForwardToStaging"],
|
|
17
|
+
"onStagingMerge": ["runTests", "calculateVersion", "createOrFastForwardToMain"]
|
|
18
|
+
},
|
|
19
|
+
"domains": {
|
|
20
|
+
"api": {
|
|
21
|
+
"paths": ["apps/api/**"],
|
|
22
|
+
"description": "API application changes"
|
|
23
|
+
},
|
|
24
|
+
"web": {
|
|
25
|
+
"paths": ["apps/web/**"],
|
|
26
|
+
"description": "Web application changes"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"rebuild": {
|
|
30
|
+
"enabled": true,
|
|
31
|
+
"skipIfUnchanged": true,
|
|
32
|
+
"forceRegenerate": false,
|
|
33
|
+
"watchMode": false,
|
|
34
|
+
"hashAlgorithm": "sha256",
|
|
35
|
+
"cacheFile": ".pipecraft-cache.json",
|
|
36
|
+
"ignorePatterns": ["node_modules/**", "dist/**"]
|
|
37
|
+
},
|
|
38
|
+
"versioning": {
|
|
39
|
+
"enabled": true,
|
|
40
|
+
"releaseItConfig": ".release-it.cjs",
|
|
41
|
+
"conventionalCommits": true,
|
|
42
|
+
"autoTag": true,
|
|
43
|
+
"autoPush": true,
|
|
44
|
+
"changelog": true,
|
|
45
|
+
"bumpRules": {
|
|
46
|
+
"feat": "minor",
|
|
47
|
+
"fix": "patch",
|
|
48
|
+
"breaking": "major"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|