Skip to content

Remove redundant JS/shell script syncing and convert inline scripts to require() pattern#7654

Merged
pelikhan merged 37 commits into
mainfrom
copilot/remove-js-sh-scripts-embeddings
Dec 26, 2025
Merged

Remove redundant JS/shell script syncing and convert inline scripts to require() pattern#7654
pelikhan merged 37 commits into
mainfrom
copilot/remove-js-sh-scripts-embeddings

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 25, 2025

Summary

Successfully completed the removal of redundant JS/shell script syncing and converted all inline JavaScript to use the require() pattern for loading external scripts at runtime.

Changes Made

Build System

  • Removed sync-shell-scripts and sync-js-scripts Makefile targets
  • Removed sync steps from build target dependency chain

Embedded Script Removal

  • Removed all //go:embed directives for 117 JavaScript files and 6 shell scripts
  • Simplified scripts.go from 402 lines to 21 lines
  • Simplified js.go from 956 lines to 649 lines (kept helper functions)
  • All getter functions now return empty strings or placeholders
  • Preserved GetSafeOutputsToolsJSON() to return actual JSON content for tool filtering

Script Conversion to require() Pattern

  • Converted all inline JavaScript usage to require() pattern across 15+ Go files
  • All scripts now use consistent pattern: const { main } = require(...); await main(...)
  • Updated 6 JavaScript files to export main and remove auto-execution
  • Added empty script validation in WriteJavaScriptToYAML() to prevent silent failures

Setup Action Consolidation

  • Removed obsolete actions/setup/index.js (replaced by setup.sh)
  • Removed actions/setup-safe-inputs and actions/setup-safe-outputs directories
  • Consolidated all file copying into actions/setup/setup.sh:
    • Copies activation files to /tmp/gh-aw/actions/
    • Copies safe-inputs files to /tmp/gh-aw/safe-inputs/
    • Copies safe-outputs files to /tmp/gh-aw/safeoutputs/

MCP Server Alignment

  • Created actions/setup/js/safe-outputs-mcp-server.cjs as unified entry point
  • Updated setup.sh to copy it to /tmp/gh-aw/safeoutputs/mcp-server.cjs
  • Removed compiler-generated MCP file writing steps
  • MCP config consistently references /tmp/gh-aw/safeoutputs/mcp-server.cjs

Log Parsing Fix

  • Fixed GetLogParserScript() to return "EXTERNAL_SCRIPT" placeholder
  • Enables "Parse agent logs for step summary" and "Parse firewall logs for step summary" steps in workflows
  • Steps now properly generated for all applicable workflows

Test Updates

  • Updated failing tests to work with new architecture
  • Skipped tests for embedded scripts (now external files)
  • Fixed 5 test files to align with external script loading

Workflow Configuration

  • Removed sandbox MCP entry from smoke-copilot.md workflow

Architecture

Before: Scripts synced from actions/setup/{js,sh}/pkg/workflow/{js,sh}/ → embedded in Go binary via //go:embed

After: Scripts remain in actions/setup/{js,sh}/ → copied to /tmp/gh-aw/actions/ at runtime → loaded via require() pattern

Benefits

  • ✅ Significantly reduced binary size by removing embedded script data
  • ✅ Single source of truth for all scripts (no syncing needed)
  • ✅ Consistent require() pattern across all 117+ scripts
  • ✅ Runtime flexibility without recompiling Go binary
  • ✅ Easier script maintenance (edit source files directly)
  • ✅ Reduced duplication (no compiler-generated script files)

Testing

  • ✅ Build successful
  • ✅ Lint passing (0 issues)
  • ✅ All 124 workflows compiled successfully
  • ✅ All workflow compilation tests passing
  • ✅ Log parsing steps properly generated in workflows
  • ✅ MCP server entry points aligned between setup.sh and compiler
Original prompt

Remove copy of JavaScript/shell scripts in pkg/workflows/js sh. This is not needed anymore as there is no more need to inlining those scripts. ONLY applies to script in actions/setup

  • remove synching of js/sh file to that pkg/worklows

FOR EACH .cjs / .sh file in actions/setup,

  • remove embedding in go compiler
  • remove file from your pkg/workows

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits December 25, 2025 19:49
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove unnecessary JavaScript and shell scripts in pkg/workflows Remove redundant JS/shell script syncing from actions/setup to pkg/workflow Dec 25, 2025
Copilot AI requested a review from pelikhan December 25, 2025 20:01
@pelikhan pelikhan added the smoke label Dec 25, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 25, 2025

🎉 Yo ho ho! Changeset Generator found the treasure and completed successfully! ⚓💰

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 25, 2025

🎬 THE ENDSmoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 25, 2025

🎉 Yo ho ho! Smoke Copilot Safe Inputs found the treasure and completed successfully! ⚓💰

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 25, 2025

🤖 DIAGNOSTIC COMPLETE: Smoke Copilot No Firewall STATUS: ALL_UNITS_OPERATIONAL. MISSION_SUCCESS.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 25, 2025

📰 VERDICT: Smoke Copilot Playwright has concluded. All systems operational. This is a developing story. 🎤

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 25, 2025

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 25, 2025

📰 DEVELOPING STORY: Smoke Copilot reports failed. Our correspondents are investigating the incident...

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 25, 2025

✅ Firewall validation complete... Smoke Codex Firewall confirmed network sandboxing is operational. 🛡️

@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot remove actions/setup/index.js, setup.sh is the script used to copy files around

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot remove sandbox MCP entry from smoke copilot agentic workflow

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 26, 2025

