Skip to content

feat(amazonq): client-side build support #5587

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 16 commits into from
May 6, 2025
Merged

Conversation

dhasani23
Copy link
Contributor

@dhasani23 dhasani23 commented Apr 16, 2025

Types of changes

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

Description

Problem: We should perform builds client-side (rather than server-side) to handle customers’ unique / challenging local environments, which often cause our server-side build to fail.

Solution: Periodically download intermediate diff.patch files, apply them to a copy of the project, perform the local build, then upload the build logs and resume the transformation.

Checklist

  • My code follows the code style of this project
  • I have added tests to cover my changes
  • 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.

@dhasani23 dhasani23 requested review from a team as code owners April 16, 2025 18:18
@dhasani23 dhasani23 marked this pull request as draft April 16, 2025 18:18
@dhasani23 dhasani23 changed the title Maven csb v1 feat(amazonq): client-side build support Apr 16, 2025
@@ -375,6 +390,33 @@
type = CodeTransformChatMessageType.FinalizedAnswer,
)

fun buildUserInputCustomDependencyVersionsChatContent() = CodeTransformChatMessageContent(

Check warning

Code scanning / QDJVMC

Unused symbol Warning

Function "buildUserInputCustomDependencyVersionsChatContent" is never used
@@ -44,6 +64,8 @@ data class PollingResult(
val transformationPlan: TransformationPlan?,
)

private const val IS_CLIENT_SIDE_BUILD_ENABLED = false
Copy link
Contributor Author

Choose a reason for hiding this comment

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

You'll notice there are a good amount of TO-DOs in this PR — the intention is to merge this feature behind a feature flag (this one), and simply enable everything in a future PR, once we are ready to release. I'm tracking all TO-DOs to ensure when we release they are all addressed.

@dhasani23 dhasani23 marked this pull request as ready for review April 24, 2025 23:18
)

fun buildInvalidTargetJdkNameChatContent(jdkName: String) = CodeTransformChatMessageContent(
message = message("codemodernizer.chat.message.enter_jdk_name_error", jdkName),

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
}
}

// TODO: uncomment when releasing CSB
Copy link
Contributor

Choose a reason for hiding this comment

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

? isn't this the PR for the feature

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes but we have this feature broken down into 3 milestones. This PR is for milestones 1 and 2, to be merged behind a feature flag. My next PR will be for milestone 3 plus enabling the feature overall.

Comment on lines 7 to 10
var exitCode: Int? = null
private var output: String? = null

fun setExitCode(i: Int) {
Copy link
Contributor

Choose a reason for hiding this comment

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

might as well delete the setter

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will make it private again and add a getter

}

val (exitCode, buildOutput) = runClientSideBuild(targetDir, CodeModernizerManager.LOG, project)
getLogger<CodeModernizerManager>().info { "Ran client-side build with an exit code of $exitCode" }
Copy link
Contributor

Choose a reason for hiding this comment

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

can you extract this a private val

Suggested change
getLogger<CodeModernizerManager>().info { "Ran client-side build with an exit code of $exitCode" }
getLogger<CodeModernizerManager>().info { "Ran client-side build with an exit code of $exitCode" }

@rli rli merged commit 5c28a36 into aws:main May 6, 2025
11 of 12 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