Skip to content

feat(sandbox): sync latest sandbox APIs#454

Merged
miclle merged 4 commits into
qiniu:masterfrom
miclle:feat/sandbox-api-spec-sync
Jul 21, 2026
Merged

feat(sandbox): sync latest sandbox APIs#454
miclle merged 4 commits into
qiniu:masterfrom
miclle:feat/sandbox-api-spec-sync

Conversation

@miclle

@miclle miclle commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Validation

  • npm run test:sandbox (121 passing)
  • npm run check-type
  • targeted ESLint for all changed JavaScript files
  • git diff --check
  • live sandbox smoke: template-filtered listing, template names/isOwner, runtime injection get/update, GitHub token update, and Kodo resource mounting/writes

Live smoke notes

  • the runtime injection APIs succeeded; the downstream httpbin request returned Bad Gateway in the current sandbox environment
  • GitHub repository resource creation returned 401 with the current repo/token pair, while updateGithubToken() was verified independently against the live API

Follow the latest sandbox OpenAPI contract with template filters, runtime injection management, and GitHub token updates. Keep runtime helpers, TypeScript declarations, tests, and executable examples aligned.
@qiniu-prow qiniu-prow Bot added the size/L label Jul 21, 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 managing runtime injections and updating GitHub tokens on sandboxes, along with template filtering capabilities in sandbox listings. It updates the client, facade, TypeScript definitions, examples, and adds corresponding tests. The review feedback highlights a critical issue where the newly added client methods (getSandboxInjections, updateSandboxInjections, and updateSandboxGithubToken) lack validation for sandboxID, potentially leading to invalid request paths. Additionally, updateSandboxInjections needs safer handling of the injections parameter to prevent a TypeError if a non-array value is provided.

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 qiniu/sandbox/client.js
@miclle
miclle marked this pull request as ready for review July 21, 2026 03:18

@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.

Review Summary

No additional findings in the current diff beyond the already-open review thread.

Verified with npm run test:sandbox (121 passing), npm run check-type, targeted ESLint, and git diff --check.

View job run

Reject missing sandbox IDs before constructing request paths and return a typed SDK error for non-array injection payloads. Add regression coverage to ensure invalid input never reaches the HTTP client.
@miclle

This comment has been minimized.

@miclle

This comment has been minimized.

@fennoai

fennoai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Complete

No issues found in the latest PR head (71ad62b). The final commit adds the missing authorizationToken validation, so the previously open review concern is addressed.

Validation completed:

  • npm run test:sandbox — 122 passing
  • npm run check-type
  • Targeted ESLint for all changed JavaScript files
  • git diff --check

A non-blocking PR review was submitted. No code changes were made by FennoAI.

View job run

@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 adds support for managing runtime injections and updating GitHub tokens on sandboxes, along with filtering sandboxes by template. It implements new methods on SandboxClient and Sandbox, updates TypeScript definitions, adds usage examples, and includes comprehensive tests. Feedback is provided to add a validation check for the authorizationToken parameter in updateSandboxGithubToken to prevent incomplete API requests.

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 qiniu/sandbox/client.js
Reject missing authorization tokens before issuing runtime GitHub token update requests. Extend argument validation coverage so incomplete payloads never reach the API.
@miclle

This comment has been minimized.

@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.

Review Summary

No additional findings in the current head beyond the already-open review thread requesting validation for an empty authorizationToken before sending the GitHub-token update request. The earlier sandbox ID and injection-array validation feedback is fixed in f7b02c8.

Verified with npm run test:sandbox (122 passing), npm run check-type, targeted ESLint for changed JavaScript files, and git diff --check.

View job run

@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 adds support for managing runtime injections and updating GitHub tokens on running sandboxes, alongside updating TypeScript definitions, examples, and unit tests. The feedback suggests improving robustness by normalizing the template query parameter to handle template objects and filtering out falsy values from the mapped injections array before sending the API request.

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 qiniu/sandbox/client.js
Comment thread qiniu/sandbox/client.js
Accept template objects returned by the SDK when building sandbox list filters. Reject invalid injection entries explicitly so replacement updates cannot silently discard malformed rules.
@miclle

This comment has been minimized.

@miclle

This comment has been minimized.

@fennoai

fennoai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Complete

No issues found in the latest PR head (e0dd387). The new template-object normalization and malformed-injection validation are covered by regression tests.

Validation completed:

  • npm run test:sandbox — 122 passing
  • npm run check-type
  • Targeted ESLint for changed JavaScript files
  • git diff --check

A non-blocking PR review was submitted. No code changes were made by FennoAI.

View job run

@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.66667% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.41%. Comparing base (32685e9) to head (e0dd387).
⚠️ Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
qiniu/sandbox/client.js 90.00% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #454      +/-   ##
==========================================
- Coverage   93.41%   93.41%   -0.01%     
==========================================
  Files          14       14              
  Lines        2006     2050      +44     
==========================================
+ Hits         1874     1915      +41     
- Misses        132      135       +3     
Files with missing lines Coverage Δ
qiniu/sandbox/sandbox.js 92.85% <100.00%> (+0.21%) ⬆️
qiniu/sandbox/client.js 96.30% <90.00%> (-0.69%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@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.

Review Summary

No issues found in the latest head (e0dd387). The new template-object normalization and malformed-injection validation are covered by regression tests and do not introduce additional correctness, performance, security, or documentation concerns.

Verified with npm run test:sandbox (122 passing), npm run check-type, targeted ESLint for changed JavaScript files, and git diff --check.

View job run

@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 managing runtime injections and updating GitHub tokens on running sandboxes. It adds new methods (getInjections, updateInjections, updateGithubToken) to both SandboxClient and Sandbox classes, updates TypeScript type definitions, enhances template filtering when listing sandboxes, and updates relevant examples and test suites to cover these new capabilities. I have no feedback to provide as there are no review comments.

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 merged commit e15e2ba into qiniu:master Jul 21, 2026
9 checks passed
@miclle
miclle deleted the feat/sandbox-api-spec-sync branch July 21, 2026 04:07
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