feat: simplify GCS storage naming and add Cloud Run deployment options

Changes:
- **NEW**: type: 'gcs' now uses native @google-cloud/storage SDK (more intuitive!)
- **DEPRECATED**: type: 'gcs-native' is deprecated (use 'gcs' instead)
- **NEW**: Add skipInitialScan option to skip bucket scan on init (fixes Cloud Run timeouts)
- **NEW**: Add skipCountsFile option to disable counts persistence
- **NEW**: Add 2-minute timeout to bucket scans with helpful error messages
- **IMPROVED**: Better error handling and recovery for bucket scan failures
- **IMPROVED**: Automatic detection of HMAC keys routes to S3CompatibleStorage
- **IMPROVED**: Backward compatibility maintained - all existing configs still work

Migration Guide:
- If using type: 'gcs-native' → Change to type: 'gcs' (or remove type, it auto-detects)
- If using HMAC keys with gcsStorage → Consider migrating to ADC for better performance
- For Cloud Run timeouts → Add skipInitialScan: true to gcsNativeStorage config

Why This Fixes the Waitlist Bug:
- Cloud Run containers were timing out during bucket scans
- skipInitialScan option allows bypassing expensive bucket scans
- Timeout handling prevents silent failures
- Better error messages guide users to solutions

Resolves issue where GCS native adapter was confusingly named 'gcs-native'
while legacy S3-compatible mode used 'gcs'. Now 'gcs' correctly uses the
native SDK by default, as users expect. Previous configs continue to work.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
David Snelling 2025-10-20 11:11:54 -07:00
parent 368dd90348
commit 38343c0128
4 changed files with 218 additions and 87 deletions

View file

@ -478,9 +478,10 @@ describe('GCS Native Storage Adapter', () => {
const status = await storage.getStorageStatus()
expect(status.type).toBe('gcs-native')
expect(status.type).toBe('gcs') // Changed from 'gcs-native' to 'gcs'
expect(status.details).toBeTruthy()
expect(status.details!.bucket).toBe('test-bucket')
expect(status.details!.sdk).toBe('native') // Verify we're using native SDK
console.log('✅ Storage status retrieved:', status)
})