feat: add gh-aw.trigger.comment_id to setup and conclusion OTLP spans#29733
feat: add gh-aw.trigger.comment_id to setup and conclusion OTLP spans#29733
Conversation
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/3d629da3-870a-4475-b751-2807361c4eed Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR extends OTLP span metadata so setup and conclusion spans can include the triggering GitHub comment ID, making trace investigations link directly to the exact triggering comment instead of only the parent issue or PR.
Changes:
- Added conditional emission of
gh-aw.trigger.comment_idin both setup and conclusion OTLP spans fromaw_info.context.comment_id. - Updated setup-span JSDoc to document the new
context.comment_id→gh-aw.trigger.comment_idmapping. - Added/updated tests to verify the new attribute is emitted when present and omitted when absent.
Show a summary per file
| File | Description |
|---|---|
actions/setup/js/send_otlp_span.cjs |
Adds comment_id extraction and emits it as a span attribute in setup and conclusion span builders. |
actions/setup/js/send_otlp_span.test.cjs |
Adds assertions covering presence/absence of the new OTLP attribute in both span test suites. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 0
🧪 Test Quality Sentinel ReportTest Quality Score: 80/100✅ Excellent
Test Classification Details
Flagged Tests — Requires Review
|
OTLP spans recorded enough context to find the triggering issue or PR but not the specific comment, forcing engineers to manually scroll through potentially hundreds of comments during trace investigations.
Changes
send_otlp_span.cjs: ExtractawInfo.context.comment_idin bothsendJobSetupSpanandsendJobConclusionSpan; conditionally emit asgh-aw.trigger.comment_idattribute (only when non-empty, consistent withitem_type/item_number/trigger_labelpattern)sendJobSetupSpandoc to includecontext.comment_id→gh-aw.trigger.comment_idmapping"emits gh-aw.trigger.comment_id when comment_id is non-empty"cases for both span functions; updated absence assertions in existing tests to also cover the new attribute keyNew attribute follows the existing conditional-emit pattern: