Skip to content

Commit 5064032

Browse files
committed
feat: upload autorevert advisor verdicts to S3 for ClickHouse ingestion
Adds a step to the advisor workflow that uploads the verdict JSON (enriched with signal metadata) to S3 for ingestion into misc.autorevert_advisor_verdicts via the clickhouse-replicator-s3 Lambda. This enables the autorevert lambda to read verdicts from CH instead of downloading GitHub Actions artifacts.
1 parent d0371b3 commit 5064032

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

.github/workflows/claude-autorevert-advisor.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,46 @@ jobs:
128128
path: /tmp/verdict/verdict.json
129129
retention-days: 30
130130

131+
- name: Upload verdict to S3 for ClickHouse ingestion
132+
if: always() && steps.claude.outputs.structured_output != ''
133+
env:
134+
VERDICT_JSON: ${{ steps.claude.outputs.structured_output }}
135+
SIGNAL_PATTERN: ${{ inputs.signal_pattern }}
136+
run: |
137+
# Build enriched verdict JSON with signal metadata for CH ingestion
138+
jq -n \
139+
--arg repo "${{ github.repository }}" \
140+
--argjson run_id "${{ github.run_id }}" \
141+
--argjson run_attempt "${{ github.run_attempt }}" \
142+
--arg timestamp "$(date -u +%Y-%m-%dT%H:%M:%S.000)" \
143+
--arg suspect_commit "${{ inputs.suspect_commit }}" \
144+
--argjson pr_number "${{ inputs.pr_number }}" \
145+
--arg signal_key "$(echo "$SIGNAL_PATTERN" | jq -r '.signal_key // ""')" \
146+
--arg signal_source "$(echo "$SIGNAL_PATTERN" | jq -r '.signal_source // ""')" \
147+
--arg workflow_name "$(echo "$SIGNAL_PATTERN" | jq -r '.workflow_name // ""')" \
148+
--arg verdict "$(echo "$VERDICT_JSON" | jq -r '.verdict // ""')" \
149+
--argjson confidence "$(echo "$VERDICT_JSON" | jq -r '.confidence // 0')" \
150+
--arg summary "$(echo "$VERDICT_JSON" | jq -r '.summary // ""')" \
151+
--arg causal_reasoning "$(echo "$VERDICT_JSON" | jq -r '.causal_reasoning // ""')" \
152+
'{
153+
repo: $repo,
154+
run_id: $run_id,
155+
run_attempt: $run_attempt,
156+
timestamp: $timestamp,
157+
suspect_commit: $suspect_commit,
158+
pr_number: $pr_number,
159+
signal_key: $signal_key,
160+
signal_source: $signal_source,
161+
workflow_name: $workflow_name,
162+
verdict: $verdict,
163+
confidence: $confidence,
164+
summary: $summary,
165+
causal_reasoning: $causal_reasoning
166+
}' > /tmp/advisor_verdict.json
167+
168+
aws s3 cp /tmp/advisor_verdict.json \
169+
"s3://ossci-raw-job-status/autorevert_advisor_verdicts/${{ github.repository }}/${{ github.run_id }}_${{ github.run_attempt }}.json"
170+
131171
- name: Upload usage metrics
132172
if: always()
133173
uses: pytorch/test-infra/.github/actions/upload-claude-usage@main

0 commit comments

Comments
 (0)