Skip to content

Commit efa22a0

Browse files
committed
Added new prompt printing
1 parent 49d473d commit efa22a0

File tree

2 files changed

+91
-36
lines changed

2 files changed

+91
-36
lines changed

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,33 @@ The action works by:
7979
## License
8080

8181
MIT License - see [LICENSE](LICENSE) file for details.
82+
83+
# CodeBoarding GitHub Action
84+
85+
## Important: Timeout Configuration
86+
87+
For large repositories, the analysis can take 15-45 minutes. Make sure to configure appropriate timeouts in your workflow:
88+
89+
```yaml
90+
jobs:
91+
generate-docs:
92+
runs-on: ubuntu-latest
93+
timeout-minutes: 60 # Set to 60+ minutes for large repositories
94+
steps:
95+
- uses: actions/checkout@v4
96+
- uses: your-username/codeboarding-ghaction@v1
97+
with:
98+
# your inputs here
99+
```
100+
101+
## Timeout Guidelines
102+
103+
- **Small repositories** (<1k files): 10-15 minutes
104+
- **Medium repositories** (1k-5k files): 20-30 minutes
105+
- **Large repositories** (5k+ files): 30-60 minutes
106+
- **Very large repositories** (10k+ files): 45-90 minutes
107+
108+
If your workflow consistently times out, consider:
109+
1. Increasing `timeout-minutes` to 90 or higher
110+
2. Running the action on a schedule during off-peak hours
111+
3. Analyzing specific branches with smaller diffs

action.yml

Lines changed: 61 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
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.'
33
author: 'CodeBoarding'
44

55
branding:
@@ -73,36 +73,53 @@ runs:
7373
- name: Fetch documentation files
7474
id: fetch-docs
7575
shell: bash
76-
timeout-minutes: 35
7776
run: |
7877
ENDPOINT_URL="https://server.codeboarding.org/github_action"
7978
REPO_URL="${{ steps.repo-url.outputs.repo_url }}"
8079
SOURCE_BRANCH="${{ inputs.source_branch }}"
8180
TARGET_BRANCH="${{ inputs.target_branch }}"
8281
OUTPUT_FORMAT="${{ inputs.output_format }}"
8382
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"
8690
8791
# Create temporary file for response
8892
TEMP_FILE=$(mktemp)
8993
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
9196
(
97+
counter=0
9298
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
95109
done
96110
) &
97111
PROGRESS_PID=$!
98112
113+
echo "🌐 Making API request to CodeBoarding server..."
114+
99115
# 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)
101118
# --connect-timeout: Maximum time for connection establishment (60 seconds)
102119
# --keepalive-time: Send keepalive probes every 60 seconds (if supported)
103120
# --no-buffer: Disable output buffering to show progress
104121
response=$(curl -s -w "%{http_code}" -o "$TEMP_FILE" \
105-
--max-time 1800 \
122+
--max-time 2700 \
106123
--connect-timeout 60 \
107124
--keepalive-time 60 \
108125
--no-buffer \
@@ -114,47 +131,55 @@ runs:
114131
115132
http_code=${response: -3}
116133
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"
119137
120138
# Handle timeout specifically
121139
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"
129153
rm -f "$TEMP_FILE"
130154
exit 1
131155
fi
132156
133157
# Handle other curl errors
134158
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"
136160
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" ;;
141165
esac
142166
rm -f "$TEMP_FILE"
143167
exit 1
144168
fi
145169
146170
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)"
152177
153178
# Check if response contains error details
154179
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")"
156181
else
157-
echo "Server response:"
182+
echo "📄 Server response:"
158183
cat "$TEMP_FILE"
159184
fi
160185
@@ -163,13 +188,13 @@ runs:
163188
echo "response_file=$TEMP_FILE" >> $GITHUB_OUTPUT
164189
exit 0
165190
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:"
168193
cat "$TEMP_FILE"
169194
170195
# Try to parse as JSON for better error message
171196
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")"
173198
fi
174199
175200
rm -f "$TEMP_FILE"
@@ -178,14 +203,14 @@ runs:
178203
179204
# Check if response is valid JSON
180205
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:"
183208
cat "$TEMP_FILE"
184209
rm -f "$TEMP_FILE"
185210
exit 1
186211
fi
187212
188-
echo "API call successful"
213+
echo "API call successful - documentation generated!"
189214
echo "response_file=$TEMP_FILE" >> $GITHUB_OUTPUT
190215
191216
- name: Process documentation files

0 commit comments

Comments
 (0)