feat: enhance Vercel service with deployment and domain management#256
Merged
Conversation
|
@Folex1275 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Vercel Service Operations Implementation
Overview
This PR implements four related issues for Vercel service operations, adding domain configuration, deployment status retrieval, comprehensive unit tests, and property tests for environment variable configuration.
Changes
Issue #91: Implement Vercel Domain Configuration
Files Modified:
apps/web/src/services/vercel.service.tsNew Types:
DomainVerification- DNS verification requirementsAddDomainRequest- Domain configuration requestAddDomainResult- Domain addition result with verificationDomainConfig- Domain configuration detailsNew Methods:
addDomain()- Add a domain to a Vercel project or deployment with verification requirementsremoveDomain()- Remove a domain from a Vercel project (best-effort cleanup)getDomainConfig()- Get domain configuration and verification statusverifyDomain()- Verify domain ownership by checking DNS recordsNew Error Codes:
DOMAIN_ALREADY_EXISTS- Domain already existsDOMAIN_NOT_FOUND- Domain not foundDOMAIN_VERIFICATION_REQUIRED- Domain verification requiredFeatures:
Issue #92: Implement Retrieval of Vercel Deployment Status
Files Modified:
apps/web/src/services/vercel.service.tsNew Types:
VercelDeploymentStatus- Vercel deployment status enumVercelDeployment- Vercel deployment detailsNormalizedDeploymentStatus- Internal deployment statusNew Methods:
getDeployment()- Get deployment details from VercelgetDeploymentStatus()- Get normalized deployment statusnormalizeDeploymentStatus()- Map Vercel status to internal stateslistDeployments()- List deployments for a projectStatus Mappings:
QUEUED→pendingBUILDING→buildingREADY→readyERROR/FAILED→failedCANCELED→canceledFeatures:
Issue #93: Write Unit Tests for Vercel Service Operations
Files Created:
apps/web/src/services/vercel.service.test.tsTest Coverage:
validateVercelConfig:
createProject:
triggerDeployment:
addDomain:
removeDomain:
getDomainConfig:
verifyDomain:
getDeployment:
getDeploymentStatus:
normalizeDeploymentStatus:
listDeployments:
validateAccess:
deleteProject:
Total Tests: 50+ comprehensive test cases
Issue #94: Add Property Test for Vercel Environment Variable Configuration
Files Created:
apps/web/src/lib/env/env-template-generator.property.test.tsProperty 21: Vercel Environment Variable Configuration
Test Categories:
Required Environment Variables:
NEXT_PUBLIC_APP_NAMENEXT_PUBLIC_STELLAR_NETWORKNEXT_PUBLIC_HORIZON_URLNEXT_PUBLIC_NETWORK_PASSPHRASENEXT_PUBLIC_SUPABASE_URLNEXT_PUBLIC_SUPABASE_ANON_KEYSUPABASE_SERVICE_ROLE_KEYEnvironment Variable Values:
NEXT_PUBLIC_APP_NAMEmatchesbranding.appNameNEXT_PUBLIC_PRIMARY_COLORmatchesbranding.primaryColorNEXT_PUBLIC_STELLAR_NETWORKmatchesstellar.networkNEXT_PUBLIC_ENABLE_CHARTSmatchesfeatures.enableChartsEnvironment Variable Targets:
VercelEnvTargetvaluesEnvironment Variable Types:
plainencryptedTemplate-Specific Variables:
soroban-defialways includesNEXT_PUBLIC_SOROBAN_RPC_URLstellar-dexincludesNEXT_PUBLIC_ASSET_PAIRSwhen configuredsoroban-defiincludesNEXT_PUBLIC_CONTRACT_ADDRESSESwhen configuredStructural Invariants:
buildEnvVarEntriesandbuildVercelEnvVarsproduce consistent keysMissing/Invalid Data Handling:
Iterations: 100+ per test case
Testing
Unit Tests
Run the Vercel service unit tests:
npm test -- apps/web/src/services/vercel.service.test.tsProperty Tests
Run the environment variable property tests:
npm test -- apps/web/src/lib/env/env-template-generator.property.test.tsEdge Cases & Assumptions
Edge Cases Handled:
DOMAIN_ALREADY_EXISTScodegetDomainConfig, best-effort cleanup forremoveDomainUNKNOWNerror with descriptive messageretryAfterMsfor client-side backoffNETWORK_ERRORcodeAUTH_FAILEDcode across all operationsVERCEL_TEAM_IDenvironment variable supportAssumptions:
VERCEL_TOKENenvironment variableVERCEL_TEAM_IDenvironment variableFollow-up Work
Security Considerations
Related Issues
Closes #91
Closes #92
Closes #93
Closes #94
Checklist