Conversation
- Extract duplicate error-to-string conversion logic into a named errorToString() helper function, replacing two identical inline lambdas in sendJobConclusionSpan and buildSpanEvents - Split the complex itemTypes one-liner into rawItemTypes + itemTypes for better step-by-step readability Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This was referenced Apr 21, 2026
Closed
pelikhan
reviewed
Apr 21, 2026
| * @param {unknown} e | ||
| * @returns {string} | ||
| */ | ||
| function errorToString(e) { |
Contributor
There was a problem hiding this comment.
Updated in e51a3e3: send_otlp_span.cjs now uses the shared getErrorMessage helper from error_helpers.cjs for both error message extraction paths, and the local errorToString helper was removed. No UI changes were involved, so there is no screenshot.
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/eba8c7e4-15be-41f6-8314-0a7ce376458c Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
pelikhan
approved these changes
Apr 21, 2026
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.
This PR simplifies recently modified code from §24707154317 (PR #27495 — "Emit agent output metrics on OTLP conclusion spans for all outcomes").
Files Simplified
actions/setup/js/send_otlp_span.cjs— extracted duplicate error extraction logic and split complex one-linerImprovements Made
1. Extracted
errorToStringHelperThe inline lambda
e => (e && typeof e.message === "string" ? e.message : String(e))appeared twice — insendJobConclusionSpan(forerrorMessages) and again insidebuildSpanEvents. Extracted to a namederrorToString()helper adjacent tobuildAttr, eliminating duplication.2. Simplified
itemTypesComputationThe original one-liner (line 758) was complex:
Split into two steps for clarity:
Changes Based On
Testing
action_conclusion_otlp.test.cjs: 17/17, agent output metrics tests insend_otlp_span.test.cjs: all pass)printWidth: 240)Review Focus
Please verify:
errorToStringhelper matches the two original inline lambdas exactlyrawItemTypes/itemTypessplit preserves the same Set deduplication + sort behaviorReferences: §24707154317
Note
🔒 Integrity filter blocked 1 item
The following item was blocked because it doesn't meet the GitHub integrity level.
pull_request_read: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".To allow these resources, lower
min-integrityin your GitHub frontmatter: