-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Description
The getStackName() function in the deploy command lacks the fallback logic that resource discovery uses, causing post-deployment health checks to fail even when deployment succeeds.
Current Behavior
During Deployment (Resource Discovery):
// packages/devtools/infrastructure/domains/shared/resource-discovery.js (lines 91-92)
const stackName = `${appDefinition.name || 'create-frigg-app'}-${stage}`;
const serviceName = appDefinition.name || 'create-frigg-app';- Has hardcoded fallback to
'create-frigg-app' - Works even when
appDefinition.nameis undefined - Result: Stack found successfully ✅
During Health Check (Post-Deploy):
// packages/devtools/frigg-cli/deploy-command/index.js (lines 190-212)
function getStackName(appDefinition, options) {
if (appDefinition?.name) {
return `${appDefinition.name}-${stage}`;
}
const infraModule = require(infraPath);
if (infraModule.service) {
return `${infraModule.service}-${stage}`;
}
return null; // ← NO FALLBACK
}- No fallback logic
- Returns
nullwhenappDefinition.nameis undefined - Result: Health check skipped
⚠️
Impact
When appDefinition.name is not explicitly defined:
- Deployment succeeds (uses fallback name)
- Stack is created/updated as
create-frigg-app-{stage} - Post-deploy health check can't determine stack name
- Health check is skipped with warning:
⚠️ Could not determine stack name - skipping health check Run "frigg doctor <stack-name>" manually to check stack health
Reproduction
-
Create appDefinition without
nameproperty:const appDefinition = { integrations: [MyIntegration], // name: 'my-app', // ← Not defined vpc: { enable: true }, // ... };
-
Run deployment:
frigg deploy --stage production
-
Observe output:
✔ Service deployed to stack create-frigg-app-production (333s) ✓ Deployment completed successfully! ⚠️ Could not determine stack name - skipping health check
Proposed Fix
Option 1: Add same fallback to getStackName():
function getStackName(appDefinition, options) {
const stage = options.stage || 'dev';
if (appDefinition?.name) {
return `${appDefinition.name}-${stage}`;
}
// Try infrastructure.js
const infraPath = path.join(process.cwd(), PATHS.INFRASTRUCTURE);
if (fs.existsSync(infraPath)) {
try {
const infraModule = require(infraPath);
if (infraModule.service) {
return `${infraModule.service}-${stage}`;
}
} catch (error) {
// Ignore
}
}
// Fallback to default (same as resource discovery)
return `create-frigg-app-${stage}`;
}Option 2: Extract shared stack name resolution logic to a utility function used by both.
Files Affected
packages/devtools/infrastructure/domains/shared/resource-discovery.js(line 91-92)packages/devtools/frigg-cli/deploy-command/index.js(line 190-212)
Environment
- Frigg version: 2.0.0--canary.482.bda352c.0
- Node version: 20.x
- Deployment: GitHub Actions / AWS Lambda
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working