-
Notifications
You must be signed in to change notification settings - Fork 1
🐛 Fix baseline download from builds page using OAuth authentication #155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Fix getDefaultBranch undefined error in downloadBaselines by adding proper dependency injection destructuring - Add OAuth-based baseline download via new /api/cli/ routes for users logged in through the dashboard (allows downloading from any project with membership) - Add processDownloadedBaselines() method to handle pre-fetched API responses - Fall back to VIZZLY_TOKEN if OAuth not available - Move SDK-API.md to docs/internal/ and update from vizzly repo Fixes #154
Code Review - PR #155OverviewThis PR fixes the Positive Aspects ✅
Issues and Concerns1. Missing Test Coverage for OAuth Flow
|
This comment was marked as outdated.
This comment was marked as outdated.
…Baselines - Add 4 tests for OAuth authentication flow in baseline router: - Uses OAuth when organizationSlug and projectSlug provided - Falls back to tddService when OAuth fails with auth error - Throws non-auth OAuth errors without fallback - Skips OAuth when organizationSlug or projectSlug missing - Add hotspot download to processDownloadedBaselines when apiKey is available
- Add comprehensive tests for TddService.processDownloadedBaselines() covering baseline clearing, signature extraction, failed build fallback, SHA deduplication, download errors, metadata saving, and hotspot download - Add tests for TddService.downloadHotspots() covering API key checks, unique names, disk/memory storage, and error handling - Create config-service.test.js with tests for getConfig (merged/project/global), updateConfig (project/global), and validateConfig methods - tdd-service.js: 60% → 78% line coverage - config-service.js: 38% → 93% line coverage
Summary
getDefaultBranch is not definederror when downloading baselines from the TDD dashboard builds pagedownloadBaselines()methodSDK-API.mdtodocs/internal/and sync with vizzly repoChanges
authService.authenticatedRequest()to call the new/api/cli/:projectSlug/builds/:buildId/tdd-baselinesendpoint whenorganizationSlugandprojectSlugare providedgetDefaultBranch,output,colors, etc. fromthis._depsprocessDownloadedBaselines()method to handle pre-fetched API responsesdownloadHotspots()dependency injectionTest plan
npm test- all 1590 tests passFixes #154