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): auto-download results #6519

Merged
merged 2 commits into from
Feb 7, 2025
Merged

Conversation

dhasani23
Copy link
Contributor

Problem

Transformation results/artifacts expire after 24h, and sometimes users forget to manually click the "Download Proposed Changes" button within that time period.

Solution

Auto-download the results from S3 when ready.


  • 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.

@dhasani23 dhasani23 requested review from a team as code owners February 6, 2025 19:21
Copy link

github-actions bot commented Feb 6, 2025

  • This pull request modifies code in src/* but no tests were added/updated.
    • Confirm whether tests should be added or ensure the PR description explains why tests are not required.


// attempt download for user
if (transformByQState.isSucceeded() || transformByQState.isPartiallySucceeded()) {
await vscode.commands.executeCommand('aws.amazonq.transformationHub.reviewChanges.startReview')
Copy link
Contributor

Choose a reason for hiding this comment

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

Just as a random aside, ideally this would have used our internal Commands wrapper core/src/shared/vscode/commands2.ts. This wrapper basically allows you to define the command as a const that you can execute later which is much more robust then having to pass around command ids!

In order to do that you would need to register aws.amazonq.transformationHub.reviewChanges.startReview like:

export const startReview = Commands.declare('aws.amazonq.transformationHub.reviewChanges.startReview',
    () => async () => {
       // implement me here
    }
)

and then here you could just do startReview.tryExecute() that way you don't have to care about underlying id's!

See: https://github.com/aws/aws-toolkit-vscode/blob/master/docs/arch_develop.md#commands for more info

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Noted, https://github.com/aws/aws-toolkit-vscode/blob/master/packages/core/src/codewhisperer/service/transformByQ/transformationResultsViewProvider.ts is full of registered commands that could be refactored this way, so I think it's better if I do all of that in a separate PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm okay with merging this as is as long as you commit/agree to making that change 😄. It should be like 15 minutes worth of work tops

Copy link
Contributor Author

@dhasani23 dhasani23 Feb 7, 2025

Choose a reason for hiding this comment

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

Added a TODO comment and made a note of it so I don't forget

@jpinkney-aws jpinkney-aws merged commit 750770f into aws:master Feb 7, 2025
25 of 26 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