1
1
name : ' CodeBoarding [Diagram-First Documentation]'
2
- description : ' Generates diagram-first visualizations of your codebase using static analysis and large language models.'
2
+ description : ' Generates diagram-first visualizations of your codebase using static analysis and large language models. Note: For large repositories, set job timeout-minutes to 60 or higher in your workflow. '
3
3
author : ' CodeBoarding'
4
4
5
5
branding :
@@ -73,36 +73,53 @@ runs:
73
73
- name : Fetch documentation files
74
74
id : fetch-docs
75
75
shell : bash
76
- timeout-minutes : 35
77
76
run : |
78
77
ENDPOINT_URL="https://server.codeboarding.org/github_action"
79
78
REPO_URL="${{ steps.repo-url.outputs.repo_url }}"
80
79
SOURCE_BRANCH="${{ inputs.source_branch }}"
81
80
TARGET_BRANCH="${{ inputs.target_branch }}"
82
81
OUTPUT_FORMAT="${{ inputs.output_format }}"
83
82
84
- echo "Fetching documentation from: $ENDPOINT_URL?url=$REPO_URL&source_branch=$SOURCE_BRANCH&target_branch=$TARGET_BRANCH&output_format=$OUTPUT_FORMAT"
85
- echo "Note: This request may take 15-20 minutes for large repositories..."
83
+ echo "🚀 Starting CodeBoarding analysis..."
84
+ echo "📊 Repository: $REPO_URL"
85
+ echo "🌿 Source branch: $SOURCE_BRANCH"
86
+ echo "🎯 Target branch: $TARGET_BRANCH"
87
+ echo "📄 Output format: $OUTPUT_FORMAT"
88
+ echo "⏰ This request may take 15-45 minutes for large repositories..."
89
+ echo "💡 If your workflow times out, increase 'timeout-minutes' in your job configuration"
86
90
87
91
# Create temporary file for response
88
92
TEMP_FILE=$(mktemp)
89
93
90
- # Add periodic output to prevent GitHub Actions timeout due to no output
94
+ # Add more frequent output to prevent GitHub Actions timeout due to no output
95
+ # GitHub Actions can timeout if no output is produced for 10 minutes
91
96
(
97
+ counter=0
92
98
while true; do
93
- sleep 60 # Every minute
94
- echo "⏳ Still processing repository analysis... ($(date))"
99
+ sleep 30 # Every 30 seconds instead of 60
100
+ counter=$((counter + 1))
101
+ elapsed_minutes=$((counter / 2)) # Since we sleep 30 seconds, divide by 2 for minutes
102
+ echo "⏳ Analysis in progress... ${elapsed_minutes} minutes elapsed ($(date '+%H:%M:%S'))"
103
+
104
+ # Add more detailed progress every 5 minutes
105
+ if [ $((counter % 10)) -eq 0 ]; then
106
+ echo "📈 Processing status: Repository analysis and documentation generation ongoing..."
107
+ echo "🔍 Current phase: Analyzing codebase structure and generating diagrams..."
108
+ fi
95
109
done
96
110
) &
97
111
PROGRESS_PID=$!
98
112
113
+ echo "🌐 Making API request to CodeBoarding server..."
114
+
99
115
# Make the API call with extended timeouts for long-running requests
100
- # --max-time: Maximum time for the entire operation (30 minutes)
116
+ # Increased max-time to 45 minutes (2700 seconds) to handle very large repositories
117
+ # --max-time: Maximum time for the entire operation (45 minutes)
101
118
# --connect-timeout: Maximum time for connection establishment (60 seconds)
102
119
# --keepalive-time: Send keepalive probes every 60 seconds (if supported)
103
120
# --no-buffer: Disable output buffering to show progress
104
121
response=$(curl -s -w "%{http_code}" -o "$TEMP_FILE" \
105
- --max-time 1800 \
122
+ --max-time 2700 \
106
123
--connect-timeout 60 \
107
124
--keepalive-time 60 \
108
125
--no-buffer \
@@ -114,47 +131,55 @@ runs:
114
131
115
132
http_code=${response: -3}
116
133
117
- echo "API response status code: $http_code"
118
- echo "Curl exit code: $curl_exit_code"
134
+ echo "✅ API request completed!"
135
+ echo "📋 Response status code: $http_code"
136
+ echo "🔧 Curl exit code: $curl_exit_code"
119
137
120
138
# Handle timeout specifically
121
139
if [ $curl_exit_code -eq 28 ]; then
122
- echo "Error: Request timed out after 30 minutes"
123
- echo "The repository analysis is taking longer than expected."
124
- echo "This might be due to:"
125
- echo "- Very large repository size"
126
- echo "- Complex codebase requiring extensive analysis"
127
- echo "- Server load or processing delays"
128
- echo "Please try again later or contact support if the issue persists."
140
+ echo "❌ Error: Request timed out after 45 minutes"
141
+ echo "🏗️ The repository analysis is taking longer than expected."
142
+ echo "📊 This might be due to:"
143
+ echo " • Very large repository size (>10k files)"
144
+ echo " • Complex codebase requiring extensive analysis"
145
+ echo " • Server load or processing delays"
146
+ echo " • Network connectivity issues"
147
+ echo ""
148
+ echo "💡 Suggestions:"
149
+ echo " • Try again later when server load might be lower"
150
+ echo " • Consider analyzing smaller branches or specific directories"
151
+ echo " • Increase your GitHub Actions job timeout-minutes to 90+"
152
+ echo " • Contact support if the issue persists"
129
153
rm -f "$TEMP_FILE"
130
154
exit 1
131
155
fi
132
156
133
157
# Handle other curl errors
134
158
if [ $curl_exit_code -ne 0 ]; then
135
- echo "Error: Curl failed with exit code $curl_exit_code"
159
+ echo "❌ Error: Curl failed with exit code $curl_exit_code"
136
160
case $curl_exit_code in
137
- 6) echo "Couldn't resolve host" ;;
138
- 7) echo "Failed to connect to host" ;;
139
- 56) echo "Failure in receiving network data" ;;
140
- *) echo "Unknown curl error" ;;
161
+ 6) echo "🌐 Couldn't resolve host - check network connectivity " ;;
162
+ 7) echo "🔌 Failed to connect to host - server might be down " ;;
163
+ 56) echo "📡 Failure in receiving network data - connection interrupted " ;;
164
+ *) echo "❓ Unknown curl error - check network and server status " ;;
141
165
esac
142
166
rm -f "$TEMP_FILE"
143
167
exit 1
144
168
fi
145
169
146
170
if [ "$http_code" = "404" ]; then
147
- echo "No documentation files were generated for this repository/branch combination."
148
- echo "This might be because:"
149
- echo "- No changes were detected between the source and target branches"
150
- echo "- The repository or branches don't exist or are not accessible"
151
- echo "- No analyzable code files were found"
171
+ echo "ℹ️ No documentation files were generated for this repository/branch combination."
172
+ echo "📝 This might be because:"
173
+ echo " • No changes were detected between the source and target branches"
174
+ echo " • The repository or branches don't exist or are not accessible"
175
+ echo " • No analyzable code files were found"
176
+ echo " • The branches are identical (no diff to analyze)"
152
177
153
178
# Check if response contains error details
154
179
if jq -e '.detail' "$TEMP_FILE" > /dev/null 2>&1; then
155
- echo "Server message: $(jq -r '.detail' "$TEMP_FILE")"
180
+ echo "🔍 Server message: $(jq -r '.detail' "$TEMP_FILE")"
156
181
else
157
- echo "Server response:"
182
+ echo "📄 Server response:"
158
183
cat "$TEMP_FILE"
159
184
fi
160
185
@@ -163,13 +188,13 @@ runs:
163
188
echo "response_file=$TEMP_FILE" >> $GITHUB_OUTPUT
164
189
exit 0
165
190
elif [ "$http_code" != "200" ]; then
166
- echo "Error: API call failed with status code $http_code"
167
- echo "Response content:"
191
+ echo "❌ Error: API call failed with status code $http_code"
192
+ echo "📄 Response content:"
168
193
cat "$TEMP_FILE"
169
194
170
195
# Try to parse as JSON for better error message
171
196
if jq -e '.detail' "$TEMP_FILE" > /dev/null 2>&1; then
172
- echo "Error details: $(jq -r '.detail' "$TEMP_FILE")"
197
+ echo "🔍 Error details: $(jq -r '.detail' "$TEMP_FILE")"
173
198
fi
174
199
175
200
rm -f "$TEMP_FILE"
@@ -178,14 +203,14 @@ runs:
178
203
179
204
# Check if response is valid JSON
180
205
if ! jq empty "$TEMP_FILE" 2>/dev/null; then
181
- echo "Error: Invalid JSON response"
182
- echo "Response content:"
206
+ echo "❌ Error: Invalid JSON response"
207
+ echo "📄 Response content:"
183
208
cat "$TEMP_FILE"
184
209
rm -f "$TEMP_FILE"
185
210
exit 1
186
211
fi
187
212
188
- echo "API call successful"
213
+ echo "✅ API call successful - documentation generated! "
189
214
echo "response_file=$TEMP_FILE" >> $GITHUB_OUTPUT
190
215
191
216
- name : Process documentation files
0 commit comments