Skip to content

Commit

Permalink
Merge branch 'main' into pomParse
Browse files Browse the repository at this point in the history
  • Loading branch information
dhasani23 authored Aug 5, 2024
2 parents 6d8be48 + b7e3d29 commit fdfd9fd
Show file tree
Hide file tree
Showing 33 changed files with 169 additions and 2,548 deletions.
20 changes: 20 additions & 0 deletions .changes/3.21.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"date" : "2024-08-01",
"version" : "3.21",
"entries" : [ {
"type" : "bugfix",
"description" : "Fix NullPointerException that may happen when re-authenticating to Amazon Q"
}, {
"type" : "bugfix",
"description" : "Amazon Q Chat: Fixing issue with the max tabs notification not being dismissible"
}, {
"type" : "bugfix",
"description" : "Fix Amazon Q chat context menu actions show up in all chat windows"
}, {
"type" : "bugfix",
"description" : "Amazon Q Chat: Fixing issue with an incorrect input cursor position in the prompt text box"
}, {
"type" : "bugfix",
"description" : "Amazon Q Chat: Showing/hiding the scrollbars is now controlled by the OS settings"
} ]
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type" : "bugfix",
"description" : "fix(Amazon Q Code Transformation): prevent empty chat bubble from appearing when starting or cancelling a transformation"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type" : "bugfix",
"description" : "Fix inability to open files on double click and open context menu on right click in the S3 bucket viewer"
}
3 changes: 3 additions & 0 deletions .github/workflows/qodana.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ concurrency:
jobs:
qodana:
runs-on: ubuntu-latest
permissions:
checks: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Maximize Build Space
if: runner.os == 'Linux'
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# _3.21_ (2024-08-01)
- **(Bug Fix)** Fix NullPointerException that may happen when re-authenticating to Amazon Q
- **(Bug Fix)** Amazon Q Chat: Fixing issue with the max tabs notification not being dismissible
- **(Bug Fix)** Fix Amazon Q chat context menu actions show up in all chat windows
- **(Bug Fix)** Amazon Q Chat: Fixing issue with an incorrect input cursor position in the prompt text box
- **(Bug Fix)** Amazon Q Chat: Showing/hiding the scrollbars is now controlled by the OS settings

# _3.20_ (2024-07-26)
- **(Bug Fix)** Fix Q chat not responding in 2023.2 and 2023.3

Expand Down
16 changes: 0 additions & 16 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,6 @@ plugins {
}

