Skip to content

Commit 2bd7e33

Browse files
authored
Merge branch 'aws:master' into master
2 parents cbff9e6 + 8956940 commit 2bd7e33

File tree

19 files changed

+168
-68
lines changed

19 files changed

+168
-68
lines changed

.changes/1.98.0.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"date": "2023-11-09",
3+
"version": "1.98.0",
4+
"entries": [
5+
{
6+
"type": "Bug Fix",
7+
"description": "CodeWhisperer, CodeCatalyst may require login again after Switching VSCode workspaces"
8+
},
9+
{
10+
"type": "Bug Fix",
11+
"description": "\"Scanning CloudFormation templates...\" message `Cancel` button does not fully stop the scan"
12+
},
13+
{
14+
"type": "Bug Fix",
15+
"description": "ECS: `SimulatePrincipalPolicy` permission is no longer required for users to run `exec command`"
16+
}
17+
]
18+
}

.changes/next-release/Bug Fix-bbaf4ca5-56ad-47cc-949c-11fc91a8bff1.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 1.98.0 2023-11-09
2+
3+
- **Bug Fix** CodeWhisperer, CodeCatalyst may require login again after Switching VSCode workspaces
4+
- **Bug Fix** "Scanning CloudFormation templates..." message `Cancel` button does not fully stop the scan
5+
- **Bug Fix** ECS: `SimulatePrincipalPolicy` permission is no longer required for users to run `exec command`
6+
17
## 1.97.0 2023-11-02
28

39
- **Bug Fix** CodeWhisperer: fix and improve closing symbols handling (brackets, parenthesis, quotes etc)

buildspec/linuxTests.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ phases:
4444
build:
4545
commands:
4646
- export HOME=/home/codebuild-user
47+
# TODO: run lint as a separate codebuild job.
48+
- |
49+
if [ "$VSCODE_TEST_VERSION" = 'insiders' ] ; then
50+
npm run testCompile
51+
npm run lint
52+
fi
4753
- xvfb-run npm test --silent
4854
- VCS_COMMIT_ID="${CODEBUILD_RESOLVED_SOURCE_VERSION}"
4955
- CI_BUILD_URL=$(echo $CODEBUILD_BUILD_URL | sed 's/#/%23/g') # Encode `#` in the URL because otherwise the url is clipped in the Codecov.io site

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "aws-toolkit-vscode",
33
"displayName": "AWS Toolkit",
44
"description": "Including CodeWhisperer, CodeCatalyst, and support for Lambda, S3, CloudWatch Logs, and many other services",
5-
"version": "1.98.0-SNAPSHOT",
5+
"version": "1.99.0-SNAPSHOT",
66
"extensionKind": [
77
"workspace"
88
],

src/codecatalyst/devfile.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ export function registerDevfileWatcher(devenvClient: DevEnvClient): vscode.Dispo
111111
const registry = new DevfileRegistry()
112112
const codelensProvider = new DevfileCodeLensProvider(registry, devenvClient)
113113
registry.addWatchPatterns([devfileGlobPattern])
114+
registry.rebuild()
114115

