Skip to content

Fix firewall parser to use setupGlobals pattern#7689

Merged
pelikhan merged 2 commits into
copilot/remove-js-sh-scripts-embeddingsfrom
copilot/fix-firewall-parser-js
Dec 26, 2025
Merged

Fix firewall parser to use setupGlobals pattern#7689
pelikhan merged 2 commits into
copilot/remove-js-sh-scripts-embeddingsfrom
copilot/fix-firewall-parser-js

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 26, 2025

The firewall log parser step was calling main() with parameters instead of using the setupGlobals() pattern, causing the parser to fail when accessing core as a global variable.

Changes

  • Updated generateFirewallLogParsingStep() in pkg/workflow/copilot_srt.go to call setupGlobals() before requiring the parser script
  • Changed main() invocation to match agent log parser pattern (no parameters)

Before

const { main } = require('/tmp/gh-aw/actions/parse_firewall_logs.cjs');
await main({ github, context, core, exec, io });

After

const { setupGlobals } = require('/tmp/gh-aw/actions/setup_globals.cjs');
setupGlobals(core, github, context, exec, io);
const { main } = require('/tmp/gh-aw/actions/parse_firewall_logs.cjs');
await main();

This aligns with how all other log parsers (Claude, Codex, Copilot) access GitHub Actions objects as globals.

Original prompt

Reference: https://github.com/githubnext/gh-aw/actions/runs/20515319042/job/58942042783#step:45:1

Fix firewall parser JavaScript to use require and setup globals


💡 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.

- Add setupGlobals() call before requiring parse_firewall_logs.cjs
- Remove parameter passing to main() function
- This matches the pattern used by agent log parsers
- Fixes workflow run #20515319042 failure

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix firewall parser JavaScript to use require and setup globals Fix firewall parser to use setupGlobals pattern Dec 26, 2025
Copilot AI requested a review from pelikhan December 26, 2025 03:59
@pelikhan pelikhan marked this pull request as ready for review December 26, 2025 04:04
@pelikhan pelikhan merged commit f145fd3 into copilot/remove-js-sh-scripts-embeddings Dec 26, 2025
@pelikhan pelikhan deleted the copilot/fix-firewall-parser-js branch December 26, 2025 04:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants