Skip to content

Align sandbox integration tests with rootless AWF command default#42606

Merged
pelikhan merged 2 commits into
mainfrom
copilot/fix-issue
Jul 1, 2026
Merged

Align sandbox integration tests with rootless AWF command default#42606
pelikhan merged 2 commits into
mainfrom
copilot/fix-issue

Conversation

Copilot AI commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Recent CI failures came from sandbox integration tests asserting sudo -E awf even though AWF now runs rootless by default in these paths. This change updates assertions to validate firewall enablement via the rootless invocation shape.

  • Problem alignment

    • Update failing expectations in sandbox workflow tests to match current command generation (awf --config ...), not legacy sudo-prefixed execution.
  • Targeted test updates

    • pkg/workflow/sandbox_agent_false_test.go
      • sandbox.agent: awf enables firewall
      • default sandbox enables firewall (awf)
      • both now assert rootless AWF invocation.
    • pkg/workflow/sandbox_agent_tools_default_test.go
      • auto-enabled firewall adds edit and bash tools
      • now asserts rootless AWF invocation for the auto-enabled firewall path.
  • Behavioral intent preserved

    • Tests still validate the same contract (firewall is enabled where expected); only command-form expectations were updated.
// before
assert.Contains(t, lockStr, "sudo -E awf")

// after
assert.Contains(t, lockStr, "awf --config ")

Copilot AI and others added 2 commits July 1, 2026 01:23
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 Fix sandbox integration tests for rootless AWF default Align sandbox integration tests with rootless AWF command default Jul 1, 2026
Copilot AI requested a review from pelikhan July 1, 2026 01:27
@pelikhan
pelikhan marked this pull request as ready for review July 1, 2026 01:28
Copilot AI review requested due to automatic review settings July 1, 2026 01:28
@pelikhan
pelikhan merged commit 9c4a9e7 into main Jul 1, 2026
@pelikhan
pelikhan deleted the copilot/fix-issue branch July 1, 2026 01:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates sandbox integration tests to align with the newer default of invoking AWF rootlessly (no sudo -E) when firewall enablement is expected, by shifting assertions from the legacy sudo-prefixed command to the awf --config ... invocation shape.

Changes:

  • Updated sandbox test assertions to look for awf --config ... instead of sudo -E awf.
  • Adjusted test messaging/comments to reflect rootless-by-default behavior.
  • Regenerated (or otherwise modified) pr-code-quality-reviewer.lock.yml metadata (body hash).
Show a summary per file
File Description
pkg/workflow/sandbox_agent_tools_default_test.go Updates auto-enabled firewall test to assert the rootless AWF invocation form.
pkg/workflow/sandbox_agent_false_test.go Updates sandbox-agent-related tests to assert the rootless AWF invocation form in compiled lock output.
.github/workflows/pr-code-quality-reviewer.lock.yml Updates generated workflow lock metadata (body hash).

Review details

Tip

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

  • Files reviewed: 3/3 changed files
  • Comments generated: 4
  • Review effort level: Low

Comment on lines +264 to +265
// Verify AWF is present (rootless by default)
assert.Contains(t, lockStr, "awf --config ", "Expected rootless AWF invocation to be present when auto-enabled")
Comment on lines +109 to 112
// Verify that AWF installation IS present (rootless by default)
if !strings.Contains(lockStr, "awf --config ") {
t.Error("Expected AWF firewall to be enabled, but did not find rootless 'awf --config' command in lock file")
}
Comment on lines 155 to 158
// With network restrictions and no sandbox config, firewall should be enabled by default
if !strings.Contains(lockStr, "sudo -E awf") {
t.Error("Expected firewall to be enabled by default with network restrictions, but did not find 'sudo -E awf' command in lock file")
if !strings.Contains(lockStr, "awf --config ") {
t.Error("Expected firewall to be enabled by default with network restrictions, but did not find rootless 'awf --config' command in lock file")
}
@@ -1,4 +1,4 @@
# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"0a7a1cc9a9d3e316b42d163c8f7452df59e96a2dd1056a07170aca6d955bd9ca","body_hash":"4b304b423080e4bab9d72281c704a8436fe09fa92cf666fe179d4681a922d405","strict":true,"agent_id":"copilot","engine_versions":{"copilot":"1.0.65","copilot-sdk":"1.0.4"}}
# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"0a7a1cc9a9d3e316b42d163c8f7452df59e96a2dd1056a07170aca6d955bd9ca","body_hash":"3741a05e0a954d005c6a5d50b7567b198260ad61d940646d75c20b3b923c1606","strict":true,"agent_id":"copilot","engine_versions":{"copilot":"1.0.65","copilot-sdk":"1.0.4"}}
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.82.2

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.

3 participants