allprojects {
repositories {
val codeArtifactUrl: Provider<String> = providers.environmentVariable("CODEARTIFACT_URL")
val codeArtifactToken: Provider<String> = providers.environmentVariable("CODEARTIFACT_AUTH_TOKEN")
if (codeArtifactUrl.isPresent && codeArtifactToken.isPresent) {
maven {
url = uri(codeArtifactUrl.get())
credentials {
username = "aws"
password = codeArtifactToken.get()
}
}
}
mavenCentral()
gradlePluginPortal()
}

configurations.configureEach {
resolutionStrategy {
// need to figure out how to fail only on non-platform dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

package software.aws.toolkits.gradle.intellij

import org.gradle.api.Action
import org.gradle.api.Project
import org.gradle.api.provider.Property
import org.gradle.api.provider.Provider
Expand Down
12 changes: 1 addition & 11 deletions buildSrc/src/main/kotlin/toolkit-intellij-plugin.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
// Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
import org.jetbrains.intellij.platform.gradle.tasks.aware.SandboxAware
import software.aws.toolkits.gradle.ciOnly
import software.aws.toolkits.gradle.intellij.ToolkitIntelliJExtension

private val toolkitIntelliJ = project.extensions.create<ToolkitIntelliJExtension>("intellijToolkit")
project.extensions.create<ToolkitIntelliJExtension>("intellijToolkit")

plugins {
id("org.jetbrains.intellij.platform.module")
Expand All @@ -16,14 +14,6 @@ intellijPlatform {
instrumentCode = false
}

// there is an issue if this is declared more than once in a project (either directly or through script plugins)
repositories {
intellijPlatform {
defaultRepositories()
jetbrainsRuntime()
}
}

dependencies {
intellijPlatform {
instrumentationTools()
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: Apache-2.0

# Toolkit Version
toolkitVersion=3.21-SNAPSHOT
toolkitVersion=3.22-SNAPSHOT

# Publish Settings
publishToken=
Expand Down
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ awsSdk = "2.26.25"
commonmark = "0.22.0"
detekt = "1.23.6"
intellijExt = "1.1.8"
# match with <root>/settings.gradle.kts
intellijGradle = "2.0.0"
intellijRemoteRobot = "0.11.22"
jackson = "2.16.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,20 +218,12 @@ class CodeTransformTelemetryManager(private val project: Project) {
}

// Replace the input as needed to support Gradle and other transformation types.
fun localBuildProject(buildCommand: CodeTransformBuildCommand, telemetryErrorMessage: String?, isCanceled: Boolean = false) {
val result: Result = if (telemetryErrorMessage.isNullOrEmpty()) {
Result.Succeeded
} else if (isCanceled) {
Result.Cancelled
} else {
Result.Failed
}

fun localBuildProject(buildCommand: CodeTransformBuildCommand, localBuildResult: Result, telemetryErrorMessage: String?) {
CodetransformTelemetry.localBuildProject(
codeTransformBuildCommand = buildCommand,
codeTransformSessionId = sessionId,
result = result,
reason = telemetryErrorMessage,
result = localBuildResult,
reason = if (telemetryErrorMessage.isNullOrEmpty()) null else telemetryErrorMessage,
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import kotlinx.coroutines.runBlocking
import software.aws.toolkits.core.utils.debug
import software.aws.toolkits.core.utils.error
import software.aws.toolkits.core.utils.getLogger
import software.aws.toolkits.core.utils.info
import software.aws.toolkits.jetbrains.services.amazonq.apps.AmazonQAppInitContext
import software.aws.toolkits.jetbrains.services.amazonq.auth.AuthController
import software.aws.toolkits.jetbrains.services.amazonq.auth.AuthFollowUpType
Expand Down Expand Up @@ -214,8 +215,9 @@ class CodeTransformChatController(
}

// this should never throw the RuntimeException since invalid JDK case is already handled in previous validation step
val sourceJdk = ModuleUtil.findModuleForFile(moduleVirtualFile, context.project)?.tryGetJdk(context.project) ?: context.project.tryGetJdk()
?: throw RuntimeException("Unable to determine source JDK version")
val moduleJdkVersion = ModuleUtil.findModuleForFile(moduleVirtualFile, context.project)?.tryGetJdk(context.project)
logger.info { "Found project JDK version: ${context.project.tryGetJdk()}, module JDK version: $moduleJdkVersion. Module JDK version prioritized." }
val sourceJdk = moduleJdkVersion ?: context.project.tryGetJdk() ?: throw RuntimeException("Unable to determine source JDK version")

val selection = CustomerSelection(
moduleVirtualFile,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class CodeTransformChatHelper(
suspend fun addNewMessage(
content: CodeTransformChatMessageContent,
messageIdOverride: String? = null,
clearPreviousItemButtons: Boolean? = true
clearPreviousItemButtons: Boolean? = false
) {
if (activeCodeTransformTabId == null || chatSessionStorage.getSession(activeCodeTransformTabId as String).isAuthenticating) {
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import software.aws.toolkits.jetbrains.services.codemodernizer.model.MavenCopyCo
import software.aws.toolkits.jetbrains.services.codemodernizer.model.MavenDependencyReportCommandsResult
import software.aws.toolkits.telemetry.CodeTransformBuildCommand
import software.aws.toolkits.telemetry.CodeTransformMavenBuildCommand
import software.aws.toolkits.telemetry.Result
import java.io.File
import java.nio.file.Files
import java.nio.file.Path
Expand Down Expand Up @@ -66,8 +67,8 @@ fun runMavenCopyCommands(sourceFolder: File, buildlogBuilder: StringBuilder, log
val currentTimestamp = System.currentTimeMillis()
val destinationDir = Files.createTempDirectory("transformation_dependencies_temp_$currentTimestamp")
val telemetry = CodeTransformTelemetryManager.getInstance(project)
var telemetryIsCancelled = false
var telemetryErrorMessage: String? = null
var telemetryErrorMessage = ""
var telemetryLocalBuildResult = Result.Succeeded

logger.info { "Executing IntelliJ bundled Maven" }
try {
Expand All @@ -85,10 +86,10 @@ fun runMavenCopyCommands(sourceFolder: File, buildlogBuilder: StringBuilder, log
logger.info { successMsg }
buildlogBuilder.appendLine(successMsg)
} else if (copyDependenciesRunnable.isTerminated()) {
telemetryIsCancelled = true
telemetryLocalBuildResult = Result.Cancelled
return MavenCopyCommandsResult.Cancelled
} else {
telemetryErrorMessage = "Maven Copy: bundled Maven failed: exitCode ${copyDependenciesRunnable.isComplete()}"
telemetryErrorMessage += "Maven Copy: bundled Maven failed. "

// TODO: deprecated metric - remove after BI started using new metric
emitMavenFailure("Maven Copy: bundled Maven failed: exitCode ${copyDependenciesRunnable.isComplete()}", logger, telemetry)
Expand All @@ -103,14 +104,15 @@ fun runMavenCopyCommands(sourceFolder: File, buildlogBuilder: StringBuilder, log
logger.info { successMsg }
buildlogBuilder.appendLine(successMsg)
} else if (cleanRunnable.isTerminated()) {
telemetryIsCancelled = true
telemetryLocalBuildResult = Result.Cancelled
return MavenCopyCommandsResult.Cancelled
} else {
telemetryErrorMessage = "Maven Clean: bundled Maven failed: exitCode ${cleanRunnable.isComplete()}"
telemetryErrorMessage += "Maven Clean: bundled Maven failed."

// TODO: deprecated metric - remove after BI started using new metric
emitMavenFailure("Maven Clean: bundled Maven failed: exitCode ${cleanRunnable.isComplete()}", logger, telemetry)

telemetryLocalBuildResult = Result.Failed
return MavenCopyCommandsResult.Failure
}

Expand All @@ -123,14 +125,15 @@ fun runMavenCopyCommands(sourceFolder: File, buildlogBuilder: StringBuilder, log
logger.info { successMsg }
buildlogBuilder.appendLine(successMsg)
} else if (installRunnable.isTerminated()) {
telemetryIsCancelled = true
telemetryLocalBuildResult = Result.Cancelled
return MavenCopyCommandsResult.Cancelled
} else {
telemetryErrorMessage = "Maven Install: bundled Maven failed: exitCode ${installRunnable.isComplete()}"
telemetryErrorMessage += "Maven Install: bundled Maven failed."

// TODO: deprecated metric - remove after BI started using new metric
emitMavenFailure("Maven Install: bundled Maven failed: exitCode ${installRunnable.isComplete()}", logger, telemetry)

telemetryLocalBuildResult = Result.Failed
return MavenCopyCommandsResult.Failure
}
} catch (t: Throwable) {
Expand All @@ -140,10 +143,11 @@ fun runMavenCopyCommands(sourceFolder: File, buildlogBuilder: StringBuilder, log
val errorMessage = "IntelliJ bundled Maven executed failed: ${t.message}"
logger.error(t) { errorMessage }
telemetryErrorMessage = errorMessage
telemetryLocalBuildResult = Result.Failed
return MavenCopyCommandsResult.Failure
} finally {
// emit telemetry
telemetry.localBuildProject(CodeTransformBuildCommand.IDEBundledMaven, telemetryErrorMessage, telemetryIsCancelled)
telemetry.localBuildProject(CodeTransformBuildCommand.IDEBundledMaven, telemetryLocalBuildResult, telemetryErrorMessage)
}
// When all commands executed successfully, show the transformation hub
return MavenCopyCommandsResult.Success(destinationDir.toFile())
Expand Down
9 changes: 5 additions & 4 deletions plugins/amazonq/mynah-ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion plugins/amazonq/mynah-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"lintfix": "eslint -c .eslintrc.js --fix --ext .ts ."
},
"dependencies": {
"@aws/mynah-ui-chat": "npm:@aws/[email protected].2",
"@aws/mynah-ui-chat": "npm:@aws/[email protected].5",
"@types/node": "^14.18.5",
"fs-extra": "^10.0.1",
"ts-node": "^10.7.0",
Expand Down
2 changes: 1 addition & 1 deletion plugins/core/core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies {
api(libs.aws.lambda)
api(libs.aws.s3)
api(libs.aws.sso)
// api(libs.aws.ssooidc)
api(libs.aws.ssooidc)
api(libs.aws.sts)
api(libs.bundles.jackson)
implementation(libs.commonmark)
Expand Down
Loading

0 comments on commit fdfd9fd

Please sign in to comment.