Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 19, 2025

The noop.cjs script requires load_agent_output.cjs but was embedded directly without bundling, causing unresolved dependencies at runtime.

Changes

  • scripts.go: Added bundled getNoOpScript() following pattern used by notify_comment_error and log parsers

    • Embedded source as noopScriptSource
    • Added noopScriptBundledOnce sync.Once for lazy bundling
    • Inlines load_agent_output.cjs via BundleJavaScriptFromSources()
  • noop.go: Removed unbundled getNoOpScript(), now calls bundled version from scripts.go

  • js.go: Removed unused noopScript variable

  • noop_bundling_test.go: Added test verifying require statements removed and loadAgentOutput inlined

Pattern

Follows existing bundler pattern:

func getNoOpScript() string {
    noopScriptBundledOnce.Do(func() {
        sources := GetJavaScriptSources()
        bundled, err := BundleJavaScriptFromSources(noopScriptSource, sources, "")
        // ...
    })
    return noopScriptBundled
}

Compiled workflows now contain inlined loadAgentOutput function with no require statements.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/user
    • Triggering command: gh api user --jq .login (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Make sure the bundler is applied to the no_op JavaScript


💡 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 November 19, 2025 06:12
- Add noopScriptSource embedding in scripts.go
- Add noopScriptBundled variable with sync.Once pattern
- Create getNoOpScript function with bundling logic in scripts.go
- Remove old getNoOpScript function from noop.go
- Keep noopScript variable in js.go for potential future use
- Bundler successfully inlines load_agent_output.cjs dependency
- All tests pass including JavaScript noop tests
- Compiled workflow confirms require statement removed and code inlined

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Add noop_bundling_test.go to verify bundling works correctly
- Test checks require statement is removed
- Test verifies loadAgentOutput function is inlined
- Test confirms noop logic and staged mode are present
- All tests pass (Go and JavaScript)

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan
Copy link
Contributor

@copilot lint and fix tests

The noopScript variable in js.go is no longer needed since the bundled
version is now in scripts.go. Removing it to satisfy linter.

- Remove embedded noopScript variable from js.go
- Bundling is now handled entirely in scripts.go
- All tests pass
- Linter passes

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Apply bundler to no_op JavaScript Apply bundler to noop.cjs to resolve load_agent_output dependency Nov 19, 2025
Copilot AI requested a review from pelikhan November 19, 2025 06:31
Copilot finished work on behalf of pelikhan November 19, 2025 06:31
@pelikhan pelikhan marked this pull request as ready for review November 19, 2025 06:32
Copilot AI review requested due to automatic review settings November 19, 2025 06:32
@pelikhan pelikhan merged commit 91ac368 into main Nov 19, 2025
107 of 109 checks passed
@pelikhan pelikhan deleted the copilot/apply-bundler-to-no-op-js branch November 19, 2025 06:33
Copilot finished reviewing on behalf of pelikhan November 19, 2025 06:34
Copy link
Contributor

Copilot AI left a 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 PR fixes a runtime dependency issue where noop.cjs required load_agent_output.cjs but was embedded without bundling. The fix applies the existing JavaScript bundler pattern to inline the dependency.

Key changes:

  • Applied bundler to noop.cjs to inline load_agent_output.cjs dependency
  • Added test to verify bundling removes require statements
  • Cleaned up duplicate/unused code references

Reviewed Changes

Copilot reviewed 74 out of 74 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pkg/workflow/scripts.go Added bundled getNoOpScript() with lazy bundling via sync.Once
pkg/workflow/noop_bundling_test.go Added test verifying require removal and function inlining
pkg/workflow/noop.go Removed unbundled getNoOpScript() (now in scripts.go)
pkg/workflow/js.go Removed unused noopScript variable
.github/workflows/*.lock.yml (64 files) Compiled workflows now contain inlined loadAgentOutput function

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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