📰 DEVELOPING STORY: Smoke Copilot Playwright reports failed. Our correspondents are investigating the incident...

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 26, 2025

🤖 DIAGNOSTIC COMPLETE: Smoke Copilot No Firewall STATUS: ALL_UNITS_OPERATIONAL. MISSION_SUCCESS.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 26, 2025

✅ Firewall validation complete... Smoke Codex Firewall confirmed network sandboxing is operational. 🛡️

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 26, 2025

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 26, 2025

🎬 THE ENDSmoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 26, 2025

🎉 Yo ho ho! Smoke Copilot Safe Inputs found the treasure and completed successfully! ⚓💰

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 26, 2025

🎬 THE ENDSmoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 26, 2025

🤖 DIAGNOSTIC COMPLETE: Smoke Copilot No Firewall STATUS: ALL_UNITS_OPERATIONAL. MISSION_SUCCESS.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 26, 2025

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 26, 2025

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 26, 2025

✅ Firewall validation complete... Smoke Codex Firewall confirmed network sandboxing is operational. 🛡️

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 26, 2025

📰 VERDICT: Smoke Copilot Playwright has concluded. All systems operational. This is a developing story. 🎤

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 26, 2025

🎉 Yo ho ho! Changeset Generator found the treasure and completed successfully! ⚓💰

@github-actions
Copy link
Copy Markdown
Contributor

Smoke Test Results

✅ File Writing: Created /tmp/gh-aw/agent/smoke-test-copilot-20515979621.txt
✅ Bash Tool: File read successful
❌ Safe Input gh Tool: Not available (safeinputs-gh tool not found)

Status: PARTIAL PASS (2/3 tests passed)

Ahoy! This treasure was crafted by 🏴‍☠️ Smoke Copilot Safe Inputs fer issue #7654 🗺️

@github-actions
Copy link
Copy Markdown
Contributor

Smoke Test Results: Copilot Engine (Run 20515979635)

Last 2 merged PRs:

Test Results:

  • ✅ GitHub MCP Testing: Retrieved last 2 merged PRs
  • ✅ File Writing: Created test file successfully
  • ✅ Bash Tool Testing: Verified file content
  • ❌ GitHub MCP Default Toolset: get_me correctly unavailable (expected - default toolsets don't include it)
  • ✅ Cache Memory Testing: Created and verified cache file
  • ❌ MCP Gateway Testing: Gateway not running (expected in default setup)
  • ✅ Available Tools Display: All safe-output tools accessible

Overall Status: PASS

cc @pelikhan

📰 BREAKING: Report filed by Smoke Copilot fer issue #7654 🗺️

@github-actions
Copy link
Copy Markdown
Contributor

Smoke Test Results for Copilot (No Firewall)

Last 2 Merged PRs:

Test Results:

  • ✅ GitHub MCP Testing: Successfully retrieved PR data
  • ✅ File Writing Testing: Created /tmp/gh-aw/agent/smoke-test-copilot-20515979611.txt
  • ✅ Bash Tool Testing: Verified file content
  • ✅ Playwright MCP Testing: Navigated to GitHub, title contains "GitHub"
  • ⚠️ Safe Input gh Tool Testing: Skipped (tool not available in this workflow)

Overall Status: PASS (4/4 required tests passed)

🤖 DIAGNOSTIC REPORT GENERATED BY Smoke Copilot No Firewall fer issue #7654 🗺️

@github-actions
Copy link
Copy Markdown
Contributor

PRs: #7691 Remove duplicate firewall log steps in Codex workflows; #7688 Fix safe-outputs MCP server load failure by including missing dependencies in setup.sh
Tests: OpenAI curl blocked ✅; example.com blocked ✅; file write/read ✅; GitHub MCP merged PRs fetched ✅
Network: SANDBOXED
Overall: PASS

🔥 Firewall tested by Smoke Codex Firewall fer issue #7654 🗺️

@github-actions
Copy link
Copy Markdown
Contributor

PRs: Remove duplicate firewall log steps in Codex workflows; Fix safe-outputs MCP server load failure by including missing dependencies in setup.sh
GitHub MCP ✅
File write ✅
Playwright title ✅
Cache memory ✅
safeinputs-gh ❌ (command not found)
Overall: FAIL

🔮 The oracle has spoken through Smoke Codex fer issue #7654 🗺️

@github-actions
Copy link
Copy Markdown
Contributor

Smoke Test Results - Claude Engine

Last 2 Merged PRs:

Test Results:

  • ✅ GitHub MCP: Retrieved PR list
  • ✅ File Writing: Created /tmp/gh-aw/agent/smoke-test-claude-20515979607.txt
  • ✅ Bash Tool: Verified file contents
  • ✅ Playwright MCP: Navigated to github.com (title: "GitHub · Change is constant. GitHub keeps you ahead. · GitHub")
  • ✅ Cache Memory: Created /tmp/gh-aw/cache-memory/smoke-test-20515979607.txt
  • ❌ Safe Input gh Tool: Not tested (tool not available in environment)

Overall Status: PARTIAL PASS (5/6 tests passed)

💥 [THE END] — Illustrated by Smoke Claude fer issue #7654 🗺️

@github-actions
Copy link
Copy Markdown
Contributor

Smoke Test Results (Run #20515979612)

Playwright MCP: Timeout/installation issues
Cache Memory: Successfully wrote and verified file
⏭️ Safe Input gh Tool: Not tested (Playwright blocked execution)

Overall Status: ❌ FAIL

📰 BREAKING: Report filed by Smoke Copilot Playwright fer issue #7654 🗺️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants