Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Implemented in commit a42df69. File contents are now wrapped with Changes:
This makes the logs much easier to scan when debugging gateway files with large outputs. |
|
@copilot refactor helper to display file in separate JavaScript file, add tests Make the output optimized for GitHub actions making best use of the macros |
…b Actions output Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Implemented in commit fe6a4b3. Created New helper module:
Optimized GitHub Actions macros:
Tests:
The refactoring reduces the main file from ~95 lines to ~22 lines for file display logic. |
|
📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing... |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
🎉 Yo ho ho! Changeset Generator found the treasure and completed successfully! ⚓💰 |
|
🎬 THE END — Smoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨ |
Agent Container Tool Check
Result: 10/12 tools available Missing Tools:
Status: PARTIAL - Core development tools (bash, git, node, python, go) are present, but Java and .NET runtimes are unavailable.
|
|
GitHub MCP merged PRs ✅ (Fix smoke-claude: clarify safe-outputs auto-targeting for PR comments | Refactor MCP server status tool to call GetWorkflowStatuses directly)
|
Smoke Test ResultsPRs Tested:
Test Results:
Overall Status: PARTIAL PASS @pelikhan
|
Smoke Test Results - Run 21633893537PR Titles:
Test Results:
Overall Status: PARTIAL PASS (8/10 tests passed)
|
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
@copilot make the filename the title of the group so it looks like a file tree (instead of "Contents of ...") |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Implemented in commit 50ff236. Changed group title from Before: After: This creates a cleaner, more natural file-tree structure in the logs. |
| return; | ||
| } | ||
|
|
||
| // Read and display file content |
There was a problem hiding this comment.
@copilot only show content of .json, .jsonl, .log, .txt files
There was a problem hiding this comment.
Implemented in commit 3b01180. Content display is now filtered to only .json, .jsonl, .log, .txt files.
Behavior:
- Supported extensions: File content is displayed in collapsible groups
- Unsupported extensions: Shows
(content not displayed for .ext files)message - All files: Still listed with filename and size information
Tests added:
- Test for unsupported extension (
.mdfile) - Test for
.jsonfile content display - Test for
.logfile content display
This prevents accidentally displaying binary files or large markdown/code files while keeping logs focused on debugging information.
There was a problem hiding this comment.
Pull request overview
This PR refactors the MCP gateway file-printing logic into a reusable helper module optimized for GitHub Actions, while increasing the file content truncation limit and improving log readability. The result is cleaner, non-indented log content presented as a collapsible file tree in Actions logs, with stronger unit test coverage around the new behavior.
Changes:
- Replaced the inline
printAllGatewayFilesimplementation with a call to a newdisplayDirectorieshelper that uses GitHub Actions groups and raises the truncation limit from 10KB to 64KB. - Added
display_file_helpers.cjswithdisplayFileContent,displayDirectory, anddisplayDirectoriesto encapsulate directory/file traversal, truncation logic, and group-based log presentation. - Expanded and adjusted tests in
parse_mcp_gateway_log.test.cjsand added comprehensive tests indisplay_file_helpers.test.cjsto cover grouping behavior, truncation behavior, and error/edge cases (missing dirs, empty dirs, huge files).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
actions/setup/js/parse_mcp_gateway_log.cjs |
Refactors printAllGatewayFiles to delegate to displayDirectories with a 64KB per-file truncation limit, integrating the new helper into the existing gateway log parsing flow. |
actions/setup/js/parse_mcp_gateway_log.test.cjs |
Updates gateway file-printing tests to assert on GitHub Actions group usage, 64KB truncation behavior, and the new notice-based missing-directory messaging. |
actions/setup/js/display_file_helpers.cjs |
Introduces reusable helpers to display directories and files with collapsible groups, size-aware truncation, and tailored logging (info/notice/warning/error) for different scenarios. |
actions/setup/js/display_file_helpers.test.cjs |
Adds unit tests for the new helpers, verifying normal files, empty files, directories, oversized files, read errors, multiple directories, and custom truncation limits. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Gateway log debugging in
printAllGatewayFiles()was indenting each line with 4 spaces and truncating files at 10KB, making logs harder to read and losing important context.Changes
prefix for cleaner console outputcore.startGroup()andcore.endGroup()to create collapsible sections in GitHub Actions logsgateway.loginstead ofContent of gateway.log) for natural file-tree navigation.json,.jsonl,.log,.txtfiles to prevent displaying binary or non-text filesdisplay_file_helpers.cjsfor better separation of concerns and reusabilitycore.notice(),core.warning(),core.error()) for better visibilitydisplay_file_helpers.test.cjscovering all edge cases, plus updated existing testsNew Helper Module
Created
display_file_helpers.cjswith three exported functions:displayFileContent(filePath, fileName, maxBytes)- Displays a single file with collapsible group (filtered by extension)displayDirectory(dirPath, maxBytes)- Displays all files in a directorydisplayDirectories(directories, maxBytes)- Displays multiple directoriesExample
Impact
File contents in gateway logs are now:
.json,.jsonl,.log,.txtfiles have content displayed; other files show a message explaining why content is not displayedcore.notice(),core.warning(), andcore.error()for better visibilityAffects the debugging output in
parse_mcp_gateway_log.cjsused during workflow runs.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.