Skip to content
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

feat(amazonq): /doc: add support for infrastructure diagrams #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vikshe
Copy link
Owner

@vikshe vikshe commented Jan 31, 2025

Amazon Q /doc: Add support for infrastructure diagrams

image

  • Treat all work as PUBLIC. Private feature/x branches will not be squash-merged at release time.
  • Your code changes must meet the guidelines in CONTRIBUTING.md.
  • License: I confirm that my contribution is made under the terms of the Apache 2.0 license.

@vikshe vikshe force-pushed the features/infra-d branch 2 times, most recently from b64edd6 to 4a69a9e Compare February 1, 2025 01:20
avi-alpert

This comment was marked as resolved.

@vikshe vikshe force-pushed the features/infra-d branch 2 times, most recently from f536bac to 341ca89 Compare February 3, 2025 15:23
@@ -363,7 +364,9 @@ export class PrepareCodeGenState implements SessionState {
this.config.workspaceRoots,
this.config.workspaceFolders,
action.telemetry,
span
span,
new AdmZip(),

This comment was marked as resolved.

Copy link
Owner Author

Choose a reason for hiding this comment

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

thanks. Updated

@vikshe vikshe changed the title amazon q /dev: add support for infrastructure diagrams feat(amazonq): /doc: add support for infrastructure diagrams Feb 3, 2025
@vikshe vikshe requested a review from avi-alpert February 3, 2025 16:16
@vikshe vikshe marked this pull request as draft February 3, 2025 16:17
@vikshe vikshe marked this pull request as ready for review February 3, 2025 16:17
@vikshe vikshe marked this pull request as draft February 3, 2025 16:19
@vikshe vikshe marked this pull request as ready for review February 3, 2025 16:19
@vikshe vikshe closed this Feb 3, 2025
@vikshe vikshe reopened this Feb 3, 2025
function isInfraDiagramFile(relativePath: string) {
return (
relativePath.toLowerCase() === 'infra.dot' ||
relativePath.toLowerCase().endsWith('/infra.dot') ||

Choose a reason for hiding this comment

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

relativeFilePath on windows might use backwards slashes

Copy link
Owner Author

Choose a reason for hiding this comment

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

updated

@vikshe vikshe force-pushed the features/infra-d branch 4 times, most recently from a832ae6 to 98c2fa2 Compare February 3, 2025 19:44
@@ -26,6 +30,15 @@ export async function checkForDevFile(root: string) {
return hasDevFile
}

function isInfraDiagramFile(relativePath: string) {
return (
relativePath.toLowerCase().endsWith('docs/infra.dot') ||

Choose a reason for hiding this comment

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

path.join could be used here instead

// We only respect gitignore file rules if useAutoBuildFeature is on, this is to avoid dropping necessary files for building the code (e.g. png files imported in js code)
const files = await collectFiles(repoRootPaths, workspaceFolders, true, maxRepoSizeBytes, !useAutoBuildFeature)
if (!useAutoBuildFeature) {
if (isIncludeInfraDiagram) {

Choose a reason for hiding this comment

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

is there a way we could avoid the additional special case logic here? could we either a) remove svg from the exclude patterns, or b) pass in true for defaultExcludePatterns (like /dev does with useAutoBuildFeature). with the addition of isIncludeInfraDiagram its hard to follow all the different scenarios

}
export type CollectFilesFileFilter = (relativePath: string) => boolean // returns true if file should be filtered out

export async function collectFiles2(

Choose a reason for hiding this comment

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

The name of this function doesn't add value, why is there a second collect files function? take a look at naming section in docs/CODE_GUIDELINES.md

Choose a reason for hiding this comment

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

It looks like the intention here is to have collectFiles use a labeled options object instead of individual parameters, if thats the case, perhaps collectFiles itself should be changed instead of adding a new function

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.

2 participants