Skip to content

Commit 1ceb010

Browse files
tychtjanclaude
andcommitted
feat: add report state tracking for workflow management
Track the lifecycle of SDK diff reports and clusters: - new: Just generated, needs attention - reviewed: Human/agent has looked at it - in_progress: Agent is actively working on it - implemented: SDK changes made (with PR reference) - skipped: No action needed Usage: # Mark cluster as reviewed python sdk_report_state.py mark --cluster openapi-foo --status reviewed --by "user:john" # Mark as implemented with PR link python sdk_report_state.py mark --cluster openapi-foo --status implemented --pr 123 # See what needs attention python sdk_report_state.py needs-attention State is stored in .github/sdk-report-state.json and auto-committed. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 489a26e commit 1ceb010

2 files changed

Lines changed: 501 additions & 6 deletions

File tree

.github/workflows/sdk-diff-analyzer.yaml

Lines changed: 52 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,32 @@ jobs:
191191
cat clustered/00-clusters.md
192192
fi
193193
194+
- name: Sync report state
195+
id: state
196+
if: steps.analyze.outputs.sdk_reports > 0
197+
run: |
198+
echo "=== Syncing Report State ==="
199+
200+
# Sync state with new reports and clusters
201+
SYNC_ARGS="--reports-dir ./reports"
202+
if [ -d "./clustered" ]; then
203+
SYNC_ARGS="$SYNC_ARGS --clusters-dir ./clustered"
204+
fi
205+
206+
python3 scripts/sdk_report_state.py sync $SYNC_ARGS
207+
208+
# Show what needs attention
209+
echo ""
210+
python3 scripts/sdk_report_state.py needs-attention
211+
212+
# Output counts for summary
213+
SUMMARY=$(python3 scripts/sdk_report_state.py summary 2>&1)
214+
NEW_REPORTS=$(echo "$SUMMARY" | grep -A10 "REPORTS:" | grep "new" | awk '{print $NF}' || echo "0")
215+
NEW_CLUSTERS=$(echo "$SUMMARY" | grep -A10 "CLUSTERS:" | grep "new" | awk '{print $NF}' || echo "0")
216+
217+
echo "new_reports=$NEW_REPORTS" >> $GITHUB_OUTPUT
218+
echo "new_clusters=$NEW_CLUSTERS" >> $GITHUB_OUTPUT
219+
194220
- name: Upload analysis reports
195221
uses: actions/upload-artifact@v4
196222
with:
@@ -217,26 +243,33 @@ jobs:
217243
retention-days: 7
218244
if-no-files-found: ignore
219245

220-
- name: Update state file
246+
- name: Update state files
221247
run: |
222248
echo "=== Updating state ==="
223249
HEAD_SHA="${{ steps.gdc_nas.outputs.head_sha }}"
224250
251+
# Update gdc-nas commit state
225252
echo "$HEAD_SHA" > "${{ env.STATE_FILE }}"
226-
echo "Stored SHA: $HEAD_SHA"
253+
echo "Stored gdc-nas SHA: $HEAD_SHA"
227254
228-
# Commit and push state file
255+
# Commit and push state files
229256
git config user.name "github-actions[bot]"
230257
git config user.email "github-actions[bot]@users.noreply.github.com"
231258
259+
# Add both state files
232260
git add "${{ env.STATE_FILE }}"
261+
git add ".github/sdk-report-state.json" 2>/dev/null || true
233262
234263
if git diff --staged --quiet; then
235-
echo "No changes to state file"
264+
echo "No changes to state files"
236265
else
237-
git commit -m "chore: update gdc-nas analyzer state to ${HEAD_SHA:0:12}"
266+
git commit -m "chore: update analyzer state to ${HEAD_SHA:0:12}
267+
268+
gdc-nas HEAD: ${HEAD_SHA}
269+
New reports: ${{ steps.state.outputs.new_reports || '0' }}
270+
New clusters: ${{ steps.state.outputs.new_clusters || '0' }}"
238271
git push
239-
echo "State file updated and pushed"
272+
echo "State files updated and pushed"
240273
fi
241274
242275
- name: Job summary
@@ -252,10 +285,23 @@ jobs:
252285
| gdc-nas HEAD | \`${{ steps.gdc_nas.outputs.head_sha }}\` |
253286
| SDK-relevant commits | ${{ steps.analyze.outputs.sdk_reports }} |
254287
| Clusters created | ${{ steps.cluster.outputs.clusters_created || '0' }} |
288+
| **New reports** | **${{ steps.state.outputs.new_reports || '0' }}** |
289+
| **New clusters** | **${{ steps.state.outputs.new_clusters || '0' }}** |
255290
256291
EOF
257292
293+
# Show items needing attention
294+
if [ -f ".github/sdk-report-state.json" ]; then
295+
echo "" >> $GITHUB_STEP_SUMMARY
296+
echo "### 🔔 Items Needing Attention" >> $GITHUB_STEP_SUMMARY
297+
echo "" >> $GITHUB_STEP_SUMMARY
298+
echo '```' >> $GITHUB_STEP_SUMMARY
299+
python3 scripts/sdk_report_state.py needs-attention 2>&1 >> $GITHUB_STEP_SUMMARY || echo "State check failed"
300+
echo '```' >> $GITHUB_STEP_SUMMARY
301+
fi
302+
258303
if [ -f reports/00-summary.md ]; then
304+
echo "" >> $GITHUB_STEP_SUMMARY
259305
echo "### Report Summary" >> $GITHUB_STEP_SUMMARY
260306
echo "" >> $GITHUB_STEP_SUMMARY
261307
cat reports/00-summary.md >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)