ref(pr-metrics): Add webhook name to webhook-triggered PR logs#118597
Open
vaind wants to merge 1 commit into
Open
ref(pr-metrics): Add webhook name to webhook-triggered PR logs#118597vaind wants to merge 1 commit into
vaind wants to merge 1 commit into
Conversation
The pr_metrics.pull_request.unresolved and pr_metrics.pull_request.stub_created logs fire from the PR resolve-or-stub helper, which is reached from seven distinct GitHub webhook event types (pull_request, issue_comment, the three pull_request_review variants, check_suite, check_run). Without the triggering event in context, these logs can't tell you which delivery raced ahead of the PR row. Thread the github_event name into the resolution helpers so both logs carry it. The value is only added where it varies: paths reached solely from the pull_request close webhook (select_verdict, the judge-forward logs) would log a constant and are left untouched. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Webhook-triggered
pr_metricslogs now carry the GitHub webhook event name (github_event) in their context, but only where that value actually disambiguates the log.The
pr_metrics.pull_request.unresolvedandpr_metrics.pull_request.stub_createdlogs are emitted from the shared resolve-or-stub helper, which is reached from seven distinct webhook event types —pull_request,issue_comment, the threepull_request_review*variants,check_suite, andcheck_run. These logs fire when a comment/review/check delivery races ahead of thepull_request(opened) delivery that writes the PR row; without the triggering event in context, you can't tell which delivery raced.This threads
github_event(already present on every webhook handler) down through_get_pull_request/_resolve_or_stub_pull_request/_prs_from_check_payloadand into that shared log context.Scope
The webhook name is added only where it varies. Paths reached solely from the
pull_requestclose webhook —select_verdictand the judge-forward logs (pr_metrics.emit.needs_judge,pr_metrics.judge.enqueue_failed) — would log a constantpull_request, so they were deliberately left unchanged. The log key already pins those to the close path.Out of scope (not a GitHub webhook trigger, so no webhook name to capture): the Seer RPC callback path (
judge.py,update_pr_metrics), the async forward task (tasks.py), and the attribution paths (Seer event / Cursor webhook / agent polling).Behavior change
Pure observability: the only functional effect is an added
github_eventfield on the two PR-resolution logs. No change to pipeline logic, emission, or verdicts.