-
Notifications
You must be signed in to change notification settings - Fork 141
Truncate and collapse raw safe-outputs logging using shared helper #15128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
| @@ -101,8 +101,27 @@ async function writeSafeOutputSummaries(results, messages) { | |||
| try { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot use file tree renderer function use in gateway print instead of this code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! Replaced custom truncation logic with displayFileContent helper from display_file_helpers.cjs (used in gateway print). This provides:
- Collapsible log group with file size in title
- Line-by-line logging with proper truncation
- Consistent behavior across the codebase
Commit: ce472c8
The output now shows:
▼ safe-outputs.jsonl (123 bytes)
{"type":"create_issue",...}
{"type":"add_comment",...}
For large files (>5000 bytes):
▼ safe-outputs.jsonl (15384 bytes)
{"type":"create_issue",...}
...
(truncated, showing first 5000 bytes of 15384 total)
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request addresses excessive logging in GitHub Actions by implementing truncation and collapsible grouping for raw safe-outputs .jsonl file content. Previously, the entire file was logged via core.info(), which could produce extremely large logs when entries included full issue/discussion bodies.
Changes:
- Replaced direct file logging with the
displayFileContenthelper function that provides truncation (5000 bytes), collapsible log groups, and consistent formatting - Updated tests to verify the new logging behavior including truncation, log group usage, and empty file handling
- Recompiled workflows, which updated lock files with explicit
allow_body:truein update_issue handler configs and addedactions/setup-go@v5to action_pins.json
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| actions/setup/js/safe_output_summary.cjs | Replaced unbounded raw file logging with displayFileContent helper that provides 5000-byte truncation and collapsible groups |
| actions/setup/js/safe_output_summary.test.cjs | Added test coverage for truncation behavior and updated existing tests to verify log group usage |
| .github/workflows/ci-doctor.lock.yml | Recompiled workflow lock file with explicit allow_body:true in update_issue handler config |
| .github/workflows/sub-issue-closer.lock.yml | Recompiled workflow lock file with explicit allow_body:true in update_issue handler config |
| .github/workflows/workflow-health-manager.lock.yml | Recompiled workflow lock file with explicit allow_body:true in update_issue handler config |
| pkg/workflow/data/action_pins.json | Added SHA pin for actions/setup-go@v5 discovered during workflow compilation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Logging the entire raw safe-outputs file via
core.info(rawContent)produces excessive logs when entries contain full issue/discussion bodies, potentially megabytes of output.Changes:
displayFileContenthelper fromdisplay_file_helpers.cjs(same helper used in gateway print)Example output:
Before:
After (small files):
After (large files >5000 bytes):
Benefits:
Modified
actions/setup/js/safe_output_summary.cjslines 97-115.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.