Skip to content

Commit 4531668

Browse files
authored
fix(appbuilder): misleading placeholder message #6010
## Problem I was working on a CDK project, and after synthesizing my CDK template, I noticed that the app-builder is showing a misleading notification to customers: No IaC templates found in the workspace. This seems incorrect, as I do have IaC templates in the workspace, including both raw and synthesized CDK templates. While I understand the intention behind the message, it needs to be more precise to avoid confusion. I suggest we roll it back to something more accurate, like No SAM templates found in the workspace, to clearly indicate the specific missing template type. ## Solution Solution is to change all instance where IAC is mentioned to the customer to SAM, we would roll back to IaC once we start support CDK. Remove redundant Logic.
1 parent 4d8932e commit 4531668

File tree

5 files changed

+10
-17
lines changed

5 files changed

+10
-17
lines changed

packages/core/src/awsService/appBuilder/explorer/nodes/appNode.ts

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import { getSamCliContext } from '../../../../shared/sam/cli/samCliContext'
1717
import { SamCliListResourcesParameters } from '../../../../shared/sam/cli/samCliListResources'
1818
import { getDeployedResources, StackResource } from '../../../../lambda/commands/listSamResources'
1919
import * as path from 'path'
20-
import fs from '../../../../shared/fs/fs'
2120
import { generateStackNode } from './deployedStack'
2221

2322
export class AppNode implements TreeNode {
@@ -61,19 +60,9 @@ export class AppNode implements TreeNode {
6160

6261
// indicate that App exists, but it is empty
6362
if (resources.length === 0) {
64-
if (await fs.exists(this.location.samTemplateUri)) {
65-
return [
66-
createPlaceholderItem(
67-
localize(
68-
'AWS.appBuilder.explorerNode.app.noResource',
69-
'[No resource found in IaC template]'
70-
)
71-
),
72-
]
73-
}
7463
return [
7564
createPlaceholderItem(
76-
localize('AWS.appBuilder.explorerNode.app.noTemplate', '[No IaC templates found in Workspaces]')
65+
localize('AWS.appBuilder.explorerNode.app.noResource', '[No resource found in SAM template]')
7766
),
7867
]
7968
}
@@ -84,7 +73,7 @@ export class AppNode implements TreeNode {
8473
createPlaceholderItem(
8574
localize(
8675
'AWS.appBuilder.explorerNode.app.noResourceTree',
87-
'[Unable to load Resource tree for this App. Update IaC template]'
76+
'[Unable to load Resource tree for this App. Update SAM template]'
8877
)
8978
),
9079
]

packages/core/src/awsService/appBuilder/explorer/nodes/rootNode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export async function getAppNodes(): Promise<TreeNode[]> {
2626
if (appsFound.length === 0) {
2727
return [
2828
createPlaceholderItem(
29-
localize('AWS.appBuilder.explorerNode.noApps', '[No IaC templates found in Workspaces]')
29+
localize('AWS.appBuilder.explorerNode.noApps', '[No SAM templates found in Workspaces]')
3030
),
3131
]
3232
}

packages/core/src/test/shared/applicationBuilder/explorer/nodes/appNode.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ describe('AppNode', () => {
9090

9191
const resourceNode = resources[0] as TreeNode
9292
assert.strictEqual(resourceNode.id, 'placeholder')
93-
assert.strictEqual(resourceNode.resource, '[No IaC templates found in Workspaces]')
93+
assert.strictEqual(resourceNode.resource, '[No resource found in SAM template]')
9494
assert(getAppStub.calledOnce)
9595
assert(getStackNameStub.calledOnce)
9696
assert(generateStackNodeStub.notCalled)
@@ -157,7 +157,7 @@ describe('AppNode', () => {
157157
assert.strictEqual(resourceNode.id, 'placeholder')
158158
assert.strictEqual(
159159
resourceNode.resource,
160-
'[Unable to load Resource tree for this App. Update IaC template]'
160+
'[Unable to load Resource tree for this App. Update SAM template]'
161161
)
162162
assert(getAppStub.calledOnce)
163163
assert(getStackNameStub.notCalled)

packages/core/src/test/shared/applicationBuilder/explorer/nodes/rootNode.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ describe('getAppNodes', async () => {
3434
const appNodes = await getAppNodes()
3535
assert.strictEqual(appNodes.length, 1)
3636
assert.strictEqual(appNodes[0].id, 'placeholder')
37-
assert.strictEqual(appNodes[0].resource, '[No IaC templates found in Workspaces]')
37+
assert.strictEqual(appNodes[0].resource, '[No SAM templates found in Workspaces]')
3838
})
3939

4040
it('should return all SAM projects as AppNode', async () => {
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Bug Fix",
3+
"description": "SAM debugging: misleading 'IaC' message/placeholder"
4+
}

0 commit comments

Comments
 (0)