Skip to content

feat: CDN integration with OSS and API Gateway CDN support#195

Merged
Blankll merged 4 commits into
masterfrom
feat/cdn-integration
May 28, 2026
Merged

feat: CDN integration with OSS and API Gateway CDN support#195
Blankll merged 4 commits into
masterfrom
feat/cdn-integration

Conversation

@Blankll
Copy link
Copy Markdown
Member

@Blankll Blankll commented Apr 30, 2026

This pull request introduces support for Alibaba Cloud CDN and OSS Transfer Acceleration, expands the SDK client layer, and includes dependency upgrade fixes and code review corrections.

Major Features

CDN and Transfer Acceleration Support

  • CDN acceleration and OSS Transfer Acceleration for static website hosting
  • Simple (cdn: true) and advanced configuration options
  • Dual-layer acceleration (CDN + Transfer Acceleration)
  • Full CDN lifecycle: domain creation, certificate binding, cache/compression/protocol/HTTPS redirect configuration

SDK Client Expansion

  • New cdnOperations module with domain, certificate, cache, protocol, compression, and HTTPS redirect management
  • CDN SDK client integrated into Aliyun client factory
  • DNS operations for CNAME record management

Bug Fixes & Corrections

CDN API Fix (Critical)

  • applyProtocolConfig now uses correct forward_scheme feature (not range) for origin protocol configuration
  • The range feature controls back-to-origin range slicing, not protocol. Origin protocol requires forward_scheme with enable parameter.

Dependency Upgrade Compatibility

  • CDN SDK v9.2.0: SetDomainServerCertificateSetCdnDomainSSLCertificate API migration
  • @types/jest v30: tsconfig types field for Jest globals
  • Flaky test retry logic for ECONNRESET race condition

Code Quality

  • Added dns property to MockAliyunClient type (was missing from mock)
  • Removed redundant isCdnEnabled double-check in OSS www CDN block
  • Added 12 tests for BatchSetCdnDomainConfig functions (applyCacheConfig, applyProtocolConfig, applyCompression, applyHttpsRedirect)

Documentation

  • Updated README with CDN/acceleration configuration examples
  • Clarified project value proposition in English and Chinese docs

Test Coverage

  • 128 test suites, 2219 tests passed
  • 94.31% coverage (above 85% threshold)

Commits

  1. feat: CDN integration with OSS and API Gateway CDN support - Original feature
  2. fix: resolve dependency upgrade compatibility issues - SDK/API migration
  3. fix: correct CDN origin protocol API and code review issues - Bug fixes and tests

Blankll added 3 commits April 30, 2026 10:43
- CDN SDK v9.2.0: update SetDomainServerCertificate to SetCdnDomainSSLCertificate
- @types/jest v30: add types field to tsconfig for Jest globals
- Fix flaky localStack test with retry logic for ECONNRESET race condition
- Update CDN test mocks to match new SDK API
- Add .omo/ to gitignore
- fix(cdn): applyProtocolConfig uses forward_scheme (not range) for origin protocol
- fix(cdn): add tests for applyCacheConfig, applyProtocolConfig, applyCompression, applyHttpsRedirect
- fix(mock): add dns property to MockAliyunClient type
- fix(oss): remove redundant isCdnEnabled double-check in www CDN block
@Blankll Blankll marked this pull request as ready for review May 28, 2026 14:22
@Blankll Blankll merged commit 3900330 into master May 28, 2026
4 checks passed
@Blankll Blankll deleted the feat/cdn-integration branch May 28, 2026 14:41
@codecov
Copy link
Copy Markdown

codecov Bot commented May 28, 2026

Codecov Report

❌ Patch coverage is 89.79592% with 35 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.35%. Comparing base (2163ebb) to head (7aa00bf).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/stack/aliyunStack/apigwTypes.ts 47.22% 2 Missing and 17 partials ⚠️
src/stack/aliyunStack/apigwResource.ts 94.67% 1 Missing and 8 partials ⚠️
src/common/aliyunClient/cdnOperations.ts 94.36% 0 Missing and 4 partials ⚠️
src/parser/bucketParser.ts 91.42% 0 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #195      +/-   ##
==========================================
+ Coverage   87.81%   88.35%   +0.53%     
==========================================
  Files         144      145       +1     
  Lines        8602     7634     -968     
  Branches     2216     1995     -221     
==========================================
- Hits         7554     6745     -809     
+ Misses        498      398     -100     
+ Partials      550      491      -59     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant