-
Notifications
You must be signed in to change notification settings - Fork 272
feat(amazonq): builder id paid tier support #5801
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
37d60c0
feat(amazonq): expose 'Manage Subscriptions' action for builder id pa…
rli c14839f
hack for bugbash
rli aaf892e
Merge main into feature/bid-paid
aws-toolkit-automation 1f0be54
fix(amazonq): update login copy for builder id / IdC
rli c2fc89f
Merge remote-tracking branch 'origin/main' into HEAD
rli 8cb5ea2
Merge pull request #5791 from aws/autoMerge/feature/bid-paid
rli f8cd8a4
fix(amazonq): revert builder id "hack for bugbash" (#5800)
rli c6f87aa
changelog
rli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
.changes/next-release/feature-6de3f384-aa3b-47fe-b895-d41ef23ed6da.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"type" : "feature", | ||
"description" : "Support for Amazon Q Builder ID paid tier" | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
.../src/software/aws/toolkits/jetbrains/services/codewhisperer/actions/ManageSubscription.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package software.aws.toolkits.jetbrains.services.codewhisperer.actions | ||
|
||
import com.intellij.openapi.actionSystem.ActionUpdateThread | ||
import com.intellij.openapi.actionSystem.AnAction | ||
import com.intellij.openapi.actionSystem.AnActionEvent | ||
import com.intellij.openapi.progress.currentThreadCoroutineScope | ||
import com.intellij.openapi.project.DumbAware | ||
import kotlinx.coroutines.future.await | ||
import kotlinx.coroutines.launch | ||
import org.eclipse.lsp4j.ExecuteCommandParams | ||
import software.aws.toolkits.core.utils.error | ||
import software.aws.toolkits.core.utils.getLogger | ||
import software.aws.toolkits.jetbrains.core.credentials.AwsBearerTokenConnection | ||
import software.aws.toolkits.jetbrains.core.credentials.ToolkitConnectionManager | ||
import software.aws.toolkits.jetbrains.core.credentials.pinning.QConnection | ||
import software.aws.toolkits.jetbrains.core.credentials.sono.isSono | ||
import software.aws.toolkits.jetbrains.services.amazonq.lsp.AmazonQLspService | ||
|
||
class ManageSubscription : AnAction(), DumbAware { | ||
override fun getActionUpdateThread() = ActionUpdateThread.BGT | ||
|
||
override fun update(e: AnActionEvent) { | ||
val project = e.project | ||
// disable if user is IdC | ||
if (project == null) { | ||
e.presentation.isEnabledAndVisible = false | ||
} else { | ||
val connection = ToolkitConnectionManager.getInstance(project) | ||
.activeConnectionForFeature(QConnection.getInstance()) as? AwsBearerTokenConnection | ||
|
||
e.presentation.isEnabledAndVisible = connection.isSono() | ||
} | ||
} | ||
|
||
override fun actionPerformed(e: AnActionEvent) { | ||
val project = e.project ?: return | ||
currentThreadCoroutineScope().launch { | ||
Check warning on line 40 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codewhisperer/actions/ManageSubscription.kt
|
||
AmazonQLspService.getInstance(project).execute { lsp -> | ||
lsp.workspaceService.executeCommand( | ||
ExecuteCommandParams().apply { | ||
this.command = "aws/chat/manageSubscription" | ||
} | ||
) | ||
}.handleAsync { _, ex -> | ||
if (ex != null) { | ||
LOG.error(ex) { "Failed aws/chat/manageSubscription" } | ||
} | ||
}.await() | ||
} | ||
} | ||
|
||
companion object { | ||
private val LOG = getLogger<ManageSubscription>() | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check warning
Code scanning / QDJVMC
Unstable API Usage Warning