Skip to content

feat(sandbox): 支持注入规则匹配条件#454

Merged
qiniu-prow[bot] merged 2 commits into
qiniu:masterfrom
miclle:sandbox
Jun 30, 2026
Merged

feat(sandbox): 支持注入规则匹配条件#454
qiniu-prow[bot] merged 2 commits into
qiniu:masterfrom
miclle:sandbox

Conversation

@miclle

@miclle miclle commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

变更内容

  • 升级 github.com/qiniu/go-sdk/v7v7.26.14
  • sandbox injection-rule create/update 新增 --if-headers--if-queries
  • sandbox create --inline-injection 支持 if-headers= / if-queries=
  • github 注入类型支持通过 --base-url / base-url= 限制匹配范围
  • injection-rule list/get 展示匹配条件
  • 补充单元测试与真实远端 integration 测试

验证

  • gofmt -s -l .
  • go test ./iqshell/sandbox/... ./cmd_test/...
  • set -a; source .env.prod; set +a; make test-sandbox-integration

说明:make lint 仍受仓库既有 staticcheck 问题影响,失败项不在本次变更文件中。

Release 建议

建议合并后发布 v2.19.9,这是对 go-sdk v7.26.14 新 sandbox 能力的 CLI 跟进,包含用户可见的新参数与文档更新。

升级 go-sdk 到 v7.26.14,补齐 sandbox 注入规则的 if-headers、if-queries 与 GitHub base-url 支持,并增加远端集成测试覆盖。
@qiniu-prow qiniu-prow Bot added the size/XL label Jun 30, 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 request matching conditions (--if-headers and --if-queries) for sandbox injection rules and inline injections, and adds support for limiting GitHub injections to specific repository paths via --base-url. It also upgrades the Qiniu Go SDK to v7.26.14 and adds corresponding integration and unit tests. Feedback is provided regarding a high-severity issue in the inline injection parser (parseInlineInjectionFields), where segments without an equals sign can incorrectly pollute scalar fields like type or base-url if currentKey is not verified to be a map field.

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.

Comment thread iqshell/sandbox/sandbox/operations/create.go

@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 injection rule condition/base-url changes, inline parsing paths, docs, and tests.

Verification run:

  • go test ./iqshell/sandbox/...
  • go test ./cmd/...
  • go test ./iqshell/sandbox/sandbox/operations ./iqshell/sandbox/injection_rule/operations

限制 inline injection 解析中的续写逻辑,只允许 headers、if-headers 和 if-queries 吸收非键值片段,并补充尾部逗号回归测试。
@miclle miclle self-assigned this Jun 30, 2026
@qiniu-prow

qiniu-prow Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by: miclle

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

The pull request process is described 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

@qiniu-prow qiniu-prow Bot merged commit ebdbf62 into qiniu:master Jun 30, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant