Skip to content

fix(amazonq): /doc add suppoort for uploading infrastructure diagrams #5357

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 2 commits into from
Feb 18, 2025

Conversation

vikshe
Copy link
Contributor

@vikshe vikshe commented Feb 11, 2025

Upload infrastructure diagram image files during documentation generation

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • [ X ] New feature (non-breaking change which adds functionality)

Description

Upload infrastructure diagram image files during documentation generation

preview

Checklist

  • [X ] My code follows the code style of this project
  • I have added tests to cover my changes
  • [ X ] A short description of the change has been added to the CHANGELOG if the change is customer-facing in the IDE.
  • I have added metrics for my changes (if required)

License

I confirm that my contribution is made under the terms of the Apache 2.0 license.

@vikshe vikshe requested review from a team as code owners February 11, 2025 16:57
@vikshe vikshe marked this pull request as draft February 11, 2025 17:02
@vikshe vikshe force-pushed the bugfix/amazon-q-doc-upload-diagram branch from 9e5289b to 9308cd1 Compare February 11, 2025 17:17
import software.aws.toolkits.jetbrains.services.amazonqDoc.messages.FollowUp
import software.aws.toolkits.jetbrains.services.amazonqDoc.messages.FollowUpStatusType
import software.aws.toolkits.jetbrains.services.amazonqDoc.messages.FollowUpTypes
import software.aws.toolkits.resources.message

Check warning

Code scanning / QDJVMC

Usage of redundant or deprecated syntax or deprecated symbols Warning

Remove deprecated symbol import
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please address

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AmazonQ bundle doesn't have those messages yet


val NEW_SESSION_FOLLOWUPS: List<FollowUp> = listOf(
FollowUp(
pillText = message("amazonqDoc.prompt.reject.new_task"),

Check warning

Code scanning / QDJVMC

Usage of redundant or deprecated syntax or deprecated symbols Warning

'message(String, vararg Any): String' is deprecated. Use extension-specific localization bundle instead
status = FollowUpStatusType.Info
),
FollowUp(
pillText = message("amazonqDoc.prompt.reject.close_session"),

Check warning

Code scanning / QDJVMC

Usage of redundant or deprecated syntax or deprecated symbols Warning

'message(String, vararg Any): String' is deprecated. Use extension-specific localization bundle instead
@vikshe vikshe force-pushed the bugfix/amazon-q-doc-upload-diagram branch from 9308cd1 to 0a24b17 Compare February 11, 2025 22:53
@vikshe vikshe marked this pull request as ready for review February 14, 2025 16:23
const val DIAGRAM_SVG_EXT = "svg"
const val DIAGRAM_DOT_EXT = "dot"
val SUPPORTED_DIAGRAM_EXT_SET: Set<String> = setOf(DIAGRAM_SVG_EXT, DIAGRAM_DOT_EXT)
val SUPPORTED_DIAGRAM_FILE_NAME_SET: Set<String> = SUPPORTED_DIAGRAM_EXT_SET.map { "infra." + it }.toSet()

Check notice

Code scanning / QDJVMC

String concatenation that can be converted to string template

'String' concatenation can be converted to a template
private val logger = getLogger<AmazonQCodeGenerateClient>()

class DocSession(val tabID: String, val project: Project) {
var context: FeatureDevSessionContext
var context: DocSessionContext

Check notice

Code scanning / QDJVMC

Join declaration and assignment

Can be joined with assignment
*/
override fun getAdditionalGitIgnoreBinaryFilesRules(): Set<String> {
val ignoreRules = super.getAdditionalGitIgnoreBinaryFilesRules()
val diagramExtRulesInGitIgnoreFormatSet = SUPPORTED_DIAGRAM_EXT_SET.map { "*." + it }.toSet()

Check notice

Code scanning / QDJVMC

String concatenation that can be converted to string template

'String' concatenation can be converted to a template
import software.aws.toolkits.jetbrains.services.amazonqDoc.messages.FollowUp
import software.aws.toolkits.jetbrains.services.amazonqDoc.messages.FollowUpStatusType
import software.aws.toolkits.jetbrains.services.amazonqDoc.messages.FollowUpTypes
import software.aws.toolkits.resources.message

Check warning

Code scanning / QDJVMC

Usage of redundant or deprecated syntax or deprecated symbols

Remove deprecated symbol import

val NEW_SESSION_FOLLOWUPS: List<FollowUp> = listOf(
FollowUp(
pillText = message("amazonqDoc.prompt.reject.new_task"),

Check warning

Code scanning / QDJVMC

Usage of redundant or deprecated syntax or deprecated symbols

'message(String, vararg Any): String' is deprecated. Use extension-specific localization bundle instead
status = FollowUpStatusType.Info
),
FollowUp(
pillText = message("amazonqDoc.prompt.reject.close_session"),

Check warning

Code scanning / QDJVMC

Usage of redundant or deprecated syntax or deprecated symbols

'message(String, vararg Any): String' is deprecated. Use extension-specific localization bundle instead
const val DIAGRAM_SVG_EXT = "svg"
const val DIAGRAM_DOT_EXT = "dot"
val SUPPORTED_DIAGRAM_EXT_SET: Set<String> = setOf(DIAGRAM_SVG_EXT, DIAGRAM_DOT_EXT)
val SUPPORTED_DIAGRAM_FILE_NAME_SET: Set<String> = SUPPORTED_DIAGRAM_EXT_SET.map { "infra." + it }.toSet()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how does the user know this magic name will cause it to be included in the context?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved magic word into constant

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see internal discussion

@vikshe vikshe force-pushed the bugfix/amazon-q-doc-upload-diagram branch from 77d5577 to fec3b27 Compare February 18, 2025 20:19
@vikshe vikshe enabled auto-merge (squash) February 18, 2025 22:30
@vikshe vikshe merged commit 93b3b5a into aws:main Feb 18, 2025
11 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants