Skip to content

[scanner] 🐛 fix: resolve provider test SSRF blocking and CLI skip guards#19200

Closed
clubanderson wants to merge 1 commit into
mainfrom
scanner/fix-provider-tests
Closed

[scanner] 🐛 fix: resolve provider test SSRF blocking and CLI skip guards#19200
clubanderson wants to merge 1 commit into
mainfrom
scanner/fix-provider-tests

Conversation

@clubanderson

Copy link
Copy Markdown
Collaborator

Fixes provider test failures on main where SSRF protection blocks loopback httptest servers and CLI tools aren't in CI PATH.

Changes

  • Allow loopback addresses in provider test HTTP clients
  • Add skip guards for CLI provider tests when executables not in PATH

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

Signed-off-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 19, 2026 07:15
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign mikespreitzer for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Jun 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🐝 Hi @clubanderson! I'm kubestellar-hive[bot], an automation bot for this repo.

Trusted users — org members and contributors with write access — can mention @kubestellar-hive in a comment to trigger repo automation.
On issues, that mention queues an automated fix attempt. On pull requests, it records extra context for existing automation.
This is not an interactive Q&A bot, so mentions should be treated as requests for automation rather than a conversation.

Automation may take a moment to start, and follow-up happens through workflow activity rather than chat replies.

@github-actions

Copy link
Copy Markdown
Contributor

👋 Hey @clubanderson — thanks for opening this PR!

🤖 This project is developed exclusively using AI coding assistants.

Please do not attempt to code anything for this project manually.
All contributions should be authored using an AI coding tool such as:

This ensures consistency in code style, architecture patterns, test coverage,
and commit quality across the entire codebase.


This is an automated message.

@kubestellar-prow kubestellar-prow Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 19, 2026
@github-actions github-actions Bot added tier/1-lightweight ai-generated Pull request generated by AI labels Jun 19, 2026
@netlify

netlify Bot commented Jun 19, 2026

Copy link
Copy Markdown

Deploy Preview for kubestellarconsole canceled.

Name Link
🔨 Latest commit 258fd91
🔍 Latest deploy log https://app.netlify.com/projects/kubestellarconsole/deploys/6a34ecae2d5f7100087aa656

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

This PR aims to stabilize pkg/agent/providers tests by (1) allowing loopback httptest.NewServer targets to bypass the provider SSRF/private-IP guard during unit tests, and (2) skipping CLI-provider tests when the required CLI executables are not available in CI PATH.

Changes:

  • Added shared test helpers to enable loopback SSRF bypass (AllowLoopbackForTests) and to skip tests when a CLI executable is missing.
  • Updated Claude and Gemini HTTP-provider tests to enable loopback bypass before standing up httptest servers.
  • Added executable-availability skip guards to CLI stderr-drain timeout tests.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
pkg/agent/providers/provider_test_helpers_test.go Adds test helpers for loopback SSRF bypass and PATH-based CLI skipping.
pkg/agent/providers/provider_gemini_test.go Enables loopback bypass for Gemini provider tests using httptest.NewServer.
pkg/agent/providers/provider_cli_timeout_test.go Skips CLI timeout tests when codex/gemini binaries aren’t present in PATH.
pkg/agent/providers/provider_claude_test.go Enables loopback bypass for Claude provider tests using httptest.NewServer.

Comment on lines +14 to +21
func allowLoopbackProviderHostsForTest(t *testing.T) {
t.Helper()

previous := AllowLoopbackForTests
AllowLoopbackForTests = true
t.Cleanup(func() {
AllowLoopbackForTests = previous
})
Comment on lines 20 to 24
func TestCodexProvider_StreamChatDrainsStderr(t *testing.T) {
skipIfExecutableMissing(t, "codex")

defer func() { ExecCommandContext = exec.CommandContext }()
ExecCommandContext = fakeProviderCLICommandContext
@clubanderson

Copy link
Copy Markdown
Collaborator Author

Closing — superseded by #19214 (lint fixes) or no longer needed after build-gate unblock.

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

Labels

ai-generated Pull request generated by AI dco-signoff: yes Indicates the PR's author has signed the DCO. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. tier/1-lightweight

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants