Skip to content

Commit 12e50ee

Browse files
Merge branch 'main' into samgst/updateNotifEndpoint
2 parents fd31e3f + 606cadf commit 12e50ee

File tree

7 files changed

+36
-39
lines changed

7 files changed

+36
-39
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type" : "bugfix",
3+
"description" : " Chosing cancel on sign out confirmation now cancels the sign out and does not delete profiles from ~/.aws/config (#5167)"
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type" : "bugfix",
3+
"description" : "Fix for /review LLM based code issues for file review on windows"
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type" : "bugfix",
3+
"description" : "Fix for File Review payload and Regex error for payload generation"
4+
}

plugins/amazonq/codewhisperer/jetbrains-community/resources/META-INF/plugin-codewhisperer.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,10 @@
114114

115115

116116
<group id="aws.toolkit.codewhisperer.toolbar.security">
117-
<group id="codewhisperer.toolbar.security.filter" icon="com.intellij.icons.ExpUiIcons.General.Filter" text="Filter" popup="true" >
117+
<group id="codewhisperer.toolbar.security.filter" icon="AllIcons.General.Filter" text="Filter" popup="true">
118118
<separator text="Severity"/>
119-
<action class="software.aws.toolkits.jetbrains.services.codewhisperer.codescan.actions.CodeWhispererCodeScanFilterGroup" text="Severity"/>
119+
<group id="CodeWhispererCodeScanFilterGroup"
120+
class="software.aws.toolkits.jetbrains.services.codewhisperer.codescan.actions.CodeWhispererCodeScanFilterGroup" text="Severity"/>
120121
</group>
121122
</group>
122123

plugins/amazonq/codewhisperer/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codewhisperer/codescan/sessionconfig/CodeScanSessionConfig.kt

Lines changed: 9 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import software.aws.toolkits.jetbrains.services.codewhisperer.codescan.cannotFin
2525
import software.aws.toolkits.jetbrains.services.codewhisperer.codescan.fileTooLarge
2626
import software.aws.toolkits.jetbrains.services.codewhisperer.codescan.noFileOpenError
2727
import software.aws.toolkits.jetbrains.services.codewhisperer.codescan.noSupportedFilesError
28-
import software.aws.toolkits.jetbrains.services.codewhisperer.codescan.utils.AmazonQCodeReviewGitUtils.getGitRepositoryRoot
2928
import software.aws.toolkits.jetbrains.services.codewhisperer.codescan.utils.AmazonQCodeReviewGitUtils.getUnstagedFiles
3029
import software.aws.toolkits.jetbrains.services.codewhisperer.codescan.utils.AmazonQCodeReviewGitUtils.isGitRoot
3130
import software.aws.toolkits.jetbrains.services.codewhisperer.codescan.utils.AmazonQCodeReviewGitUtils.runGitDiffHead
@@ -163,40 +162,17 @@ class CodeScanSessionConfig(
163162
return ""
164163
}
165164
try {
166-
getGitRepositoryRoot(file)?.let { root ->
167-
// If it's a git repo, use git logic
168-
val relativePath = runCatching {
169-
file.toNioPath().relativeTo(root.toNioPath()).pathString
170-
}.getOrElse {
171-
LOG.debug { "Failed to calculate relative path: ${it.message}" }
172-
return ""
173-
}
174-
175-
return runGitDiffHead(
176-
projectName = project.name,
177-
root = root,
178-
relativeFilePath = relativePath,
179-
newFile = true
180-
)
181-
} ?: run {
182-
// For non-git repos, use project root as base
183-
val projectRootPath = projectRoot.toNioPath()
184-
val relativePath = runCatching {
185-
file.toNioPath().relativeTo(projectRootPath).pathString
186-
}.getOrElse {
187-
LOG.debug { "Failed to calculate relative path from project root: ${it.message}" }
188-
return ""
189-
}
190-
191-
return runGitDiffHead(
192-
projectName = project.name,
193-
root = projectRoot,
194-
relativeFilePath = relativePath,
195-
newFile = true // Always treat as new file for non-git repos
196-
)
165+
val projectRootNio = projectRoot.toNioPath()
166+
val fileNio = file.toNioPath()
167+
168+
return buildString {
169+
append("+++ b/")
170+
append(project.name)
171+
append('/')
172+
append(fileNio.relativeTo(projectRootNio).toString().replace(File.separator, "/"))
197173
}
198174
} catch (e: Exception) {
199-
LOG.debug { "Failed to create git diff: ${e.message}" }
175+
LOG.debug(e) { "Failed to create git diff" }
200176
return ""
201177
}
202178
}

plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/credentials/actions/SsoLogoutAction.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import com.intellij.openapi.ui.MessageDialogBuilder
1010
import software.aws.toolkits.jetbrains.core.credentials.AwsBearerTokenConnection
1111
import software.aws.toolkits.jetbrains.core.credentials.ProfileSsoManagedBearerSsoConnection
1212
import software.aws.toolkits.jetbrains.core.credentials.ToolkitConnectionManagerListener
13-
import software.aws.toolkits.jetbrains.core.credentials.deleteSsoConnection
1413
import software.aws.toolkits.jetbrains.core.credentials.logoutFromSsoConnection
1514
import software.aws.toolkits.resources.AwsCoreBundle
1615
import software.aws.toolkits.telemetry.UiTelemetry
@@ -23,8 +22,8 @@ class SsoLogoutAction(private val value: AwsBearerTokenConnection) : DumbAwareAc
2322
AwsCoreBundle.message("gettingstarted.auth.idc.sign.out.confirmation.title"),
2423
AwsCoreBundle.message("gettingstarted.auth.idc.sign.out.confirmation")
2524
).yesText(AwsCoreBundle.message("general.confirm")).ask(e.project)
26-
if (confirmDeletion) {
27-
deleteSsoConnection(value)
25+
if (!confirmDeletion) {
26+
return
2827
}
2928
}
3029
logoutFromSsoConnection(e.project, value)

plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/FeatureDevSessionContext.kt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,16 @@ class FeatureDevSessionContext(val project: Project, val maxProjectSizeBytes: Lo
8383
private val gitIgnoreFile = File(selectedSourceFolder.path, ".gitignore")
8484

8585
init {
86-
ignorePatternsWithGitIgnore = (ignorePatterns + parseGitIgnore().map { Regex(it) }).toList()
86+
ignorePatternsWithGitIgnore = try {
87+
buildList {
88+
addAll(ignorePatterns)
89+
parseGitIgnore().mapNotNull { pattern ->
90+
runCatching { Regex(pattern) }.getOrNull()
91+
}.let { addAll(it) }
92+
}
93+
} catch (e: Exception) {
94+
emptyList()
95+
}
8796
}
8897

8998
fun getProjectZip(): ZipCreationResult {

0 commit comments

Comments
 (0)