115116
const codelensDisposable = vscode.languages.registerCodeLensProvider(
116117
{

src/lambda/commands/createNewSamApp.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ import globals from '../../shared/extensionGlobals'
4848
import { telemetry } from '../../shared/telemetry/telemetry'
4949
import { LambdaArchitecture, Result, Runtime } from '../../shared/telemetry/telemetry'
5050
import { getTelemetryReason, getTelemetryResult } from '../../shared/errors'
51-
import { openUrl } from '../../shared/utilities/vsCodeUtils'
51+
import { openUrl, replaceVscodeVars } from '../../shared/utilities/vsCodeUtils'
5252

5353
export const samInitTemplateFiles: string[] = ['template.yaml', 'template.yml']
5454
export const samInitReadmeFile: string = 'README.TOOLKIT.md'
@@ -395,8 +395,7 @@ export async function addInitialLaunchConfiguration(
395395
const targetDir: string = path.dirname(targetUri.fsPath)
396396
const filtered = configurations.filter(config => {
397397
let templatePath: string = (config.invokeTarget as TemplateTargetProperties).templatePath
398-
// TODO: write utility function that does this for other variables too
399-
templatePath = templatePath.replace('${workspaceFolder}', folder.uri.fsPath)
398+
templatePath = replaceVscodeVars(templatePath, folder.uri.fsPath)
400399

401400
return (
402401
isTemplateTargetProperties(config.invokeTarget) &&

src/shared/cloudformation/activation.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import * as CloudFormation from './cloudformation'
1515
import { Commands } from '../vscode/commands2'
1616
import globals from '../extensionGlobals'
1717
import { SamCliSettings } from '../sam/cli/samCliSettings'
18+
import { Timeout } from '../utilities/timeoutUtils'
1819

1920
/**
2021
* Creates a CloudFormationTemplateRegistry which retains the state of CloudFormation templates in a workspace.
@@ -56,12 +57,12 @@ export async function activate(extensionContext: vscode.ExtensionContext): Promi
5657
* and slowing down the extension starting up.
5758
*/
5859
function setTemplateRegistryInGlobals(registry: CloudFormationTemplateRegistry) {
59-
const registrySetupFunc = async (registry: CloudFormationTemplateRegistry) => {
60-
await registry.addExcludedPattern(CloudFormation.devfileExcludePattern)
61-
await registry.addExcludedPattern(CloudFormation.templateFileExcludePattern)
62-
await registry.addWatchPatterns([CloudFormation.templateFileGlobPattern])
63-
await registry.watchUntitledFiles()
64-
60+
const registrySetupFunc = async (registry: CloudFormationTemplateRegistry, cancellationTimeout: Timeout) => {
61+
registry.addExcludedPattern(CloudFormation.devfileExcludePattern)
62+
registry.addExcludedPattern(CloudFormation.templateFileExcludePattern)
63+
registry.addWatchPatterns([CloudFormation.templateFileGlobPattern])
64+
registry.watchUntitledFiles()
65+
await registry.rebuild(cancellationTimeout)
6566
return registry
6667
}
6768

src/shared/fs/templateRegistry.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { getLambdaDetails } from '../../lambda/utils'
1414
import { WatchedFiles, WatchedItem } from './watchedFiles'
1515
import { getLogger } from '../logger'
1616
import globals from '../extensionGlobals'
17-
import { sleep } from '../utilities/timeoutUtils'
17+
import { Timeout, sleep } from '../utilities/timeoutUtils'
1818
import { localize } from '../utilities/vsCodeUtils'
1919
import { PerfLog } from '../logger/logger'
2020

@@ -71,7 +71,8 @@ export class AsyncCloudFormationTemplateRegistry {
7171
constructor(
7272
private readonly instance: CloudFormationTemplateRegistry,
7373
private readonly asyncSetupFunc: (
74-
instance: CloudFormationTemplateRegistry
74+
instance: CloudFormationTemplateRegistry,
75+
cancelSetup: Timeout
7576
) => Promise<CloudFormationTemplateRegistry>
7677
) {}
7778

@@ -86,18 +87,21 @@ export class AsyncCloudFormationTemplateRegistry {
8687
}
8788

8889
let perf: PerfLog
90+
const cancelSetup = new Timeout(30 * 60 * 1000) // 30 min
8991
if (!this.setupPromise) {
9092
perf = new PerfLog('cfn: template registry setup')
91-
this.setupPromise = this.asyncSetupFunc(this.instance)
93+
this.setupPromise = this.asyncSetupFunc(this.instance, cancelSetup)
9294
}
9395
this.setupPromise.then(() => {
9496
if (perf) {
9597
perf.done()
9698
}
9799
this.isSetup = true
100+
cancelSetup.dispose()
98101
})
99102
// Show user a message indicating setup is in progress
100103
if (this.setupProgressMessage === undefined) {
104+
// TODO: use showMessageWithCancel() ?
101105
this.setupProgressMessage = vscode.window.withProgress(
102106
{
103107
location: vscode.ProgressLocation.Notification,
@@ -111,6 +115,7 @@ export class AsyncCloudFormationTemplateRegistry {
111115
token.onCancellationRequested(() => {
112116
// Allows for new message to be created if templateRegistry variable attempted to be used again
113117
this.setupProgressMessage = undefined
118+
cancelSetup.cancel()
114119
})
115120
getLogger().debug('cfn: getInstance() requested, still initializing')
116121
while (!this.isSetup) {

0 commit comments

Comments
 (0)