-
Notifications
You must be signed in to change notification settings - Fork 273
feat(amazonq): Enable one-click collection of logs from chat #5923
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Qodana Community for JVM4 new problems were found
💡 Qodana analysis was run in the pull request mode: only the changed files were checked Contact Qodana teamContact us at [email protected]
|
...rains-community/src/software/aws/toolkits/jetbrains/services/amazonq/GetAmazonQLogsAction.kt
Fixed
Show fixed
Hide fixed
...rains-community/src/software/aws/toolkits/jetbrains/services/amazonq/GetAmazonQLogsAction.kt
Fixed
Show fixed
Hide fixed
...rains-community/src/software/aws/toolkits/jetbrains/services/amazonq/GetAmazonQLogsAction.kt
Fixed
Show fixed
Hide fixed
...rains-community/src/software/aws/toolkits/jetbrains/services/amazonq/GetAmazonQLogsAction.kt
Fixed
Show fixed
Hide fixed
Qodana Community for JVM4 new problems were found
💡 Qodana analysis was run in the pull request mode: only the changed files were checked Contact Qodana teamContact us at [email protected]
|
...rains-community/src/software/aws/toolkits/jetbrains/services/amazonq/GetAmazonQLogsAction.kt
Fixed
Show fixed
Hide fixed
...rains-community/src/software/aws/toolkits/jetbrains/services/amazonq/GetAmazonQLogsAction.kt
Fixed
Show fixed
Hide fixed
...rains-community/src/software/aws/toolkits/jetbrains/services/amazonq/GetAmazonQLogsAction.kt
Fixed
Show fixed
Hide fixed
...rains-community/src/software/aws/toolkits/jetbrains/services/amazonq/GetAmazonQLogsAction.kt
Fixed
Show fixed
Hide fixed
...rains-community/src/software/aws/toolkits/jetbrains/services/amazonq/GetAmazonQLogsAction.kt
Outdated
Show resolved
Hide resolved
...rains-community/src/software/aws/toolkits/jetbrains/services/amazonq/GetAmazonQLogsAction.kt
Outdated
Show resolved
Hide resolved
plugins/amazonq/chat/jetbrains-community/resources/META-INF/plugin-chat.xml
Outdated
Show resolved
Hide resolved
import software.aws.toolkits.resources.AmazonQBundle.message | ||
|
||
class GetAmazonQLogsAction : DumbAwareAction( | ||
AmazonQBundle.message("amazonq.getLogs.tooltip.text") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
override fun update(e: AnActionEvent) { | ||
super.update(e) | ||
val baseIcon = IconLoader.getIcon("/icons/file.svg", GetAmazonQLogsAction::class.java) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
icon loader has a cache, but load the icon once in the action initialization so we are not constantly trying to do this on EDT
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving the value to class variables and updating the usage in update
val action = ActionManager.getInstance().getAction("CollectZippedLogs") | ||
val datacontxt = SimpleDataContext.builder().add(CommonDataKeys.PROJECT, project).build() | ||
val ae = AnActionEvent.createEvent(action, datacontxt, null, ActionPlaces.UNKNOWN, ActionUiKind.POPUP, null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is technically internal so we should have a test
fun showLogCollectionWarningGetLogs(project: Project) { | ||
try { | ||
val action = ActionManager.getInstance().getAction("CollectZippedLogs") | ||
val datacontxt = SimpleDataContext.builder().add(CommonDataKeys.PROJECT, project).build() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
val datacontxt = SimpleDataContext.builder().add(CommonDataKeys.PROJECT, project).build() | |
val dataContext = SimpleDataContext.builder().add(CommonDataKeys.PROJECT, project).build() |
showLogCollectionWarningGetLogs(project) | ||
} | ||
|
||
companion object { |
Check warning
Code scanning / QDJVMC
Companion object in extensions Warning
fun showLogCollectionWarningGetLogs(project: Project) { | ||
if (Messages.showOkCancelDialog( | ||
message("amazonq.logs.warning"), | ||
message("amazonq.getLogs"), |
Check warning
Code scanning / QDJVMC
Incorrect string capitalization Warning
runUnderProgressIfNeeded(project, message("amazonq.getLogs"), cancelable = true) { | ||
runBlocking { | ||
try { | ||
RevealFileAction.openFile(LogPacker.packLogs(project)) |
Check warning
Code scanning / QDJVMC
Unstable API Usage Warning
runUnderProgressIfNeeded(project, message("amazonq.getLogs"), cancelable = true) { | ||
runBlocking { | ||
try { | ||
RevealFileAction.openFile(LogPacker.packLogs(project)) |
Check warning
Code scanning / QDJVMC
Unstable API Usage Warning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Investigating moving to another action in a follow up PR
Types of changes
Description
Add the ability to collect logs from chat with one click
License
I confirm that my contribution is made under the terms of the Apache 2.0 license.