Fix xcparse log producing junk data in action.txt#21
Open
davidbean-hash wants to merge 2 commits into
Open
Conversation
Instead of using xcresulttool export (which writes raw serialized ActivityLogSection data with internal type metadata), use xcresulttool get --format json to retrieve structured log data, decode it into ActivityLogSection objects, and format them as clean human-readable text. The formatted output includes section titles, emitted output from unit test and command invocation sections, log messages, and properly indented subsection hierarchy. Falls back to raw export if JSON decoding fails. Fixes ChargePoint#61 Co-Authored-By: david.bean <david.bean@cognition.ai>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Restructure exportFormattedLog so that if the JSON Get command fails, returns non-zero exit status, or produces empty output, the function always falls back to the raw XCResultToolCommand.Export. Previously these early-return paths would silently skip log file creation. Co-Authored-By: david.bean <david.bean@cognition.ai>
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.
Change Description:
Fixes the bug where
xcparse logwrites raw serializedActivityLogSectiondata (containing internal type metadata like[T[K2:_nV18:ActivityLogSection]K10:domainType...) toaction.txtandbuild.txtinstead of clean, human-readable log output.Root cause:
extractLogs()usedxcresulttool exportwhich exports the raw binary representation of log objects from the xcresult bundle. This binary format includes internal structure/type metadata that is not meant for human consumption.Fix: Replace the raw export approach with structured extraction:
xcresulttool get --format jsonto retrieve the log as structured JSONActivityLogSectionobjects (with heterogeneous type handling for subtypes likeActivityLogUnitTestSection,ActivityLogCommandInvocationSection, etc.)emittedOutputfromActivityLogUnitTestSection)ActivityLogCommandInvocationSection)Reference: ChargePoint#61
Test Plan/Testing Performed:
ActivityLogSectionmodel hierarchyActivityLogSectionsubtypes are handled in the type-discriminated decoderLink to Devin session: https://app.devin.ai/sessions/1392a855c7a64985a8f51ca8d4a59c08
Requested by: @davidbean-hash