Skip to content

Commit 119a56e

Browse files
authored
Merge branch 'master' into feature/inlinebug
2 parents 0135e35 + 29a73ca commit 119a56e

File tree

4 files changed

+24
-4
lines changed

4 files changed

+24
-4
lines changed

packages/core/src/awsService/sagemaker/commands.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,16 @@ export async function stopSpace(
133133
ctx: vscode.ExtensionContext,
134134
sageMakerClient?: SagemakerClient
135135
) {
136+
await tryRefreshNode(node)
137+
if (node.getStatus() === 'Stopped' || node.getStatus() === 'Stopping') {
138+
void vscode.window.showWarningMessage(`Space ${node.spaceApp.SpaceName} is already in Stopped/Stopping state.`)
139+
return
140+
} else if (node.getStatus() === 'Starting') {
141+
void vscode.window.showWarningMessage(
142+
`Space ${node.spaceApp.SpaceName} is in Starting state. Wait until it is Running to attempt stop again.`
143+
)
144+
return
145+
}
136146
const spaceName = node.spaceApp.SpaceName!
137147
const confirmed = await showConfirmationMessage({
138148
prompt: `You are about to stop this space. Any active resource will also be stopped. Are you sure you want to stop the space?`,
@@ -179,7 +189,7 @@ export async function openRemoteConnect(
179189
void vscode.window.showErrorMessage(ConnectFromRemoteWorkspaceMessage)
180190
return
181191
}
182-
192+
await tryRefreshNode(node)
183193
if (node.getStatus() === 'Stopped') {
184194
// In case of SMUS, we pass in a SM Client and for SM AI, it creates a new SM Client.
185195
const client = sageMakerClient ? sageMakerClient : new SagemakerClient(node.regionCode)

packages/core/src/codewhisperer/service/transformByQ/transformApiHandler.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,8 @@ function isExcludedSourceFile(path: string): boolean {
275275
return sourceExcludedExtensions.some((extension) => path.endsWith(extension))
276276
}
277277

278-
// zip all dependency files and all source files excluding "target" (contains large JARs) plus ".git" and ".idea" (may appear in diff.patch)
278+
// zip all dependency files and all source files
279+
// excludes "target" (contains large JARs) plus ".git", ".idea", and ".github" (may appear in diff.patch)
279280
export function getFilesRecursively(dir: string, isDependenciesFolder: boolean): string[] {
280281
const entries = nodefs.readdirSync(dir, { withFileTypes: true })
281282
const files = entries.flatMap((entry) => {
@@ -284,7 +285,12 @@ export function getFilesRecursively(dir: string, isDependenciesFolder: boolean):
284285
if (isDependenciesFolder) {
285286
// include all dependency files
286287
return getFilesRecursively(res, isDependenciesFolder)
287-
} else if (entry.name !== 'target' && entry.name !== '.git' && entry.name !== '.idea') {
288+
} else if (
289+
entry.name !== 'target' &&
290+
entry.name !== '.git' &&
291+
entry.name !== '.idea' &&
292+
entry.name !== '.github'
293+
) {
288294
// exclude the above directories when zipping source code
289295
return getFilesRecursively(res, isDependenciesFolder)
290296
} else {

packages/core/src/shared/sshConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ Host ${this.configHostName}
208208

209209
protected createSSHConfigSection(proxyCommand: string): string {
210210
if (this.scriptPrefix === 'sagemaker_connect') {
211-
return `${this.getSageMakerSSHConfig(proxyCommand)}User '%r'\n`
211+
return `${this.getSageMakerSSHConfig(proxyCommand)}`
212212
} else if (this.keyPath) {
213213
return `${this.getBaseSSHConfig(proxyCommand)}IdentityFile '${this.keyPath}'\n User '%r'\n`
214214
}

packages/core/src/test/codewhisperer/commands/transformByQ.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,10 @@ dependencyManagement:
503503
await fs.mkdir(gitFolder)
504504
await fs.writeFile(path.join(gitFolder, 'config'), 'sample content for the test file')
505505

506+
const githubFolder = path.join(tempDir, '.github')
507+
await fs.mkdir(githubFolder)
508+
await fs.writeFile(path.join(githubFolder, 'config'), 'more sample content for the test file')
509+
506510
const zippedFiles = getFilesRecursively(tempDir, false)
507511
assert.strictEqual(zippedFiles.length, 1)
508512
})

0 commit comments

Comments
 (0)