Skip to content

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
@github-actions
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
s7ab059789 pushed a commit to s7ab059789/aws-toolkit-vscode that referenced this pull request Feb 19, 2025
## 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](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.

---------

Co-authored-by: David Hasani <[email protected]>
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