Skip to content

feat(sandbox): type and verify default templates - #456

Merged
miclle merged 2 commits into
qiniu:masterfrom
miclle:feat/sandbox-list-default-templates
Jul 28, 2026
Merged

feat(sandbox): type and verify default templates#456
miclle merged 2 commits into
qiniu:masterfrom
miclle:feat/sandbox-list-default-templates

Conversation

@miclle

@miclle miclle commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • type SandboxClient.listDefaultTemplates() as Promise<TemplateInfo[]>
  • add focused success, API error, TypeScript, and live integration coverage
  • show default-template details in the template example and keep mutation opt-in
  • add reproducible unit and .env-backed integration commands

Why

The runtime GET /default-templates wrapper already existed, but its public TypeScript contract still returned any and the behavior lacked focused error-path and live read-only validation. This aligns the Node.js SDK surface and verification with qiniu/go-sdk#230.

Validation

  • npm run test:sandbox:default-templates — 2 passing
  • npm run test:sandbox:integration:default-templates — 1 passing, 8 live templates from the root .env
  • QINIU_SANDBOX_TEMPLATE_MUTATION_EXAMPLE=false node examples/sandbox_templates.js — live read-only example passed
  • npm run test:sandbox — 124 passing
  • npm run check-type
  • targeted ESLint and node --check examples/sandbox_templates.js
  • git diff --check
  • npm pack --dry-run --json

Expose the existing default-template listing as TemplateInfo[] and add focused, live, and example coverage with safe read-only defaults.
@qiniu-prow qiniu-prow Bot added the size/L label Jul 28, 2026
@miclle
miclle marked this pull request as ready for review July 28, 2026 09:14

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

I found two actionable gaps in the new default-template typing coverage; details are inline.

Comment thread test/sandbox_types.ts Outdated
Comment thread index.d.ts Outdated
Add a dedicated default-template response type and assert both element and build-status types to prevent any regressions.
@miclle

This comment has been minimized.

@fennoai

fennoai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Complete

  • No actionable findings.
  • npm run test:sandbox:default-templates — 2 passing.
  • npm run check-type — passed.
  • Targeted ESLint, node --check, and git diff --check — passed.
  • npm run test:sandbox — 124 passing.
  • npm pack --dry-run --json — passed.

View job run

@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.41%. Comparing base (32685e9) to head (abf9f73).
⚠️ Report is 6 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #456      +/-   ##
==========================================
- Coverage   93.41%   93.41%   -0.01%     
==========================================
  Files          14       14              
  Lines        2006     2050      +44     
==========================================
+ Hits         1874     1915      +41     
- Misses        132      135       +3     
🚀 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.

No actionable findings. The default-template typing, read-only example behavior, error-path coverage, and integration-test gating are consistent with the existing sandbox client. Focused and full sandbox validation passed.

@miclle
miclle merged commit f89d719 into qiniu:master Jul 28, 2026
9 checks passed
@miclle
miclle deleted the feat/sandbox-list-default-templates branch July 28, 2026 09:39
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