Skip to content

feat(sandbox): support injection match conditions#467

Merged
miclle merged 1 commit into
qiniu:masterfrom
miclle:sandbox
Jul 7, 2026
Merged

feat(sandbox): support injection match conditions#467
miclle merged 1 commit into
qiniu:masterfrom
miclle:sandbox

Conversation

@miclle

@miclle miclle commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add Python-friendly alias normalization for sandbox injection match fields (ifHeaders / ifQueries -> if_headers / if_queries)
  • update the sandbox injection rule example to demonstrate base_url, if_headers, and if_queries
  • handle envd command end events that report status: "exit status N" instead of exitCode

Validation

  • pytest tests/cases/test_services/test_sandbox (120 passed, 3 skipped)
  • python examples/sandbox_injection_rules.py (create/get/update/delete succeeded against the configured sandbox endpoint)

Add if_headers and if_queries normalization for sandbox injection requests, update the example flow, and cover the new request shapes in tests.

Also handle envd status-based command exit codes observed during integration validation.
@qiniu-prow qiniu-prow Bot added the size/L label Jul 6, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces support for if_headers and if_queries condition matching fields in Sandbox injection rules, along with camelCase compatibility. It also enhances command exit code parsing to handle snake_case keys and status strings. Additionally, test coverage is improved by isolating environment variables, verifying parameter normalization, and handling unsupported runtime errors in integration tests. No review comments were provided, and the implementation is clean and well-tested.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@miclle miclle marked this pull request as ready for review July 6, 2026 03:23

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found in this review. I reviewed the PR diff across code quality, performance, security, and documentation accuracy.

Verification: git diff --check origin/master...HEAD passed. Targeted pytest could not be run because pytest is not installed in this environment.

@miclle miclle self-assigned this Jul 6, 2026
@miclle miclle merged commit 234ec99 into qiniu:master Jul 7, 2026
10 checks passed
@miclle miclle deleted the sandbox branch July 7, 2026 01:37
@miclle miclle mentioned this pull request Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant