From 618d1e7f5caf5eb709d5bf8abd844664b7a9f416 Mon Sep 17 00:00:00 2001 From: Avi Alpert Date: Mon, 13 Jan 2025 09:57:35 -0500 Subject: [PATCH 1/2] feat(amazonq): add error message for updated README too large --- .../feature-d6e1bcfb-6d81-4b3a-af08-828ff10c02b1.json | 4 ++++ .../services/amazonqDoc/session/DocGenerationState.kt | 5 +++++ .../aws/toolkits/resources/MessagesBundle.properties | 1 + 3 files changed, 10 insertions(+) create mode 100644 .changes/next-release/feature-d6e1bcfb-6d81-4b3a-af08-828ff10c02b1.json diff --git a/.changes/next-release/feature-d6e1bcfb-6d81-4b3a-af08-828ff10c02b1.json b/.changes/next-release/feature-d6e1bcfb-6d81-4b3a-af08-828ff10c02b1.json new file mode 100644 index 00000000000..24a502a4c8a --- /dev/null +++ b/.changes/next-release/feature-d6e1bcfb-6d81-4b3a-af08-828ff10c02b1.json @@ -0,0 +1,4 @@ +{ + "type" : "feature", + "description" : "/doc: Add error message for updated README too large" +} \ No newline at end of file diff --git a/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqDoc/session/DocGenerationState.kt b/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqDoc/session/DocGenerationState.kt index 18851be1376..52eed3c0c29 100644 --- a/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqDoc/session/DocGenerationState.kt +++ b/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqDoc/session/DocGenerationState.kt @@ -201,6 +201,11 @@ private suspend fun DocGenerationState.generateCode(codeGenerationId: String, mo ), -> docServiceError(message("amazonqDoc.exception.readme_too_large")) + codeGenerationResultState.codeGenerationStatusDetail()?.contains( + "README_UPDATE_TOO_LARGE" + ), + -> docServiceError(message("amazonqDoc.exception.readme_update_too_large")) + codeGenerationResultState.codeGenerationStatusDetail()?.contains( "WORKSPACE_TOO_LARGE" ), diff --git a/plugins/core/resources/resources/software/aws/toolkits/resources/MessagesBundle.properties b/plugins/core/resources/resources/software/aws/toolkits/resources/MessagesBundle.properties index 33dc4c99ec6..de50f6840db 100644 --- a/plugins/core/resources/resources/software/aws/toolkits/resources/MessagesBundle.properties +++ b/plugins/core/resources/resources/software/aws/toolkits/resources/MessagesBundle.properties @@ -50,6 +50,7 @@ amazonqDoc.exception.no_change_required=I couldn't find any code changes to upda amazonqDoc.exception.prompt_too_vague=I need more information to make changes to your README. Try providing some of the following details:\n- Which sections you want to modify\n- The content you want to add or remove\n- Specific issues that need correcting\n\nFor more information on prompt best practices, see the Amazon Q Developer documentation. amazonqDoc.exception.prompt_unrelated=These changes don't seem related to documentation. Try describing your changes again, using the following best practices:\n- Changes should relate to how project functionality is reflected in the README\n- Content you refer to should be available in your codebase\n\nFor more information on prompt best practices, see the Amazon Q Developer documentation. amazonqDoc.exception.readme_too_large=The README in your folder is too large for me to review. Try reducing the size of your README, or choose a folder with a smaller README. For more information on quotas, see the Amazon Q Developer documentation. +amazonqDoc.exception.readme_update_too_large=The updated README is too large. Try reducing the size of your README, or asking for a smaller update. For more information on quotas, see the Amazon Q Developer documentation. amazonqDoc.exception.workspace_empty=The folder you chose did not contain any source files in a supported language. Choose another folder and try again. For more information on supported languages, see the Amazon Q Developer documentation. amazonqDoc.inprogress_message.generating=Generating documentation... amazonqDoc.progress_message.baseline=This might take a few minutes. From 5887b2e5c39f70bc613a54aa0aa9d0de7478eaea Mon Sep 17 00:00:00 2001 From: Avi Alpert <131792194+avi-alpert@users.noreply.github.com> Date: Mon, 13 Jan 2025 16:31:51 -0500 Subject: [PATCH 2/2] Update .changes/next-release/feature-d6e1bcfb-6d81-4b3a-af08-828ff10c02b1.json Co-authored-by: manodnyab <66754471+manodnyab@users.noreply.github.com> --- .../feature-d6e1bcfb-6d81-4b3a-af08-828ff10c02b1.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changes/next-release/feature-d6e1bcfb-6d81-4b3a-af08-828ff10c02b1.json b/.changes/next-release/feature-d6e1bcfb-6d81-4b3a-af08-828ff10c02b1.json index 24a502a4c8a..ec9e2006859 100644 --- a/.changes/next-release/feature-d6e1bcfb-6d81-4b3a-af08-828ff10c02b1.json +++ b/.changes/next-release/feature-d6e1bcfb-6d81-4b3a-af08-828ff10c02b1.json @@ -1,4 +1,4 @@ { "type" : "feature", - "description" : "/doc: Add error message for updated README too large" + "description" : "/doc: Add error message if updated README is too large" } \ No newline at end of file